From fa19e1a9d0b97233e130d301d906b3867a585950 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 8 Jun 2012 13:21:05 +0000 Subject: When sounding notes on selection / note movements, play the note for as long as the mouse button is held down (#4574). git-svn-id: svn://localhost/ardour2/branches/3.0@12606 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/note_player.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/note_player.cc') 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 */ -- cgit v1.2.3