Statusbar: link session property dialog for format & timecode

This commit is contained in:
Robin Gareus 2020-03-30 01:09:00 +02:00
parent 65e34719bb
commit b49764edf5
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 44 additions and 5 deletions

View file

@ -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")); std::string label = string_compose (X_("<span weight=\"ultralight\">%1</span>: "), _("Rec"));
if (remain_sec > 86400) { if (remain_sec > 86400) {
disk_space_label.set_markup (_(">24h")); disk_space_label.set_markup (label + _(">24h"));
} else if (remain_sec > 32400 /* 9 hours */) { } else if (remain_sec > 32400 /* 9 hours */) {
snprintf (buf, sizeof (buf), "%.0f", remain_sec / 3600.f); snprintf (buf, sizeof (buf), "%.0f", remain_sec / 3600.f);
disk_space_label.set_markup (label + buf + S_("hours|h")); disk_space_label.set_markup (label + buf + S_("hours|h"));

View file

@ -860,6 +860,8 @@ private:
void on_theme_changed (); void on_theme_changed ();
bool path_button_press (GdkEventButton* ev); bool path_button_press (GdkEventButton* ev);
bool format_button_press (GdkEventButton* ev);
bool timecode_button_press (GdkEventButton* ev);
bool xrun_button_release (GdkEventButton* ev); bool xrun_button_release (GdkEventButton* ev);
std::string _announce_string; std::string _announce_string;

View file

@ -7,7 +7,7 @@
* Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net> * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
* Copyright (C) 2007-2015 Tim Mayberry <mojofunk@gmail.com> * Copyright (C) 2007-2015 Tim Mayberry <mojofunk@gmail.com>
* Copyright (C) 2007 Doug McLain <doug@nostar.net> * 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> * Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 (); 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;
}

View file

@ -6,7 +6,7 @@
* Copyright (C) 2006-2012 David Robillard <d@drobilla.net> * Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
* Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net> * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
* Copyright (C) 2008 Hans Baier <hansfbaier@googlemail.com> * 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) 2014-2019 Ben Loftis <ben@harrisonconsoles.com>
* Copyright (C) 2015 André Nusser <andre.nusser@googlemail.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_dsp = manage (new EventBox);
EventBox* ev_path = 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); Gtk::HBox* hbox = manage (new Gtk::HBox);
hbox->show (); hbox->show ();
@ -739,6 +741,13 @@ ARDOUR_UI::build_menu_bar ()
ev_dsp->add (dsp_load_label); ev_dsp->add (dsp_load_label);
ev_path->add (session_path_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__ #ifdef __APPLE__
use_menubar_as_top_menubar (); 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 (*ev_dsp, false, false, 6);
hbox->pack_end (disk_space_label, false, false, 6); hbox->pack_end (disk_space_label, false, false, 6);
hbox->pack_end (sample_rate_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 (*ev_timecode, false, false, 6);
hbox->pack_end (format_label, false, false, 6); hbox->pack_end (*ev_format, false, false, 6);
hbox->pack_end (peak_thread_work_label, false, false, 6); hbox->pack_end (peak_thread_work_label, false, false, 6);
hbox->pack_end (*ev_path, 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_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_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 void