21 #include "midi++/channel.h"
22 #include "midi++/parser.h"
23 #include "midi++/port.h"
40 , have_seen_bank_changes (false)
41 , last_program_message_time (-1)
42 , last_delivered_program (-1)
43 , last_delivered_bank (-1)
74 Glib::Threads::RWLock::WriterLock lm (
scene_lock);
78 for (Locations::LocationList::const_iterator l = locations.begin(); l != locations.end(); ++l) {
80 if ((sc = (*l)->scene_change()) != 0) {
86 if (msc->
bank() >= 0) {
90 scenes.insert (std::make_pair ((*l)->start(), msc));
136 aport->
write (buf, cnt, 0);
139 aport->
write (buf, cnt, 0);
146 aport->
write (buf, cnt, 0);
158 Glib::Threads::RWLock::ReaderLock lm (
scene_lock, Glib::Threads::TRY_LOCK);
166 Scenes::const_iterator i =
scenes.lower_bound (start);
169 while (i !=
scenes.end()) {
171 if (i->first >= end) {
175 rt_deliver (mbuf, i->first - start, i->second);
187 Glib::Threads::RWLock::ReaderLock lm (
scene_lock);
193 Scenes::const_iterator i =
scenes.lower_bound (pos);
197 if (i->first != pos) {
201 if (i !=
scenes.begin()) {
234 for (
int channel = 0; channel < 16; ++channel) {
283 bool new_mark =
false;
288 loc = locations->mark_at (time, slop);
293 std::string new_name;
295 if (!locations->next_available_name (new_name,
_(
"Scene "))) {
296 std::cerr <<
"No new marker name available\n";
318 for (Locations::LocationList::const_iterator l = copy.begin(); l != copy.end(); ++l) {
321 if (sc && (*sc.
get()) == *msc) {
334 locations->add (loc);
347 for (Locations::LocationList::const_iterator l = locations.begin(); l != locations.end(); ++l) {
349 if ((sc = (*l)->scene_change()) != 0) {
353 if (msc->
bank() == bank && msc->
program() == program && (*l)->start() < where) {
354 where = (*l)->start();
Glib::Threads::RWLock scene_lock
bool transport_rolling() const
MIDISceneChanger(Session &)
ARDOUR::Session & _session
static PBD::Signal0< void > scene_changed
void bank_change_input(MIDI::Parser &, unsigned short, int channel)
std::list< Location * > LocationList
PBD::Signal1< void, Location * > added
bool get_record_enabled() const
void set_input_port(MIDI::Port *)
PBD::Signal0< void > MIDIInputActivity
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
void rt_deliver(MidiBuffer &, framepos_t, boost::shared_ptr< MIDISceneChange >)
PBD::ScopedConnectionList incoming_connections
PBD::Signal0< void > MIDIOutputActivity
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
void request_locate(framepos_t frame, bool with_roll=false)
framecnt_t frame_rate() const
void gather(const Locations::LocationList &)
size_t get_bank_lsb_message(uint8_t *buf, size_t size) const
LIBARDOUR_API RCConfiguration * Config
size_t get_bank_msb_message(uint8_t *buf, size_t size) const
void non_rt_deliver(boost::shared_ptr< MIDISceneChange >)
PBD::Signal1< void, Location * > removed
const LocationList & list()
void program_change_input(MIDI::Parser &, MIDI::byte, int channel)
void set_output_port(boost::shared_ptr< MidiPort >)
bool push_back(const Evoral::MIDIEvent< TimeType > &event)
bool have_seen_bank_changes
void run(framepos_t start, framepos_t end)
static const framepos_t max_framepos
int write(const MIDI::byte *msg, size_t msglen, MIDI::timestamp_t timestamp)
boost::shared_ptr< MidiPort > output_port
void jump_to(int bank, int program)
void apply(T &obj, void(T::*method)(const LocationList &)) const
framepos_t last_program_message_time
int last_delivered_program
PBD::Signal0< void > changed
size_t get_program_message(uint8_t *buf, size_t size) const