diff options
author | Carl Hetherington <carl@carlh.net> | 2011-07-03 00:45:15 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-07-03 00:45:15 +0000 |
commit | 8f3f86b8a815da24179b893cfc6825e034c1b81b (patch) | |
tree | 42958db84339eebb381dde6ce5e9d99ca9df0de5 | |
parent | 75eeb68e37cc32cd308762c0034557610d89b251 (diff) |
Display audio file format in the menu bar (#4016).
git-svn-id: svn://localhost/ardour2/branches/3.0@9788 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 51 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_options.cc | 8 |
5 files changed, 72 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 71768c699c..14c81c30b2 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -985,6 +985,57 @@ ARDOUR_UI::update_sample_rate (framecnt_t) } void +ARDOUR_UI::update_format () +{ + if (!_session) { + format_label.set_text (""); + return; + } + + stringstream s; + + switch (_session->config.get_native_file_header_format ()) { + case BWF: + s << "BWF"; + break; + case WAVE: + s << "WAV"; + break; + case WAVE64: + s << "WAV64"; + break; + case CAF: + s << "CAF"; + break; + case AIFF: + s << "AIFF"; + break; + case iXML: + s << "iXML"; + break; + case RF64: + s << "RF64"; + break; + } + + s << " "; + + switch (_session->config.get_native_file_data_format ()) { + case FormatFloat: + s << "32-float"; + break; + case FormatInt24: + s << "24-int"; + break; + case FormatInt16: + s << "16-int"; + break; + } + + format_label.set_text (s.str ()); +} + +void ARDOUR_UI::update_cpu_load () { char buf[32]; diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index fb44b853dd..95eee1b9f9 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -520,6 +520,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr Gtk::EventBox sample_rate_box; void update_sample_rate (ARDOUR::framecnt_t); + Gtk::Label format_label; + Gtk::EventBox format_box; + void update_format (); + gint every_second (); gint every_point_one_seconds (); gint every_point_zero_one_seconds (); @@ -673,6 +677,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void toggle_use_osc (); void parameter_changed (std::string); + void session_parameter_changed (std::string); bool first_idle (); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index c5853c1fc3..c46f86a67a 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -154,6 +154,7 @@ ARDOUR_UI::set_session (Session *s) _session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context()); _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context()); _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context()); + _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ()); #ifdef HAVE_JACK_SESSION engine->JackSessionEvent.connect (*_session, MISSING_INVALIDATOR, ui_bind (&Session::jack_session_event, _session, _1), gui_context()); @@ -181,6 +182,8 @@ ARDOUR_UI::set_session (Session *s) second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_second), 1000); point_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_one_seconds), 100); point_zero_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_one_seconds), 40); + + update_format (); } int diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 8dfbfef750..5705bad332 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -538,6 +538,10 @@ ARDOUR_UI::build_menu_bar () sample_rate_box.set_name ("SampleRate"); sample_rate_label.set_name ("SampleRate"); + format_box.add (format_label); + format_box.set_name ("Format"); + format_label.set_name ("Format"); + #ifndef TOP_MENUBAR menu_hbox.pack_start (*menu_bar, false, false); #else @@ -555,6 +559,7 @@ ARDOUR_UI::build_menu_bar () menu_hbox.pack_end (cpu_load_box, false, false, 4); menu_hbox.pack_end (buffer_load_box, false, false, 4); menu_hbox.pack_end (sample_rate_box, false, false, 4); + menu_hbox.pack_end (format_box, false, false, 4); menu_bar_base.set_name ("MainMenuBar"); menu_bar_base.add (menu_hbox); diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index bde57f4385..6bb38cd09c 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -403,6 +403,14 @@ ARDOUR_UI::parameter_changed (std::string p) } void +ARDOUR_UI::session_parameter_changed (std::string p) +{ + if (p == "native-file-data-format" || p == "native-file-header-format") { + update_format (); + } +} + +void ARDOUR_UI::reset_main_clocks () { ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks) |