diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-06 18:40:37 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-06 18:40:37 +0000 |
commit | f2ceb5c3404bb3e7f4ccc5bb3f2236f593775d73 (patch) | |
tree | b8cc08678ab9b4e189a5cd97ae16f425fe8ab0b4 /gtk2_ardour | |
parent | e1ed9467dc9f9ffec7549958b1bca27b753e8742 (diff) |
lots of odds and ends to do with solo isolate and its GUI
git-svn-id: svn://localhost/ardour2/branches/3.0@7072 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour3_ui_dark.rc.in | 17 | ||||
-rw-r--r-- | gtk2_ardour/led.cc | 48 | ||||
-rw-r--r-- | gtk2_ardour/led.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 12 | ||||
-rw-r--r-- | gtk2_ardour/monitor_section.cc | 34 | ||||
-rw-r--r-- | gtk2_ardour/monitor_section.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.cc | 24 |
7 files changed, 111 insertions, 34 deletions
diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index 1c1fdd520c..e423ad7960 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -332,14 +332,14 @@ style "solo_button" = "small_button" style "solo_isolate_led" { + fg[NORMAL] = { 0.725, 0.925, 0.949 } fg[ACTIVE] = { 1.0, 0, 0 } - fg[NORMAL] = { 0, 1.0, 0 } } style "solo_safe_led" { - fg[ACTIVE] = { 0.26, 0.47, 0.69 } - fg[NORMAL] = { 0, 1.0, 0 } + fg[NORMAL] = { 0.725, 0.925, 0.949 } + fg[ACTIVE] = { 1.0, 0, 0 } } style "solo_button_alternate" = "small_button" @@ -456,6 +456,13 @@ style "monitor_dim_button" = "small_button" fg[ACTIVE] = { 0, 0, 0 } } +style "monitor_iso_button" = "small_button" +{ + font_name = "@FONT_SMALLER@" + bg[ACTIVE] = { 0.725, 0.925, 0.949 } + fg[ACTIVE] = { 0, 0, 0 } +} + style "mute_button" = "small_button" { bg[ACTIVE] = { 0.90, 0.89, 0.73 } @@ -1689,6 +1696,8 @@ widget "*MonitorInvertButton" style:highest "monitor_invert_button" widget "*MonitorInvertButton*" style:highest "monitor_invert_button" widget "*MonitorOptButton" style:highest "monitor_opt_button" widget "*MonitorOptButton*" style:highest "monitor_opt_button" +widget "*MonitorIsoAlert" style:highest "monitor_iso_button" +widget "*MonitorIsoAlert*" style:highest "monitor_iso_button" widget "*BypassButton" style:highest "red_when_active" widget "*BypassButton*" style:highest "red_when_active" widget "*TransportSoloAlert" style:highest "flashing_alert" @@ -1806,4 +1815,4 @@ widget "*PortMatrixLabel*" style:highest "small_text" widget "*MidiTracerTextView" style:highest "midi_tracer_textview" widget "*SoloIsolatedLED" style:highest "solo_isolate_led" widget "*SoloSafeLED" style:highest "solo_safe_led" -widget "*SoloLEDLabel" style:highest "smallest_text" +widget "*SoloLEDLabel" style:highest "very_small_text" diff --git a/gtk2_ardour/led.cc b/gtk2_ardour/led.cc index 645b65e99b..76d71bc35e 100644 --- a/gtk2_ardour/led.cc +++ b/gtk2_ardour/led.cc @@ -122,24 +122,7 @@ LED::set_visual_state (int32_t s) if (s != _visual_state) { _visual_state = s; - - RefPtr<Style> style = get_style(); - Color c; - - switch (_visual_state) { - case 0: - c = style->get_fg (STATE_NORMAL); - break; - default: - c = style->get_fg (STATE_ACTIVE); - break; - } - - _red = c.get_red_p (); - _green = c.get_green_p (); - _blue = c.get_blue_p (); - - set_dirty (); + set_colors_from_style (); } } @@ -156,6 +139,13 @@ LED::set_diameter (float d) } void +LED::on_realize () +{ + set_colors_from_style (); + CairoWidget::on_realize (); +} + +void LED::on_size_request (Gtk::Requisition* req) { if (_fixed_diameter) { @@ -165,3 +155,25 @@ LED::on_size_request (Gtk::Requisition* req) CairoWidget::on_size_request (req); } } + +void +LED::set_colors_from_style () +{ + RefPtr<Style> style = get_style(); + Color c; + + switch (_visual_state) { + case 0: + c = style->get_fg (STATE_NORMAL); + break; + default: + c = style->get_fg (STATE_ACTIVE); + break; + } + + _red = c.get_red_p (); + _green = c.get_green_p (); + _blue = c.get_blue_p (); + + set_dirty (); +} diff --git a/gtk2_ardour/led.h b/gtk2_ardour/led.h index 6350a36ba3..06ac7454df 100644 --- a/gtk2_ardour/led.h +++ b/gtk2_ardour/led.h @@ -37,7 +37,8 @@ class LED : public CairoWidget protected: void render (cairo_t *); void on_size_request (Gtk::Requisition* req); - + void on_realize (); + private: int32_t _visual_state; bool _active; @@ -46,6 +47,8 @@ class LED : public CairoWidget float _red; float _green; float _blue; + + void set_colors_from_style (); }; #endif /* __gtk2_ardour_led_h__ */ diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index df9fc36084..ede93736e9 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -188,7 +188,7 @@ MixerStrip::init () solo_isolated_led = manage (new LED); solo_isolated_led->show (); - solo_isolated_led->set_diameter (5); + solo_isolated_led->set_diameter (6); solo_isolated_led->set_no_show_all (true); solo_isolated_led->set_name (X_("SoloIsolatedLED")); solo_isolated_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); @@ -197,7 +197,7 @@ MixerStrip::init () solo_safe_led = manage (new LED); solo_safe_led->show (); - solo_safe_led->set_diameter (5); + solo_safe_led->set_diameter (6); solo_safe_led->set_no_show_all (true); solo_safe_led->set_name (X_("SoloSafeLED")); solo_safe_led->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); @@ -215,10 +215,10 @@ MixerStrip::init () solo_led_table.set_spacings (0); solo_led_table.set_border_width (1); - solo_led_table.attach (*solo_isolated_led, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); - solo_led_table.attach (*iso_label, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL); - solo_led_table.attach (*solo_safe_led, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL); - solo_led_table.attach (*safe_label, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL); + solo_led_table.attach (*iso_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); + solo_led_table.attach (*solo_isolated_led, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL); + solo_led_table.attach (*safe_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL); + solo_led_table.attach (*solo_safe_led, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL); solo_led_table.show (); solo_led_box.pack_end (solo_led_table, false, false); diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index a5331a0c8e..5b60942bb1 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -51,6 +51,7 @@ MonitorSection::MonitorSection (Session* s) , dim_all_button (_("dim")) , mono_button (_("mono")) , rude_solo_button (_("soloing")) + , rude_iso_button (_("isolated")) , rude_audition_button (_("auditioning")) , exclusive_solo_button (_("Exclusive")) , solo_mute_override_button (_("Solo/Mute")) @@ -92,6 +93,9 @@ MonitorSection::MonitorSection (Session* s) rude_solo_button.set_name ("TransportSoloAlert"); rude_solo_button.show (); + rude_iso_button.set_name ("MonitorIsoAlert"); + rude_iso_button.show (); + rude_audition_button.set_name ("TransportAuditioningAlert"); rude_audition_button.show (); @@ -100,6 +104,9 @@ MonitorSection::MonitorSection (Session* s) rude_solo_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_solo), false); UI::instance()->set_tip (rude_solo_button, _("When active, something is soloed.\nClick to de-solo everything")); + rude_iso_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_isolate), false); + UI::instance()->set_tip (rude_iso_button, _("When active, something is solo-isolated.\nClick to de-isolate everything")); + rude_audition_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_audition), false); UI::instance()->set_tip (rude_audition_button, _("When active, auditioning is active.\nClick to stop the audition")); @@ -182,7 +189,12 @@ MonitorSection::MonitorSection (Session* s) solo_opt_box->show (); upper_packer.set_spacing (12); - upper_packer.pack_start (rude_solo_button, false, false); + + Gtk::HBox* rude_box = manage (new HBox); + rude_box->pack_start (rude_solo_button, true, true); + rude_box->pack_start (rude_iso_button, true, true); + + upper_packer.pack_start (*rude_box, false, false); upper_packer.pack_start (rude_audition_button, false, false); upper_packer.pack_start (solo_model_box, false, false); upper_packer.pack_start (*solo_opt_box, false, false); @@ -306,12 +318,13 @@ MonitorSection::set_session (Session* s) _route.reset (); } - } else { /* no session */ _monitor.reset (); _route.reset (); control_connections.drop_connections (); + rude_iso_button.set_active (false); + rude_solo_button.set_active (false); } /* both might be null */ @@ -920,9 +933,15 @@ MonitorSection::solo_blink (bool onoff) } else { rude_solo_button.set_state (STATE_NORMAL); } + + if (_session->soloing()) { + rude_iso_button.set_active (_session->solo_isolated()); + } + } else { // rude_solo_button.set_active (false); rude_solo_button.set_state (STATE_NORMAL); + rude_iso_button.set_active (false); } } @@ -941,6 +960,17 @@ MonitorSection::cancel_solo (GdkEventButton* ev) } bool +MonitorSection::cancel_isolate (GdkEventButton* ev) +{ + if (_session) { + boost::shared_ptr<RouteList> rl (_session->get_routes ()); + _session->set_solo_isolated (rl, false, Session::rt_cleanup, true); + } + + return true; +} + +bool MonitorSection::cancel_audition (GdkEventButton* ev) { if (_session) { diff --git a/gtk2_ardour/monitor_section.h b/gtk2_ardour/monitor_section.h index d543ea1acd..b3edb624b9 100644 --- a/gtk2_ardour/monitor_section.h +++ b/gtk2_ardour/monitor_section.h @@ -115,6 +115,7 @@ class MonitorSection : public RouteUI BindableToggleButton dim_all_button; BindableToggleButton mono_button; BindableToggleButton rude_solo_button; + BindableToggleButton rude_iso_button; BindableToggleButton rude_audition_button; BindableToggleButton exclusive_solo_button; BindableToggleButton solo_mute_override_button; @@ -123,11 +124,13 @@ class MonitorSection : public RouteUI void solo_blink (bool); void audition_blink (bool); bool cancel_solo (GdkEventButton*); + bool cancel_isolate (GdkEventButton*); bool cancel_audition (GdkEventButton*); void solo_cut_changed (); void update_solo_model (); void parameter_changed (std::string); - + void isolated_changed (); + PBD::ScopedConnection config_connection; PBD::ScopedConnectionList control_connections; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 3bc36da091..58d5a721b5 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -1072,13 +1072,33 @@ RouteUI::muting_change () bool RouteUI::solo_isolate_button_release (GdkEventButton* ev) { + if (ev->type == GDK_2BUTTON_PRESS || ev->type == GDK_3BUTTON_PRESS) { + return true; + } + bool view = (solo_isolated_led->visual_state() != 0); bool model = _route->solo_isolated(); /* called BEFORE the view has changed */ - if (model == view) { - _route->set_solo_isolated (!view, this); + if (ev->button == 1) { + if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { + + if (model) { + /* disable isolate for all routes */ + _session->set_solo_isolated (_session->get_routes(), false, Session::rt_cleanup, true); + } + + } else { + if (model == view) { + + /* flip just this route */ + + boost::shared_ptr<RouteList> rl (new RouteList); + rl->push_back (_route); + _session->set_solo_isolated (rl, !view, Session::rt_cleanup, true); + } + } } return true; |