2011-10-19 11:33:18 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2011 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
2010-09-15 14:54:04 -04:00
|
|
|
#ifndef __gtk2_ardour_note_player_h__
|
|
|
|
#define __gtk2_ardour_note_player_h__
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <sigc++/trackable.h>
|
|
|
|
|
|
|
|
#include "evoral/Note.hpp"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
2011-10-19 11:33:18 -04:00
|
|
|
class MidiTrack;
|
2010-09-15 14:54:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
class NotePlayer : public sigc::trackable {
|
2011-10-19 11:33:18 -04:00
|
|
|
public:
|
2017-09-24 12:03:54 -04:00
|
|
|
typedef Evoral::Note<Temporal::Beats> NoteType;
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2011-10-19 11:33:18 -04:00
|
|
|
NotePlayer (boost::shared_ptr<ARDOUR::MidiTrack>);
|
2012-06-08 09:21:05 -04:00
|
|
|
~NotePlayer ();
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2011-10-19 11:33:18 -04:00
|
|
|
void add (boost::shared_ptr<NoteType>);
|
|
|
|
void play ();
|
2012-06-08 09:21:05 -04:00
|
|
|
void on ();
|
2011-10-19 11:33:18 -04:00
|
|
|
void off ();
|
2012-01-31 22:32:59 -05:00
|
|
|
void clear ();
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2011-10-19 11:33:18 -04:00
|
|
|
static bool _off (NotePlayer*);
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2011-10-19 11:33:18 -04:00
|
|
|
private:
|
|
|
|
typedef std::vector< boost::shared_ptr<NoteType> > Notes;
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2011-10-19 11:33:18 -04:00
|
|
|
boost::shared_ptr<ARDOUR::MidiTrack> track;
|
|
|
|
Notes notes;
|
2010-09-15 14:54:04 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_note_player_h__ */
|