2011-10-19 11:33:18 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2010-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2011-2015 David Robillard <d@drobilla.net>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2011-10-19 11:33:18 -04:00
|
|
|
|
2010-09-15 14:54:04 -04:00
|
|
|
#ifndef __gtk2_ardour_note_player_h__
|
|
|
|
#define __gtk2_ardour_note_player_h__
|
|
|
|
|
2023-02-16 12:59:41 -05:00
|
|
|
#include <memory>
|
2010-09-15 14:54:04 -04:00
|
|
|
#include <vector>
|
2023-02-16 12:59:41 -05:00
|
|
|
|
2010-09-15 14:54:04 -04:00
|
|
|
#include <sigc++/trackable.h>
|
|
|
|
|
2019-10-25 15:13:51 -04:00
|
|
|
#include "evoral/Note.h"
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2024-05-20 12:37:27 -04:00
|
|
|
namespace Temporal {
|
|
|
|
class Beats;
|
|
|
|
}
|
|
|
|
|
2010-09-15 14:54:04 -04:00
|
|
|
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
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
NotePlayer (std::shared_ptr<ARDOUR::MidiTrack>);
|
2012-06-08 09:21:05 -04:00
|
|
|
~NotePlayer ();
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
void add (std::shared_ptr<NoteType>);
|
2011-10-19 11:33:18 -04:00
|
|
|
void play ();
|
2024-05-20 12:37:27 -04:00
|
|
|
|
|
|
|
private:
|
2012-06-08 09:21:05 -04:00
|
|
|
void on ();
|
2011-10-19 11:33:18 -04:00
|
|
|
void off ();
|
|
|
|
static bool _off (NotePlayer*);
|
2023-02-16 18:33:28 -05:00
|
|
|
typedef std::vector< std::shared_ptr<NoteType> > Notes;
|
2010-09-15 14:54:04 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::MidiTrack> track;
|
2011-10-19 11:33:18 -04:00
|
|
|
Notes notes;
|
2010-09-15 14:54:04 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_note_player_h__ */
|