fully implement and deploy explicit x-thread signal connection syntax (testing comes...
[ardour.git] / libs / ardour / ardour / midi_model.h
index 6ea4a4cd30904b53acbbb15b660078a89d02cc02..3cf64da6ea4cd871f6822d39d39fc8c6c38e6836 100644 (file)
@@ -70,7 +70,7 @@ public:
                void operator()();
                void undo();
 
-               int set_state (const XMLNode&);
+               int set_state (const XMLNode&, int version);
                XMLNode& get_state ();
 
                void add(const boost::shared_ptr< Evoral::Note<TimeType> > note);
@@ -114,7 +114,7 @@ public:
                void operator()();
                void undo();
 
-               int set_state (const XMLNode&);
+               int set_state (const XMLNode&, int version);
                XMLNode& get_state ();
 
                void change (const boost::shared_ptr<Evoral::Note<TimeType> > note,
@@ -128,13 +128,13 @@ public:
 
                struct NotePropertyChange {
                        DiffCommand::Property property;
-                       boost::shared_ptr<Evoral::Note<TimeType> > note;
+                       boost::shared_ptr< Evoral::Note<TimeType> > note;
                        union {
-                               uint8_t old_value;
+                               uint8_t  old_value;
                                TimeType old_time;
                        };
                        union {
-                               uint8_t new_value;
+                               uint8_t  new_value;
                                TimeType new_time;
                        };
                };
@@ -151,8 +151,6 @@ public:
        void                     apply_command(Session& session, Command* cmd);
        void                     apply_command_as_subcommand(Session& session, Command* cmd);
 
-
-
        bool write_to(boost::shared_ptr<MidiSource> source);
 
        // MidiModel doesn't use the normal AutomationList serialisation code
@@ -160,13 +158,29 @@ public:
        XMLNode& get_state();
        int set_state(const XMLNode&) { return 0; }
 
-       sigc::signal<void> ContentsChanged;
+       PBD::Signal0<void> ContentsChanged;
 
        const MidiSource* midi_source() const { return _midi_source; }
        void set_midi_source(MidiSource* source) { _midi_source = source; }
 
        boost::shared_ptr<Evoral::Note<TimeType> > find_note (boost::shared_ptr<Evoral::Note<TimeType> >);
 
+private:
+       struct WriteLockImpl : public AutomatableSequence<Evoral::MusicalTime>::WriteLockImpl {
+               WriteLockImpl(Glib::Mutex::Lock* source_lock, Glib::RWLock& s, Glib::Mutex& c)
+                       : AutomatableSequence<Evoral::MusicalTime>::WriteLockImpl(s, c)
+                       , source_lock(source_lock)
+               {}
+               ~WriteLockImpl() {
+                       delete source_lock;
+               }
+               Glib::Mutex::Lock* source_lock;
+       };
+
+public:
+       virtual WriteLock edit_lock();
+       virtual WriteLock write_lock();
+
 private:
        friend class DeltaCommand;