// send_full_time_code (0);
_engine.transport_locate (0);
- AudioEngine::instance()->mmc().send (MIDI::MachineControlCommand (MIDI::MachineControl::cmdMmcReset));
- AudioEngine::instance()->mmc().send (MIDI::MachineControlCommand (Timecode::Time ()));
+ _mmc->send (MIDI::MachineControlCommand (MIDI::MachineControl::cmdMmcReset));
+ _mmc->send (MIDI::MachineControlCommand (Timecode::Time ()));
MIDI::Name::MidiPatchManager::instance().set_session (this);
/* various options */
+ list<XMLNode*> midi_port_nodes = _midi_ports->get_midi_port_states();
+ if (!midi_port_nodes.empty()) {
+ XMLNode* midi_port_stuff = new XMLNode ("MIDIPorts");
+ for (list<XMLNode*>::const_iterator n = midi_port_nodes.begin(); n != midi_port_nodes.end(); ++n) {
+ midi_port_stuff->add_child_nocopy (**n);
+ }
+ node->add_child_nocopy (*midi_port_stuff);
+ }
+
node->add_child_nocopy (config.get_variables ());
node->add_child_nocopy (ARDOUR::SessionMetadata::Metadata()->get_state());
Evoral::init_event_id_counter (atoi (prop->value()));
}
+
+ if ((child = find_named_node (node, "MIDIPorts")) != 0) {
+ _midi_ports->set_midi_port_states (child->children());
+ }
+
IO::disable_connecting ();
Stateful::save_extra_xml (node);
} else if (p == "mmc-device-id" || p == "mmc-receive-id" || p == "mmc-receive-device-id") {
- AudioEngine::instance()->mmc().set_receive_device_id (Config->get_mmc_receive_device_id());
+ _mmc->set_receive_device_id (Config->get_mmc_receive_device_id());
} else if (p == "mmc-send-id" || p == "mmc-send-device-id") {
- AudioEngine::instance()->mmc().set_send_device_id (Config->get_mmc_send_device_id());
+ _mmc->set_send_device_id (Config->get_mmc_send_device_id());
} else if (p == "midi-control") {
} else if (p == "send-mmc") {
- AudioEngine::instance()->mmc().enable_send (Config->get_send_mmc ());
+ _mmc->enable_send (Config->get_send_mmc ());
} else if (p == "midi-feedback") {
} else if (p == "initial-program-change") {
- if (AudioEngine::instance()->mmc().output_port() && Config->get_initial_program_change() >= 0) {
+ if (_mmc->output_port() && Config->get_initial_program_change() >= 0) {
MIDI::byte buf[2];
buf[0] = MIDI::program; // channel zero by default
buf[1] = (Config->get_initial_program_change() & 0x7f);
- AudioEngine::instance()->mmc().output_port()->midimsg (buf, sizeof (buf), 0);
+ _mmc->output_port()->midimsg (buf, sizeof (buf), 0);
}
} else if (p == "solo-mute-override") {
// catch_up_on_solo_mute_override ();
void
Session::setup_midi_machine_control ()
{
- MIDI::MachineControl& mmc (AudioEngine::instance()->mmc ());
-
- mmc.Play.connect_same_thread (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
- mmc.DeferredPlay.connect_same_thread (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
- mmc.Stop.connect_same_thread (*this, boost::bind (&Session::mmc_stop, this, _1));
- mmc.FastForward.connect_same_thread (*this, boost::bind (&Session::mmc_fast_forward, this, _1));
- mmc.Rewind.connect_same_thread (*this, boost::bind (&Session::mmc_rewind, this, _1));
- mmc.Pause.connect_same_thread (*this, boost::bind (&Session::mmc_pause, this, _1));
- mmc.RecordPause.connect_same_thread (*this, boost::bind (&Session::mmc_record_pause, this, _1));
- mmc.RecordStrobe.connect_same_thread (*this, boost::bind (&Session::mmc_record_strobe, this, _1));
- mmc.RecordExit.connect_same_thread (*this, boost::bind (&Session::mmc_record_exit, this, _1));
- mmc.Locate.connect_same_thread (*this, boost::bind (&Session::mmc_locate, this, _1, _2));
- mmc.Step.connect_same_thread (*this, boost::bind (&Session::mmc_step, this, _1, _2));
- mmc.Shuttle.connect_same_thread (*this, boost::bind (&Session::mmc_shuttle, this, _1, _2, _3));
- mmc.TrackRecordStatusChange.connect_same_thread (*this, boost::bind (&Session::mmc_record_enable, this, _1, _2, _3));
+ _mmc->Play.connect_same_thread (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
+ _mmc->DeferredPlay.connect_same_thread (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
+ _mmc->Stop.connect_same_thread (*this, boost::bind (&Session::mmc_stop, this, _1));
+ _mmc->FastForward.connect_same_thread (*this, boost::bind (&Session::mmc_fast_forward, this, _1));
+ _mmc->Rewind.connect_same_thread (*this, boost::bind (&Session::mmc_rewind, this, _1));
+ _mmc->Pause.connect_same_thread (*this, boost::bind (&Session::mmc_pause, this, _1));
+ _mmc->RecordPause.connect_same_thread (*this, boost::bind (&Session::mmc_record_pause, this, _1));
+ _mmc->RecordStrobe.connect_same_thread (*this, boost::bind (&Session::mmc_record_strobe, this, _1));
+ _mmc->RecordExit.connect_same_thread (*this, boost::bind (&Session::mmc_record_exit, this, _1));
+ _mmc->Locate.connect_same_thread (*this, boost::bind (&Session::mmc_locate, this, _1, _2));
+ _mmc->Step.connect_same_thread (*this, boost::bind (&Session::mmc_step, this, _1, _2));
+ _mmc->Shuttle.connect_same_thread (*this, boost::bind (&Session::mmc_shuttle, this, _1, _2, _3));
+ _mmc->TrackRecordStatusChange.connect_same_thread (*this, boost::bind (&Session::mmc_record_enable, this, _1, _2, _3));
/* also handle MIDI SPP because its so common */
- mmc.SPPStart.connect_same_thread (*this, boost::bind (&Session::spp_start, this));
- mmc.SPPContinue.connect_same_thread (*this, boost::bind (&Session::spp_continue, this));
- mmc.SPPStop.connect_same_thread (*this, boost::bind (&Session::spp_stop, this));
+ _mmc->SPPStart.connect_same_thread (*this, boost::bind (&Session::spp_start, this));
+ _mmc->SPPContinue.connect_same_thread (*this, boost::bind (&Session::spp_continue, this));
+ _mmc->SPPStop.connect_same_thread (*this, boost::bind (&Session::spp_stop, this));
}
boost::shared_ptr<Controllable>