13
0

MainClock: introduce change_display_delta_mode signal

Avoid MainClock directly telling the config system which of the
MainClock instances was requested changed through the menu.
This commit is contained in:
Mads Kiilerich 2022-11-18 12:08:18 +01:00
parent 38d7d28b25
commit c805ff5fdf
3 changed files with 4 additions and 5 deletions

View File

@ -371,7 +371,9 @@ ARDOUR_UI::setup_transport ()
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false)); ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false));
primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed)); primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
primary_clock->change_display_delta_mode_signal.connect (sigc::mem_fun(UIConfiguration::instance(), &UIConfiguration::set_primary_clock_delta_mode));
secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed)); secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
secondary_clock->change_display_delta_mode_signal.connect (sigc::mem_fun(UIConfiguration::instance(), &UIConfiguration::set_secondary_clock_delta_mode));
big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed)); big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor)); editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));

View File

@ -120,11 +120,7 @@ MainClock::change_display_delta_mode (ClockDeltaMode m)
if (_suspend_delta_mode_signal) { if (_suspend_delta_mode_signal) {
return; return;
} }
if (_primary) { change_display_delta_mode_signal (m);
UIConfiguration::instance().set_primary_clock_delta_mode (m);
} else {
UIConfiguration::instance().set_secondary_clock_delta_mode (m);
}
} }
void void

View File

@ -32,6 +32,7 @@ public:
void set_session (ARDOUR::Session *s); void set_session (ARDOUR::Session *s);
void set_display_delta_mode (ARDOUR::ClockDeltaMode m); void set_display_delta_mode (ARDOUR::ClockDeltaMode m);
void set (Temporal::timepos_t const &, bool force = false); void set (Temporal::timepos_t const &, bool force = false);
sigc::signal<bool, ARDOUR::ClockDeltaMode> change_display_delta_mode_signal;
private: private:
void build_ops_menu (); void build_ops_menu ();