+ /* Currently this class only supports changes of sys-ex time, but could be expanded */
+ class LIBARDOUR_API SysExDiffCommand : public DiffCommand {
+ public:
+ SysExDiffCommand (boost::shared_ptr<MidiModel> m, const XMLNode& node);
+
+ enum Property {
+ Time,
+ };
+
+ int set_state (const XMLNode&, int version);
+ XMLNode & get_state ();
+
+ void remove (SysExPtr sysex);
+ void operator() ();
+ void undo ();
+
+ void change (boost::shared_ptr<Evoral::Event<TimeType> >, TimeType);
+
+ private:
+ struct Change {
+ Change () : sysex_id (0) {}
+ boost::shared_ptr<Evoral::Event<TimeType> > sysex;
+ gint sysex_id;
+ SysExDiffCommand::Property property;
+ TimeType old_time;
+ TimeType new_time;
+ };
+
+ typedef std::list<Change> ChangeList;
+ ChangeList _changes;
+
+ std::list<SysExPtr> _removed;
+
+ XMLNode & marshal_change (const Change &);
+ Change unmarshal_change (XMLNode *);
+ };
+
+ class LIBARDOUR_API PatchChangeDiffCommand : public DiffCommand {
+ public:
+ PatchChangeDiffCommand (boost::shared_ptr<MidiModel>, const std::string &);
+ PatchChangeDiffCommand (boost::shared_ptr<MidiModel>, const XMLNode &);
+
+ int set_state (const XMLNode &, int version);
+ XMLNode & get_state ();
+
+ void operator() ();
+ void undo ();
+
+ void add (PatchChangePtr);
+ void remove (PatchChangePtr);
+ void change_time (PatchChangePtr, TimeType);
+ void change_channel (PatchChangePtr, uint8_t);
+ void change_program (PatchChangePtr, uint8_t);
+ void change_bank (PatchChangePtr, int);
+
+ enum Property {
+ Time,
+ Channel,
+ Program,
+ Bank
+ };
+
+ private:
+ struct Change {
+ PatchChangePtr patch;
+ Property property;
+ gint patch_id;
+ TimeType old_time;
+ union {
+ uint8_t old_channel;
+ int old_bank;
+ uint8_t old_program;
+ };
+ TimeType new_time;
+ union {
+ uint8_t new_channel;
+ uint8_t new_program;
+ int new_bank;
+ };
+
+ Change() : patch_id (-1) {}
+ };