From 33d1d8a6c1b96b1d592f422b9f612702a2311ba5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 9 May 2015 14:48:36 -0400 Subject: [PATCH] change names for scene I/O port connection methods --- libs/ardour/session.cc | 56 ++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 39ddbce1ad..2647e5cd38 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2610,35 +2610,43 @@ Session::reconnect_existing_routes (bool withLock, bool reconnect_master, bool r void Session::reconnect_midi_scene_ports(bool inputs) { - if (inputs) { - scene_in()->disconnect_all (); + if (inputs ) { - std::vector midi_port_states; - EngineStateController::instance()->get_physical_midi_input_states (midi_port_states); - - std::vector::iterator state_iter = midi_port_states.begin(); - - for (; state_iter != midi_port_states.end(); ++state_iter) { - if (state_iter->active && state_iter->available && state_iter->connected) { - scene_in()->connect (state_iter->name); - } - } + boost::shared_ptr scene_in_ptr = scene_in(); + if (scene_in_ptr) { + scene_in_ptr->disconnect_all (); + + std::vector midi_port_states; + EngineStateController::instance()->get_physical_midi_input_states (midi_port_states); + + std::vector::iterator state_iter = midi_port_states.begin(); + + for (; state_iter != midi_port_states.end(); ++state_iter) { + if (state_iter->active && state_iter->available && state_iter->scene_connected) { + scene_in_ptr->connect (state_iter->name); + } + } + } - } else { - scene_out()->disconnect_all (); - - std::vector midi_port_states; - EngineStateController::instance()->get_physical_midi_output_states (midi_port_states); + } else { - std::vector::iterator state_iter = midi_port_states.begin(); + boost::shared_ptr scene_out_ptr = scene_out(); - for (; state_iter != midi_port_states.end(); ++state_iter) { - if (state_iter->active && state_iter->available && state_iter->connected) { - scene_out()->connect (state_iter->name); - } - } + if (scene_out_ptr ) { + scene_out_ptr->disconnect_all (); - } + std::vector midi_port_states; + EngineStateController::instance()->get_physical_midi_output_states (midi_port_states); + + std::vector::iterator state_iter = midi_port_states.begin(); + + for (; state_iter != midi_port_states.end(); ++state_iter) { + if (state_iter->active && state_iter->available && state_iter->scene_connected) { + scene_out_ptr->connect (state_iter->name); + } + } + } + } } #endif