mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-01 19:37:45 +01:00
[Summary] In ARDOUR_UI was implemented handler on session config changed
[Reviewed] GZharun
This commit is contained in:
parent
4a59a5806a
commit
7072e34776
4 changed files with 19 additions and 6 deletions
|
|
@ -3125,6 +3125,7 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
|
|||
session_loaded = true;
|
||||
|
||||
tracks_control_panel->refresh_session_settings_info();
|
||||
_session->config.ParameterChanged.connect_same_thread (connection_with_session_config, boost::bind (&ARDOUR_UI::on_parameter_changed, this, _1));
|
||||
|
||||
goto_editor_window ();
|
||||
|
||||
|
|
@ -3200,12 +3201,23 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
|
|||
set_session (new_session);
|
||||
|
||||
session_loaded = true;
|
||||
|
||||
|
||||
_session->config.ParameterChanged.connect_same_thread (connection_with_session_config, boost::bind (&ARDOUR_UI::on_parameter_changed, this, _1));
|
||||
|
||||
new_session->save_state(new_session->name());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::on_parameter_changed(std::string param)
|
||||
{
|
||||
if (param == "native-file-data-format" || param == "native-file-header-format")
|
||||
update_format();
|
||||
if ( param == "timecode-format")
|
||||
update_timecode_format();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::launch_chat ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -307,8 +307,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void set_sample_format(ARDOUR::SampleFormat sf) {_sample_format = sf;}
|
||||
void set_header_format(ARDOUR::HeaderFormat hf) {_header_format = hf;}
|
||||
void set_timecode_format(Timecode::TimecodeFormat tc) {_timecode_format = tc;}
|
||||
void update_format ();
|
||||
void update_timecode_format ();
|
||||
|
||||
protected:
|
||||
friend class PublicEditor;
|
||||
|
|
@ -559,6 +557,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void update_sample_rate (ARDOUR::framecnt_t);
|
||||
|
||||
Gtk::Label format_label;
|
||||
void update_format ();
|
||||
|
||||
void update_timecode_format ();
|
||||
|
||||
gint every_second ();
|
||||
gint every_point_one_seconds ();
|
||||
|
|
@ -783,6 +784,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
ARDOUR::HeaderFormat _header_format;
|
||||
Timecode::TimecodeFormat _timecode_format;
|
||||
|
||||
void on_parameter_changed(std::string);
|
||||
PBD::ScopedConnection connection_with_session_config;
|
||||
};
|
||||
|
||||
#endif /* __ardour_gui_h__ */
|
||||
|
|
|
|||
|
|
@ -279,6 +279,7 @@ ARDOUR_UI::unload_session (bool hide_stuff)
|
|||
second_connection.disconnect ();
|
||||
point_one_second_connection.disconnect ();
|
||||
point_zero_something_second_connection.disconnect();
|
||||
connection_with_session_config.disconnect();
|
||||
|
||||
if (editor_meter) {
|
||||
meter_box.remove(*editor_meter);
|
||||
|
|
|
|||
|
|
@ -1265,9 +1265,6 @@ void TracksControlPanel::update_session_config ()
|
|||
session->config.set_native_file_header_format( string_to_HeaderFormat(_file_type_combo.get_active_text() ) );
|
||||
session->config.set_native_file_data_format ( string_to_SampleFormat(_bit_depth_combo.get_active_text() ) );
|
||||
session->config.set_timecode_format( string_to_TimecodeFormat(_frame_rate_combo.get_active_text() ) );
|
||||
|
||||
ardour_ui->update_format();
|
||||
ardour_ui->update_timecode_format();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue