[Summary] Used more appropriate signal to identify port changes

[Details] Required for midi channels processing

[git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 464442]
This commit is contained in:
Grygorii Zharun 2014-05-29 04:22:08 -05:00 committed by Paul Davis
parent 103ba88073
commit eea036a8da
4 changed files with 24 additions and 5 deletions

View file

@ -85,6 +85,7 @@ TracksControlPanel::init ()
EngineStateController::instance ()->EngineHalted.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&TracksControlPanel::engine_stopped, this), gui_context());
/* Subscribe for udpates from EngineStateController */
EngineStateController::instance()->PortRegistrationChanged.connect (update_connections, MISSING_INVALIDATOR, boost::bind (&TracksControlPanel::on_port_registration_update, this), gui_context());
EngineStateController::instance()->BufferSizeChanged.connect (update_connections, MISSING_INVALIDATOR, boost::bind (&TracksControlPanel::on_buffer_size_update, this), gui_context());
EngineStateController::instance()->DeviceListChanged.connect (update_connections, MISSING_INVALIDATOR, boost::bind (&TracksControlPanel::on_device_list_update, this, _1), gui_context());
EngineStateController::instance()->InputConfigChanged.connect (update_connections, MISSING_INVALIDATOR, boost::bind (&TracksControlPanel::on_input_configuration_changed, this), gui_context());
@ -568,9 +569,6 @@ TracksControlPanel::sample_rate_changed()
void
TracksControlPanel::engine_running ()
{
populate_input_channels();
populate_output_channels();
_buffer_size_combo.set_active_text (bufsize_as_string (EngineStateController::instance()->get_current_buffer_size() ) );
_sample_rate_combo.set_active_text (rate_as_string (EngineStateController::instance()->get_current_sample_rate() ) );
@ -744,6 +742,13 @@ void TracksControlPanel::on_midi_playback_active_changed(DeviceConnectionControl
}
void TracksControlPanel::on_port_registration_update()
{
populate_input_channels();
populate_output_channels();
}
void
TracksControlPanel::on_buffer_size_update ()
{

View file

@ -107,6 +107,7 @@
void populate_default_session_path();
// Engine State update callback handlers
void on_port_registration_update();
void on_buffer_size_update ();
void on_device_list_update (bool current_device_disconnected);
void on_parameter_changed (const std::string& parameter_name);

View file

@ -127,6 +127,9 @@ public:
PBD::Signal0<void> InputConfigChanged;
PBD::Signal0<void> OutputConfigChanged;
/* this signal is emitted if new ports are registered or unregistered */
PBD::Signal0<void> PortRegistrationChanged;
private:
EngineStateController(); // singleton
@ -210,6 +213,7 @@ private:
void _on_buffer_size_change(ARDOUR::pframes_t);
void _on_device_list_change();
void _on_parameter_changed (const std::string&);
void _on_ports_registration_update ();
////////////////////////////////////////
////////////////////////////////////////

View file

@ -57,6 +57,7 @@ EngineStateController::EngineStateController()
AudioEngine::instance ()->Halted.connect_same_thread (stopped_connection, boost::bind (&EngineStateController::_on_engine_stopped, this) );
/* Subscribe for udpates from AudioEngine */
AudioEngine::instance ()->PortRegisteredOrUnregistered.connect_same_thread (update_connections, boost::bind (&EngineStateController::_on_ports_registration_update, this) );
AudioEngine::instance()->SampleRateChanged.connect_same_thread (update_connections, boost::bind (&EngineStateController::_on_sample_rate_change, this, _1) );
AudioEngine::instance()->BufferSizeChanged.connect_same_thread (update_connections, boost::bind (&EngineStateController::_on_buffer_size_change, this, _1) );
AudioEngine::instance()->DeviceListChanged.connect_same_thread (update_connections, boost::bind (&EngineStateController::_on_device_list_change, this) );
@ -893,10 +894,9 @@ EngineStateController::_refresh_stereo_out_channel_states()
void
EngineStateController::_on_engine_running ()
{
_update_device_channels_state();
_serialize_and_save_current_state();
EngineRunning();
EngineRunning(); // emit a signal
}
@ -925,6 +925,15 @@ EngineStateController::_on_parameter_changed (const std::string& parameter_name)
}
void
EngineStateController::_on_ports_registration_update ()
{
_update_device_channels_state();
PortRegistrationChanged(); // emit a signal
}
bool
EngineStateController::push_current_state_to_backend(bool start)
{