13
0

Transfer Transport Clocks to Transport Bar

This commit is contained in:
Robin Gareus 2024-11-08 02:09:40 +01:00
parent 1cc8b8ae5b
commit c808deae46
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 49 additions and 53 deletions

View File

@ -117,6 +117,8 @@ ApplicationBar::ApplicationBar ()
, _latency_disable_button (ArdourButton::led_default_elements) , _latency_disable_button (ArdourButton::led_default_elements)
, _auto_return_button (ArdourButton::led_default_elements) , _auto_return_button (ArdourButton::led_default_elements)
, _follow_edits_button (ArdourButton::led_default_elements) , _follow_edits_button (ArdourButton::led_default_elements)
, _primary_clock (X_("primary"), X_("transport"), MainClock::PrimaryClock)
, _secondary_clock (X_("secondary"), X_("secondary"), MainClock::SecondaryClock)
, _secondary_clock_spacer (0) , _secondary_clock_spacer (0)
{ {
_record_mode_strings = I18N (_record_mode_strings_); _record_mode_strings = I18N (_record_mode_strings_);
@ -227,18 +229,18 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); _table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col; ++col;
_table.attach (*(ARDOUR_UI::instance()->primary_clock), col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0); _table.attach (_primary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
_table.attach (*(ARDOUR_UI::instance()->primary_clock)->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0); _table.attach (*(_primary_clock.left_btn()), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
_table.attach (*(ARDOUR_UI::instance()->primary_clock)->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0); _table.attach (*(_primary_clock.right_btn()), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
col += 2; col += 2;
_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); _table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col; ++col;
if (!ARDOUR::Profile->get_small_screen()) { if (!ARDOUR::Profile->get_small_screen()) {
_table.attach (*(ARDOUR_UI::instance()->secondary_clock), col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0); _table.attach (_secondary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
_table.attach (*(ARDOUR_UI::instance()->secondary_clock)->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0); _table.attach (*(_secondary_clock.left_btn()), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
_table.attach (*(ARDOUR_UI::instance()->secondary_clock)->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0); _table.attach (*(_secondary_clock.right_btn()), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
(ARDOUR_UI::instance()->secondary_clock)->set_no_show_all (true); (ARDOUR_UI::instance()->secondary_clock)->set_no_show_all (true);
(ARDOUR_UI::instance()->secondary_clock)->left_btn()->set_no_show_all (true); (ARDOUR_UI::instance()->secondary_clock)->left_btn()->set_no_show_all (true);
(ARDOUR_UI::instance()->secondary_clock)->right_btn()->set_no_show_all (true); (ARDOUR_UI::instance()->secondary_clock)->right_btn()->set_no_show_all (true);
@ -267,10 +269,24 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
button_height_size_group->add_widget (_follow_edits_button); button_height_size_group->add_widget (_follow_edits_button);
button_height_size_group->add_widget (_auto_return_button); button_height_size_group->add_widget (_auto_return_button);
/* clock button size groups */
button_height_size_group->add_widget (*_primary_clock.left_btn());
button_height_size_group->add_widget (*_primary_clock.right_btn());
button_height_size_group->add_widget (*_secondary_clock.left_btn());
button_height_size_group->add_widget (*_secondary_clock.right_btn());
Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL); Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
punch_button_size_group->add_widget (_punch_in_button); punch_button_size_group->add_widget (_punch_in_button);
punch_button_size_group->add_widget (_punch_out_button); punch_button_size_group->add_widget (_punch_out_button);
Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
clock1_size_group->add_widget (*_primary_clock.left_btn());
clock1_size_group->add_widget (*_primary_clock.right_btn());
Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
clock2_size_group->add_widget (*_secondary_clock.left_btn());
clock2_size_group->add_widget (*_secondary_clock.right_btn());
/* tooltips */ /* tooltips */
Gtkmm2ext::UI::instance()->set_tip (_punch_in_button, _("Start recording at auto-punch start")); Gtkmm2ext::UI::instance()->set_tip (_punch_in_button, _("Start recording at auto-punch start"));
Gtkmm2ext::UI::instance()->set_tip (_punch_out_button, _("Stop recording at auto-punch end")); Gtkmm2ext::UI::instance()->set_tip (_punch_out_button, _("Stop recording at auto-punch end"));
@ -278,6 +294,8 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
Gtkmm2ext::UI::instance()->set_tip (_latency_disable_button, _("Disable all Plugin Delay Compensation. This results in the shortest delay from live input to output, but any paths with delay-causing plugins will sound later than those without.")); Gtkmm2ext::UI::instance()->set_tip (_latency_disable_button, _("Disable all Plugin Delay Compensation. This results in the shortest delay from live input to output, but any paths with delay-causing plugins will sound later than those without."));
Gtkmm2ext::UI::instance()->set_tip (_auto_return_button, _("Return to last playback start when stopped")); Gtkmm2ext::UI::instance()->set_tip (_auto_return_button, _("Return to last playback start when stopped"));
Gtkmm2ext::UI::instance()->set_tip (_follow_edits_button, _("Playhead follows Range tool clicks, and Range selections")); Gtkmm2ext::UI::instance()->set_tip (_follow_edits_button, _("Playhead follows Range tool clicks, and Range selections"));
Gtkmm2ext::UI::instance()->set_tip (_primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
Gtkmm2ext::UI::instance()->set_tip (_secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
/* theming */ /* theming */
_sync_button.set_name ("transport active option button"); _sync_button.set_name ("transport active option button");
@ -413,8 +431,12 @@ ApplicationBar::set_session (Session *s)
{ {
SessionHandlePtr::set_session (s); SessionHandlePtr::set_session (s);
_transport_ctrl.set_session (s); if (s) {
_shuttle_box.set_session (s); _transport_ctrl.set_session (s);
_shuttle_box.set_session (s);
_primary_clock.set_session (s);
_secondary_clock.set_session (s);
}
if (_basic_ui) { if (_basic_ui) {
delete _basic_ui; delete _basic_ui;
@ -461,21 +483,26 @@ ApplicationBar::latency_switch_changed ()
} }
} }
void
ApplicationBar::focus_on_clock ()
{
_primary_clock.focus ();
}
void void
ApplicationBar::update_clock_visibility () ApplicationBar::update_clock_visibility ()
{ {
if (ARDOUR::Profile->get_small_screen()) { if (ARDOUR::Profile->get_small_screen()) {
_secondary_clock_spacer->hide();
return; return;
} }
if (UIConfiguration::instance().get_show_secondary_clock ()) { if (UIConfiguration::instance().get_show_secondary_clock ()) {
if (_secondary_clock_spacer) { _secondary_clock.show();
_secondary_clock_spacer->show(); _secondary_clock.left_btn()->show();
} _secondary_clock.right_btn()->show();
} else { } else {
if (_secondary_clock_spacer) { _secondary_clock.hide();
_secondary_clock_spacer->hide(); _secondary_clock.left_btn()->hide();
} _secondary_clock.right_btn()->hide();
} }
} }

View File

@ -58,6 +58,8 @@ public:
void set_session (ARDOUR::Session *); void set_session (ARDOUR::Session *);
void focus_on_clock ();
private: private:
void on_parent_changed (Gtk::Widget*); void on_parent_changed (Gtk::Widget*);
@ -104,6 +106,8 @@ private:
Gtk::Label _io_latency_value; Gtk::Label _io_latency_value;
ArdourWidgets::ArdourButton _auto_return_button; ArdourWidgets::ArdourButton _auto_return_button;
ArdourWidgets::ArdourButton _follow_edits_button; ArdourWidgets::ArdourButton _follow_edits_button;
TransportClock _primary_clock;
TransportClock _secondary_clock;
ArdourWidgets::ArdourVSpacer* _secondary_clock_spacer; ArdourWidgets::ArdourVSpacer* _secondary_clock_spacer;
std::vector<std::string> _record_mode_strings; std::vector<std::string> _record_mode_strings;

View File

@ -522,7 +522,6 @@ private:
Gtk::Frame transport_frame; Gtk::Frame transport_frame;
Gtk::HBox transport_hbox; Gtk::HBox transport_hbox;
void update_clock_visibility ();
void toggle_follow_edits (); void toggle_follow_edits ();
void set_transport_controllable_state (const XMLNode&); void set_transport_controllable_state (const XMLNode&);

View File

@ -95,8 +95,6 @@ ARDOUR_UI::setup_tooltips ()
set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything")); set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition")); set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
set_tip (feedback_alert_button, _("When lit, there is a ports connection issue, leading to feedback loop or ambiguous alignment.\nThis is caused by connecting an output back to some input (feedback), or by multiple connections from a source to the same output via different paths (ambiguous latency, record alignment).")); set_tip (feedback_alert_button, _("When lit, there is a ports connection issue, leading to feedback loop or ambiguous alignment.\nThis is caused by connecting an output back to some input (feedback), or by multiple connections from a source to the same output via different paths (ambiguous latency, record alignment)."));
set_tip (primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
set_tip (secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
set_tip (editor_meter_peak_display, _("Reset All Peak Meters")); set_tip (editor_meter_peak_display, _("Reset All Peak Meters"));
set_tip (error_alert_button, _("Show Error Log and acknowledge warnings")); set_tip (error_alert_button, _("Show Error Log and acknowledge warnings"));
set_tip (_cue_rec_enable, _("<b>When enabled</b>, triggering Cues will result in Cue Markers added to the timeline")); set_tip (_cue_rec_enable, _("<b>When enabled</b>, triggering Cues will result in Cue Markers added to the timeline"));
@ -191,23 +189,6 @@ ARDOUR_UI::cue_rec_state_changed ()
//Config->get_cue_behavior() //Config->get_cue_behavior()
} }
void
ARDOUR_UI::update_clock_visibility ()
{
if (ARDOUR::Profile->get_small_screen()) {
return;
}
if (UIConfiguration::instance().get_show_secondary_clock ()) {
secondary_clock->show();
secondary_clock->left_btn()->show();
secondary_clock->right_btn()->show();
} else {
secondary_clock->hide();
secondary_clock->left_btn()->hide();
secondary_clock->right_btn()->hide();
}
}
void void
ARDOUR_UI::setup_transport () ARDOUR_UI::setup_transport ()
{ {
@ -376,12 +357,6 @@ ARDOUR_UI::setup_transport ()
monitor_box->pack_start (monitor_dim_button, true, true); monitor_box->pack_start (monitor_dim_button, true, true);
monitor_box->pack_start (monitor_mute_button, true, true); monitor_box->pack_start (monitor_mute_button, true, true);
/* clock button size groups */
button_height_size_group->add_widget (*primary_clock->left_btn());
button_height_size_group->add_widget (*primary_clock->right_btn());
button_height_size_group->add_widget (*secondary_clock->left_btn());
button_height_size_group->add_widget (*secondary_clock->right_btn());
//tab selections //tab selections
button_height_size_group->add_widget (trigger_page_visibility_button); button_height_size_group->add_widget (trigger_page_visibility_button);
button_height_size_group->add_widget (recorder_visibility_button); button_height_size_group->add_widget (recorder_visibility_button);
@ -393,14 +368,6 @@ ARDOUR_UI::setup_transport ()
button_height_size_group->add_widget (action_script_call_btn[i]); button_height_size_group->add_widget (action_script_call_btn[i]);
} }
Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
clock1_size_group->add_widget (*primary_clock->left_btn());
clock1_size_group->add_widget (*primary_clock->right_btn());
Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
clock2_size_group->add_widget (*secondary_clock->left_btn());
clock2_size_group->add_widget (*secondary_clock->right_btn());
/* and the main table layout */ /* and the main table layout */
int vpadding = 1; int vpadding = 1;
int hpadding = 2; int hpadding = 2;
@ -449,8 +416,6 @@ ARDOUR_UI::setup_transport ()
transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding); transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
++col; ++col;
/* initialize */
update_clock_visibility ();
/* desensitize */ /* desensitize */
feedback_alert_button.set_sensitive (false); feedback_alert_button.set_sensitive (false);

View File

@ -54,6 +54,7 @@
#include "widgets/tearoff.h" #include "widgets/tearoff.h"
#include "widgets/tooltips.h" #include "widgets/tooltips.h"
#include "application_bar.h"
#include "ardour_ui.h" #include "ardour_ui.h"
#include "public_editor.h" #include "public_editor.h"
#include "audio_clock.h" #include "audio_clock.h"
@ -1053,8 +1054,8 @@ ARDOUR_UI::on_theme_changed ()
void void
ARDOUR_UI::focus_on_clock () ARDOUR_UI::focus_on_clock ()
{ {
if (primary_clock) { if (application_bar) {
primary_clock->focus (); application_bar->focus_on_clock ();
} }
} }