diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-30 01:09:00 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-30 01:10:00 +0200 |
commit | b49764edf57e30179706aa36a0aa0e2a7dff48ca (patch) | |
tree | 0bba3b4fc9b338d46c587ca59d0965c14fc9a828 | |
parent | 65e34719bbaf6bb80a87ad9169beabf0cb6e999d (diff) |
Statusbar: link session property dialog for format & timecode
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 28 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 17 |
4 files changed, 44 insertions, 5 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index e8524c6a4d..287d42ea9b 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1365,7 +1365,7 @@ ARDOUR_UI::format_disk_space_label (float remain_sec) std::string label = string_compose (X_("<span weight=\"ultralight\">%1</span>: "), _("Rec")); if (remain_sec > 86400) { - disk_space_label.set_markup (_(">24h")); + disk_space_label.set_markup (label + _(">24h")); } else if (remain_sec > 32400 /* 9 hours */) { snprintf (buf, sizeof (buf), "%.0f", remain_sec / 3600.f); disk_space_label.set_markup (label + buf + S_("hours|h")); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 384bef688d..d6e0e2d4e4 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -860,6 +860,8 @@ private: void on_theme_changed (); bool path_button_press (GdkEventButton* ev); + bool format_button_press (GdkEventButton* ev); + bool timecode_button_press (GdkEventButton* ev); bool xrun_button_release (GdkEventButton* ev); std::string _announce_string; diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index c3e441db90..c602c16dd4 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -7,7 +7,7 @@ * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net> * Copyright (C) 2007-2015 Tim Mayberry <mojofunk@gmail.com> * Copyright (C) 2007 Doug McLain <doug@nostar.net> - * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org> + * Copyright (C) 2013-2020 Robin Gareus <robin@gareus.org> * Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com> * * This program is free software; you can redistribute it and/or modify @@ -992,3 +992,29 @@ ARDOUR_UI::toggle_mixer_space() mixer->restore_mixer_space (); } } + +bool +ARDOUR_UI::timecode_button_press (GdkEventButton* ev) +{ + if (ev->button != 1 || ev->type != GDK_2BUTTON_PRESS) { + return false; + } + if (_session) { + session_option_editor->show (); + session_option_editor->set_current_page (_("Timecode")); + } + return true; +} + +bool +ARDOUR_UI::format_button_press (GdkEventButton* ev) +{ + if (ev->button != 1 || ev->type != GDK_2BUTTON_PRESS) { + return false; + } + if (_session) { + session_option_editor->show (); + session_option_editor->set_current_page (_("Media")); + } + return true; +} diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 4455b6ccde..970b95cc4b 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -6,7 +6,7 @@ * Copyright (C) 2006-2012 David Robillard <d@drobilla.net> * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net> * Copyright (C) 2008 Hans Baier <hansfbaier@googlemail.com> - * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org> + * Copyright (C) 2013-2020 Robin Gareus <robin@gareus.org> * Copyright (C) 2014-2019 Ben Loftis <ben@harrisonconsoles.com> * Copyright (C) 2015 André Nusser <andre.nusser@googlemail.com> * @@ -719,6 +719,8 @@ ARDOUR_UI::build_menu_bar () EventBox* ev_dsp = manage (new EventBox); EventBox* ev_path = manage (new EventBox); + EventBox* ev_format = manage (new EventBox); + EventBox* ev_timecode = manage (new EventBox); Gtk::HBox* hbox = manage (new Gtk::HBox); hbox->show (); @@ -739,6 +741,13 @@ ARDOUR_UI::build_menu_bar () ev_dsp->add (dsp_load_label); ev_path->add (session_path_label); + ev_format->add (format_label); + ev_timecode->add (timecode_format_label); + + ev_dsp->show (); + ev_path->show (); + ev_format->show (); + ev_timecode->show (); #ifdef __APPLE__ use_menubar_as_top_menubar (); @@ -752,8 +761,8 @@ ARDOUR_UI::build_menu_bar () hbox->pack_end (*ev_dsp, false, false, 6); hbox->pack_end (disk_space_label, false, false, 6); hbox->pack_end (sample_rate_label, false, false, 6); - hbox->pack_end (timecode_format_label, false, false, 6); - hbox->pack_end (format_label, false, false, 6); + hbox->pack_end (*ev_timecode, false, false, 6); + hbox->pack_end (*ev_format, false, false, 6); hbox->pack_end (peak_thread_work_label, false, false, 6); hbox->pack_end (*ev_path, false, false, 6); @@ -778,6 +787,8 @@ ARDOUR_UI::build_menu_bar () ev_dsp->signal_button_release_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::xrun_button_release)); ev_path->signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::path_button_press)); + ev_format->signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::format_button_press)); + ev_timecode->signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::timecode_button_press)); } void |