13
0

Improve RouteUI API consistency

This is an effective NO-OP
 * Some methods have been re-named to improve consistency
 * Duplicate function calls were removed:
   RouteUI::set_route() already updates mute/solo
   MixerStrip does not have to update it again
 * virtual methods have been protected
This commit is contained in:
Robin Gareus 2020-03-02 19:06:40 +01:00
parent 14c670869c
commit 6120d4d43a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 10 additions and 30 deletions

View File

@ -569,8 +569,6 @@ FoldbackStrip::set_route (boost::shared_ptr<Route> rt)
name_changed ();
update_send_box ();
_session->FBSendsChanged.connect (route_connections, invalidator (*this), boost::bind (&FoldbackStrip::update_send_box, this), gui_context());
update_mute_display ();
update_solo_display ();
comment_changed ();
connect_to_pan ();
panners.setup_pan ();

View File

@ -690,8 +690,6 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
/* now force an update of all the various elements */
update_mute_display ();
update_solo_display ();
name_changed ();
comment_changed ();
route_group_changed ();

View File

@ -340,7 +340,7 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
_route->solo_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
_route->solo_safe_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
_route->solo_isolate_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_solo_display, this), gui_context());
_route->phase_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::polarity_changed, this), gui_context());
_route->phase_control()->Changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::update_polarity_display, this), gui_context());
_route->fan_out.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::fan_out, this, false, true), gui_context());
if (is_track()) {
@ -395,7 +395,6 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
map_frozen ();
setup_invert_buttons ();
set_invert_button_state ();
boost::shared_ptr<Route> s = _showing_sends_to.lock ();
bus_send_display_changed (s);
@ -413,16 +412,6 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
route_gui_changed (PropertyChange (Properties::selected));
}
void
RouteUI::polarity_changed ()
{
if (!_route) {
return;
}
set_invert_button_state ();
}
bool
RouteUI::mute_press (GdkEventButton* ev)
{
@ -2063,11 +2052,11 @@ RouteUI::setup_invert_buttons ()
_invert_button_box.set_spacing (1);
_invert_button_box.show_all ();
set_invert_button_state ();
update_polarity_display ();
}
void
RouteUI::set_invert_button_state ()
RouteUI::update_polarity_display ()
{
uint32_t const N = _route->phase_control()->size();
if (N > _max_invert_buttons) {
@ -2112,7 +2101,6 @@ RouteUI::invert_release (GdkEventButton* ev, uint32_t i)
return false;
}
bool
RouteUI::invert_press (GdkEventButton* ev)
{
@ -2152,7 +2140,6 @@ RouteUI::invert_menu_toggled (uint32_t c)
return;
}
_route->phase_control()->set_phase_invert (c, !_route->phase_control()->inverted (c));
}

View File

@ -235,8 +235,6 @@ public:
Gtk::CheckMenuItem *rec_safe_item;
void toggle_rec_safe ();
virtual void polarity_changed ();
Gtk::CheckMenuItem *denormal_menu_item;
void toggle_denormal_protection();
virtual void denormal_protection_changed ();
@ -244,13 +242,6 @@ public:
void disconnect_input ();
void disconnect_output ();
virtual void blink_rec_display (bool onoff);
void update_mute_display ();
void update_solo_display ();
virtual void map_frozen ();
void save_as_template_dialog_response (int response, SaveTemplateDialog* d);
void save_as_template ();
@ -290,6 +281,9 @@ protected:
void init ();
void reset ();
virtual void blink_rec_display (bool onoff);
virtual void map_frozen ();
void self_delete ();
virtual void start_step_editing () {}
virtual void stop_step_editing() {}
@ -340,11 +334,14 @@ protected:
private:
void setup_invert_buttons ();
void set_invert_button_state ();
void invert_menu_toggled (uint32_t);
bool invert_press (GdkEventButton *);
bool invert_release (GdkEventButton *, uint32_t i);
void update_solo_display ();
void update_mute_display ();
void update_polarity_display ();
int _i_am_the_modifier;
std::vector<ArdourWidgets::ArdourButton*> _invert_buttons;
Gtk::Menu* _invert_menu;