permit different sizes for audio playback & capture buffers
[ardour.git] / libs / ardour / midi_playlist.cc
index a1fb01a7bb859702f2a6488c645653de77c906d1..89b59147533c677a6c064532d0e284cdaea6640c 100644 (file)
@@ -23,7 +23,6 @@
 #include <iostream>
 
 #include <stdlib.h>
-#include <sigc++/bind.h>
 
 #include "evoral/EventList.hpp"
 
@@ -40,7 +39,7 @@
 #include "i18n.h"
 
 using namespace ARDOUR;
-using namespace sigc;
+using namespace PBD;
 using namespace std;
 
 MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden)
@@ -57,27 +56,25 @@ MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden)
 
 MidiPlaylist::MidiPlaylist (Session& session, string name, bool hidden)
        : Playlist (session, name, DataType::MIDI, hidden)
+       , _note_mode(Sustained)
 {
 }
 
 MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, string name, bool hidden)
        : Playlist (other, name, hidden)
+       , _note_mode(other->_note_mode)
 {
 }
 
 MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t dur, string name, bool hidden)
-               : Playlist (other, start, dur, name, hidden)
+       : Playlist (other, start, dur, name, hidden)
+       , _note_mode(other->_note_mode)
 {
        /* this constructor does NOT notify others (session) */
 }
 
 MidiPlaylist::~MidiPlaylist ()
 {
-       GoingAway (); /* EMIT SIGNAL */
-
-       /* drop connections to signals */
-
-       notify_callbacks ();
 }
 
 template<typename Time>
@@ -166,11 +163,11 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
                                DEBUG_TRACE (DEBUG::MidiPlaylistIO, "\tBEFORE: new tracker\n");
                        } else {
                                tracker = t->second;
-                               DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\tBEFORE: tracker says there are %1 on notes", tracker->on()));
+                               DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\tBEFORE: tracker says there are %1 on notes\n", tracker->on()));
                        }
 
                        mr->read_at (dst, start, dur, chan_n, _note_mode, tracker);
-                       DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\tAFTER: tracker says there are %1 on notes", tracker->on()));
+                       DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\tAFTER: tracker says there are %1 on notes\n", tracker->on()));
 
                        if (new_tracker) {
                                pair<Region*,MidiStateTracker*> newpair;
@@ -422,7 +419,7 @@ MidiPlaylist::contained_automation()
 
 
 bool
-MidiPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> region)
+MidiPlaylist::region_changed (const PBD::PropertyChange& what_changed, boost::shared_ptr<Region> region)
 {
        if (in_flush || in_set_state) {
                return false;
@@ -430,19 +427,14 @@ MidiPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> reg
 
        // Feeling rather uninterested today, but thanks for the heads up anyway!
 
-       Change our_interests = Change (/*MidiRegion::FadeInChanged|
-                                      MidiRegion::FadeOutChanged|
-                                      MidiRegion::FadeInActiveChanged|
-                                      MidiRegion::FadeOutActiveChanged|
-                                      MidiRegion::EnvelopeActiveChanged|
-                                      MidiRegion::ScaleAmplitudeChanged|
-                                      MidiRegion::EnvelopeChanged*/);
+       PBD::PropertyChange our_interests;
+
        bool parent_wants_notify;
 
        parent_wants_notify = Playlist::region_changed (what_changed, region);
 
-       if ((parent_wants_notify || (what_changed & our_interests))) {
-               notify_modified ();
+       if (parent_wants_notify || what_changed.contains (our_interests)) {
+               notify_contents_changed ();
        }
 
        return true;