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
This commit is contained in:
Carl Hetherington 2012-06-08 13:21:05 +00:00
parent 33ffe733f1
commit fa19e1a9d0
5 changed files with 78 additions and 16 deletions

View file

@ -31,6 +31,11 @@ NotePlayer::NotePlayer (boost::shared_ptr<MidiTrack> mt)
{
}
NotePlayer::~NotePlayer ()
{
clear ();
}
void
NotePlayer::add (boost::shared_ptr<NoteType> 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
*/