Display audio file format in the menu bar (#4016).
git-svn-id: svn://localhost/ardour2/branches/3.0@9788 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
75eeb68e37
commit
8f3f86b8a8
|
@ -984,6 +984,57 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
|
|||
sample_rate_label.set_text (buf);
|
||||
}
|
||||
|
||||
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 ()
|
||||
{
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -402,6 +402,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 ()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue