fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / ardour / midi_playlist_source.h
index 5e3bb0de6764bd280e517d758ec102f07ba5a3e5..12c184d7b50c3c921184cbc817cac5aa625b77d6 100644 (file)
@@ -32,7 +32,7 @@ namespace ARDOUR {
 
 class MidiPlaylist;
 
-class MidiPlaylistSource : public MidiSource, public PlaylistSource {
+class LIBARDOUR_API MidiPlaylistSource : public MidiSource, public PlaylistSource {
 public:
        virtual ~MidiPlaylistSource ();
 
@@ -45,10 +45,10 @@ public:
        XMLNode& get_state ();
        int set_state (const XMLNode&, int version);
 
-       void append_event_unlocked_beats(const Evoral::Event<Evoral::MusicalTime>& ev);
-       void append_event_unlocked_frames(const Evoral::Event<framepos_t>& ev, framepos_t source_start);
-       void load_model(bool lock=true, bool force_reload=false);
-       void destroy_model();
+       void append_event_beats(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event<Evoral::Beats>& ev);
+       void append_event_frames(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event<framepos_t>& ev, framepos_t source_start);
+       void load_model(const Glib::Threads::Mutex::Lock& lock, bool force_reload=false);
+       void destroy_model(const Glib::Threads::Mutex::Lock& lock);
 
 protected:
        friend class SourceFactory;
@@ -58,15 +58,18 @@ protected:
        MidiPlaylistSource (Session&, const XMLNode&);
 
 
-       void flush_midi();
+       void flush_midi(const Lock& lock);
 
-       framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
+       framecnt_t read_unlocked (const Lock&                    lock,
+                                 Evoral::EventSink<framepos_t>& dst,
                                  framepos_t                     position,
                                  framepos_t                     start,
                                  framecnt_t                     cnt,
-                                 MidiStateTracker*              tracker) const;
+                                 MidiStateTracker*              tracker,
+                                 MidiChannelFilter*             filter) const;
 
-       framecnt_t write_unlocked (MidiRingBuffer<framepos_t>& dst,
+       framecnt_t write_unlocked (const Lock&                 lock,
+                                  MidiRingBuffer<framepos_t>& dst,
                                   framepos_t                  position,
                                   framecnt_t                  cnt);