X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fmidi_playlist.cc;h=89b59147533c677a6c064532d0e284cdaea6640c;hb=2b9dc7b380bb4e40171067f42b4010970869a57d;hp=df8e3e7000fd37d18dd9fc997b4ebce180f2d704;hpb=f8fe64a91e7ae7f6ac761e8ae16a485ed70fb994;p=ardour.git diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc index df8e3e7000..89b5914753 100644 --- a/libs/ardour/midi_playlist.cc +++ b/libs/ardour/midi_playlist.cc @@ -23,10 +23,10 @@ #include #include -#include #include "evoral/EventList.hpp" +#include "ardour/debug.h" #include "ardour/types.h" #include "ardour/configuration.h" #include "ardour/midi_playlist.h" @@ -39,12 +39,12 @@ #include "i18n.h" using namespace ARDOUR; -using namespace sigc; +using namespace PBD; using namespace std; MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden) - : Playlist (session, node, DataType::MIDI, hidden) - , _note_mode(Sustained) + : Playlist (session, node, DataType::MIDI, hidden) + , _note_mode(Sustained) { const XMLProperty* prop = node.property("type"); assert(prop && DataType(prop->value()) == DataType::MIDI); @@ -55,75 +55,28 @@ MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden) } MidiPlaylist::MidiPlaylist (Session& session, string name, bool hidden) - : Playlist (session, name, DataType::MIDI, hidden) + : Playlist (session, name, DataType::MIDI, hidden) + , _note_mode(Sustained) { } MidiPlaylist::MidiPlaylist (boost::shared_ptr other, string name, bool hidden) - : Playlist (other, name, hidden) + : Playlist (other, name, hidden) + , _note_mode(other->_note_mode) { - throw; // nope - - /* - list::const_iterator in_o = other.regions.begin(); - list::iterator in_n = regions.begin(); - - while (in_o != other.regions.end()) { - MidiRegion *ar = dynamic_cast( (*in_o) ); - - for (list::const_iterator xfades = other._crossfades.begin(); xfades != other._crossfades.end(); ++xfades) { - if ( &(*xfades)->in() == ar) { - // We found one! Now copy it! - - list::const_iterator out_o = other.regions.begin(); - list::const_iterator out_n = regions.begin(); - - while (out_o != other.regions.end()) { - - MidiRegion *ar2 = dynamic_cast( (*out_o) ); - - if ( &(*xfades)->out() == ar2) { - MidiRegion *in = dynamic_cast( (*in_n) ); - MidiRegion *out = dynamic_cast( (*out_n) ); - Crossfade *new_fade = new Crossfade( *(*xfades), in, out); - add_crossfade(*new_fade); - break; - } - - out_o++; - out_n++; - } - // cerr << "HUH!? second region in the crossfade not found!" << endl; - } - } - - in_o++; - in_n++; - } -*/ } MidiPlaylist::MidiPlaylist (boost::shared_ptr 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 (); } -struct RegionSortByLayer { - bool operator() (boost::shared_ptr a, boost::shared_ptr b) { - return a->layer() < b->layer(); - } -}; - template struct EventsSortByTime { bool operator() (Evoral::Event