X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fnote_player.cc;h=cd5c058209b76181fe063af8fff5e2ec158f02cc;hb=cc83e1a9bfd7339c4ebfcde4a57d511eec51923e;hp=b9f480a6be41b10c3a7a912b6388322f7ba32e7a;hpb=6fa6514cfdb0ce38d93b51197f599dfd091bad1d;p=ardour.git diff --git a/gtk2_ardour/note_player.cc b/gtk2_ardour/note_player.cc index b9f480a6be..cd5c058209 100644 --- a/gtk2_ardour/note_player.cc +++ b/gtk2_ardour/note_player.cc @@ -31,6 +31,11 @@ NotePlayer::NotePlayer (boost::shared_ptr mt) { } +NotePlayer::~NotePlayer () +{ + clear (); +} + void NotePlayer::add (boost::shared_ptr note) { @@ -45,11 +50,17 @@ NotePlayer::clear () } void -NotePlayer::play () +NotePlayer::on () { for (Notes::iterator n = notes.begin(); n != notes.end(); ++n) { track->write_immediate_event ((*n)->on_event().size(), (*n)->on_event().buffer()); } +} + +void +NotePlayer::play () +{ + on (); /* note: if there is more than 1 note, we will silence them all at the same time */