2#include <Midi/Commands/CommandFactory.hpp>
4#include <score/command/Command.hpp>
5#include <score/command/PropertyCommand.hpp>
6#include <score/model/path/PathSerialization.hpp>
8#include <Patternist/PatternModel.hpp>
11inline auto& CommandFactoryName()
13 return Midi::CommandFactoryName();
17 SCORE_COMMAND_DECL(Midi::CommandFactoryName(),
UpdatePattern,
"Update a pattern")
22 , m_old{model.patterns()[p]}
29 m_model.find(ctx).setPattern(m_id, m_old);
34 m_model.find(ctx).setPattern(m_id, m_new);
42 s << m_model << m_id << m_old << m_new;
47 s >> m_model >> m_id >> m_old >> m_new;
59 SCORE_COMMAND_DECL(Midi::CommandFactoryName(),
UpdatePatterns,
"Update patterns")
63 , m_old{model.patterns()}
64 , m_new{std::move(pat)}
70 m_model.find(ctx).setPatterns(m_old);
75 m_model.find(ctx).setPatterns(m_new);
81 s << m_model << m_old << m_new;
84 void deserializeImpl(
DataStreamOutput& s)
override { s >> m_model >> m_old >> m_new; }
88 std::vector<Pattern> m_old;
89 std::vector<Pattern> m_new;
93 Patternist, SetPatternChannel, ProcessModel::p_channel,
"Change channel")
94SCORE_COMMAND_DECL_T(Patternist::SetPatternChannel)
96 Patternist, SetCurrentPattern, ProcessModel::p_currentPattern, "Change pattern")
97SCORE_COMMAND_DECL_T(Patternist::SetCurrentPattern)
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
Definition PatternModel.hpp:48
Definition PatternProperties.hpp:16
Definition PatternProperties.hpp:58
The Command class.
Definition Command.hpp:34
Definition DataStreamHelpers.hpp:103
Definition PatternModel.hpp:36
Definition DocumentContext.hpp:18