From a779700bc05c49fc3b9abdc1afeaf5138cc84ccd Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 30 Mar 2006 15:50:08 +0000 Subject: [PATCH] a) remove polarity button, add polarity menu item, move functionality into RouteUI b) correct switcheroo in function of active/visible columns for edit groups git-svn-id: svn://localhost/trunk/ardour2@431 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_edit_groups.cc | 16 +++++------ gtk2_ardour/mixer_strip.cc | 45 +++++++++---------------------- gtk2_ardour/mixer_strip.h | 3 --- gtk2_ardour/route_ui.cc | 21 +++++++++++++++ gtk2_ardour/route_ui.h | 4 +++ 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/gtk2_ardour/editor_edit_groups.cc b/gtk2_ardour/editor_edit_groups.cc index 56a3b6c4c4..c816216f1d 100644 --- a/gtk2_ardour/editor_edit_groups.cc +++ b/gtk2_ardour/editor_edit_groups.cc @@ -148,14 +148,6 @@ Editor::edit_group_list_button_press_event (GdkEventButton* ev) break; case 1: - if ((iter = group_model->get_iter (path))) { - bool visible = (*iter)[group_columns.is_visible]; - (*iter)[group_columns.is_visible] = !visible; - return true; - } - break; - - case 2: if ((iter = group_model->get_iter (path))) { bool active = (*iter)[group_columns.is_active]; (*iter)[group_columns.is_active] = !active; @@ -163,6 +155,14 @@ Editor::edit_group_list_button_press_event (GdkEventButton* ev) } break; + case 2: + if ((iter = group_model->get_iter (path))) { + bool visible = (*iter)[group_columns.is_visible]; + (*iter)[group_columns.is_visible] = !visible; + return true; + } + break; + default: break; } diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 9709d9217a..faf6bc43df 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -87,12 +87,11 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) post_redirect_box (PostFader, sess, rt, mx.plugin_selector(), mx.selection(), in_mixer), gpm (_route, sess), panners (_route, sess), - button_table (7, 2), + button_table (6, 2), gain_automation_style_button (""), gain_automation_state_button (""), pan_automation_style_button (""), pan_automation_state_button (""), - polarity_button (_("polarity")), comment_button (_("comments")), speed_adjustment (1.0, 0.001, 4.0, 0.001, 0.1), speed_spinner (&speed_adjustment, "MixerStripSpeedBase", true) @@ -136,7 +135,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) gain_automation_state_button.set_name ("MixerAutomationPlaybackButton"); pan_automation_style_button.set_name ("MixerAutomationModeButton"); pan_automation_state_button.set_name ("MixerAutomationPlaybackButton"); - polarity_button.set_name ("MixerPhaseInvertButton"); ARDOUR_UI::instance()->tooltips().set_tip (pan_automation_state_button, _("Pan automation mode")); ARDOUR_UI::instance()->tooltips().set_tip (gain_automation_state_button, _("Gain automation mode")); @@ -156,7 +154,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) gain_automation_state_button.unset_flags (Gtk::CAN_FOCUS); pan_automation_style_button.unset_flags (Gtk::CAN_FOCUS); pan_automation_state_button.unset_flags (Gtk::CAN_FOCUS); - polarity_button.unset_flags (Gtk::CAN_FOCUS); button_table.set_homogeneous (true); button_table.set_spacings (0); @@ -165,15 +162,11 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) button_table.attach (group_button, 0, 2, 1, 2); button_table.attach (input_button, 0, 2, 2, 3); - button_table.attach (polarity_button, 0, 2, 3, 4); + button_table.attach (*solo_button, 0, 1, 3, 4); + button_table.attach (*mute_button, 1, 2, 3, 4); - button_table.attach (*solo_button, 0, 1, 4, 5); - button_table.attach (*mute_button, 1, 2, 4, 5); - - // button_table.attach (gain_automation_style_button, 0, 1, 5, 6); - button_table.attach (gain_automation_state_button, 0, 1, 5, 6); - // button_table.attach (pan_automation_style_button, 0, 1, 6, 7); - button_table.attach (pan_automation_state_button, 1, 2, 5, 6); + button_table.attach (gain_automation_state_button, 0, 1, 4, 5); + button_table.attach (pan_automation_state_button, 1, 2, 4, 5); using namespace Menu_Helpers; @@ -228,10 +221,10 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) ARDOUR_UI::instance()->tooltips().set_tip (speed_spinner, _("varispeed")); - button_table.attach (speed_frame, 0, 2, 6, 7); + button_table.attach (speed_frame, 0, 2, 5, 6); #endif /* VARISPEED_IN_MIXER_STRIP */ - button_table.attach (*rec_enable_button, 0, 2, 6, 7); + button_table.attach (*rec_enable_button, 0, 2, 5, 6); } name_button.add (name_label); @@ -328,8 +321,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) pan_automation_state_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::pan_automation_state_button_event), false); pan_automation_state_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::pan_automation_state_button_event), false); - polarity_button.signal_toggled().connect (mem_fun(*this, &MixerStrip::polarity_toggled)); - name_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::name_button_button_release), false); group_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::select_mix_group), false); @@ -362,10 +353,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) speed_changed (); } - /* XXX hack: no phase invert changed signal */ - - polarity_button.set_active (_route.phase_invert()); - update_diskstream_display (); update_input_display (); update_output_display (); @@ -451,7 +438,6 @@ MixerStrip::set_width (Width w) static_cast (gain_automation_state_button.get_child())->set_text (astate_string(_route.gain_automation_curve().automation_state())); static_cast (pan_automation_style_button.get_child())->set_text (astyle_string(_route.panner().automation_style())); static_cast (pan_automation_state_button.get_child())->set_text (astate_string(_route.panner().automation_state())); - static_cast (polarity_button.get_child())->set_text (_("polarity")); Gtkmm2ext::set_size_request_to_display_given_text (name_button, "long", 2, 2); break; @@ -467,7 +453,6 @@ MixerStrip::set_width (Width w) static_cast (gain_automation_state_button.get_child())->set_text (short_astate_string(_route.gain_automation_curve().automation_state())); static_cast (pan_automation_style_button.get_child())->set_text (short_astyle_string(_route.panner().automation_style())); static_cast (pan_automation_state_button.get_child())->set_text (short_astate_string(_route.panner().automation_state())); - static_cast (polarity_button.get_child())->set_text (_("pol")); Gtkmm2ext::set_size_request_to_display_given_text (name_button, "longest label", 2, 2); break; } @@ -1180,16 +1165,6 @@ MixerStrip::mix_group_changed (void *ignored) } } -void -MixerStrip::polarity_toggled () -{ - bool x; - - if ((x = polarity_button.get_active()) != _route.phase_invert()) { - _route.set_phase_invert (x, this); - } -} - void MixerStrip::route_gui_changed (string what_changed, void* ignored) @@ -1228,9 +1203,13 @@ MixerStrip::build_route_ops_menu () items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteUI::route_rename))); items.push_back (SeparatorElem()); - items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active))); + items.push_back (CheckMenuElem (_("Active"), mem_fun (*this, &RouteUI::toggle_route_active))); route_active_menu_item = dynamic_cast (&items.back()); route_active_menu_item->set_active (_route.active()); + items.push_back (SeparatorElem()); + items.push_back (CheckMenuElem (_("Invert Polarity"), mem_fun (*this, &RouteUI::toggle_polarity))); + polarity_menu_item = dynamic_cast (&items.back()); + polarity_menu_item->set_active (_route.phase_invert()); build_remote_control_menu (); diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 9ce502e919..79a58764da 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -146,8 +146,6 @@ class MixerStrip : public RouteUI, public Gtk::EventBox Gtk::Menu pan_astate_menu; Gtk::Menu pan_astyle_menu; - Gtk::ToggleButton polarity_button; - sigc::connection newplug_connection; gint mark_update_safe (); @@ -237,7 +235,6 @@ class MixerStrip : public RouteUI, public Gtk::EventBox bool select_mix_group (GdkEventButton *); void mix_group_changed (void *); - void polarity_toggled (); IOSelectorWindow *input_selector; IOSelectorWindow *output_selector; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 8ed4bcd1c8..2421b497b8 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -773,6 +773,27 @@ RouteUI::route_active_changed () } } +void +RouteUI::toggle_polarity () +{ + if (polarity_menu_item) { + + bool x; + + ENSURE_GUI_THREAD(mem_fun (*this, &RouteUI::toggle_polarity)); + + if ((x = polarity_menu_item->get_active()) != _route.phase_invert()) { + _route.set_phase_invert (x, this); + } + } +} + +void +RouteUI::polarity_changed () +{ + /* no signal for this yet */ +} + void RouteUI::solo_safe_toggle(void* src, Gtk::CheckMenuItem* check) { diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 990bcd99ed..b7a5b059f0 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -130,6 +130,10 @@ class RouteUI : public virtual AxisView void toggle_route_active (); virtual void route_active_changed (); + Gtk::CheckMenuItem *polarity_menu_item; + void toggle_polarity (); + virtual void polarity_changed (); + void disconnect_input (); void disconnect_output ();