From 5a4d340b42ae2485d4bde4421f84c6220b24cab4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 17 May 2009 17:05:56 +0000 Subject: [PATCH] Das BlinkenSendButtons git-svn-id: svn://localhost/ardour2/branches/3.0@5097 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour3_ui_dark.rc.in | 12 ++++++++++++ gtk2_ardour/gain_meter.h | 1 + gtk2_ardour/mixer_strip.cc | 9 +++++++-- gtk2_ardour/route_ui.cc | 21 ++++++++++++++++++++- gtk2_ardour/route_ui.h | 3 +++ libs/ardour/ardour/send.h | 2 ++ libs/ardour/send.cc | 13 +++++++++++++ 7 files changed, 58 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index 6a92cc7819..bac7baae8c 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -1063,6 +1063,16 @@ style "flashing_alert" = "very_small_text" bg[ACTIVE] = { 1.0, 0, 0} } + +style "green_flashing_alert" = "very_small_text" +{ + fg[NORMAL] = { 0.80, 0.80, 0.80 } + bg[NORMAL] = { 0.26, 0.26, 0.31 } + + fg[ACTIVE] = { 0.80, 0.80, 0.80 } + bg[ACTIVE] = { 0.52, 1.0, 0} +} + style "selected_io_selector_port_list" = "medium_bold_text" { @@ -1479,6 +1489,8 @@ widget "*BypassButton" style:highest "red_when_active" widget "*BypassButton*" style:highest "red_when_active" widget "*TransportSoloAlert" style:highest "flashing_alert" widget "*TransportSoloAlert.*" style:highest "flashing_alert" +widget "*SendAlert" style:highest "green_flashing_alert" +widget "*SendAlert.*" style:highest "green_flashing_alert" widget "*TransportAuditioningAlert" style:highest "flashing_alert" widget "*TransportAuditioningAlert.*" style:highest "flashing_alert" widget "*FadeCurve" style:highest "medium_bold_entry" diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h index 29d941f49a..ea817bcae2 100644 --- a/gtk2_ardour/gain_meter.h +++ b/gtk2_ardour/gain_meter.h @@ -63,6 +63,7 @@ class GainMeterBase : virtual public sigc::trackable virtual ~GainMeterBase (); virtual void set_io (boost::shared_ptr); + boost::shared_ptr io() const { return _io; } void update_gain_sensitive (); void update_meters (); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 4d8d196b4b..fdc1e2f39b 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -294,7 +294,6 @@ MixerStrip::init () /* ditto for this button and busses */ - show_sends_button->set_name ("MixerRecordEnableButton"); show_sends_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::show_sends_press), false); show_sends_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::show_sends_release)); @@ -1506,10 +1505,12 @@ MixerStrip::switch_io (boost::shared_ptr target) /* don't change the display for the target or the master bus */ return; } else if (!is_track() && show_sends_button) { - /* make sure our show sends button is inactive, + /* make sure our show sends button is inactive, and we no longer blink, since we're not the target. */ + send_blink_connection.disconnect (); show_sends_button->set_active (false); + show_sends_button->set_state (STATE_NORMAL); } if (!target) { @@ -1537,9 +1538,12 @@ MixerStrip::switch_io (boost::shared_ptr target) panner_ui().setup_pan (); } + void MixerStrip::revert_to_default_display () { + show_sends_button->set_active (false); + if (_current_send) { _current_send->set_metering (false); _current_send.reset(); @@ -1550,3 +1554,4 @@ MixerStrip::revert_to_default_display () panner_ui().set_io (_route); panner_ui().setup_pan (); } + diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 5efb3a6a2c..393ab011f3 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -31,6 +31,7 @@ #include "pbd/shiva.h" #include "pbd/controllable.h" +#include "ardour_ui.h" #include "route_ui.h" #include "keyboard.h" #include "utils.h" @@ -122,7 +123,7 @@ RouteUI::init () UI::instance()->set_tip (rec_enable_button, _("Enable recording on this track"), ""); show_sends_button = manage (new BindableToggleButton ("")); - show_sends_button->set_name ("ShowSendsButton"); + show_sends_button->set_name ("SendAlert"); show_sends_button->set_self_managed (true); UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), ""); @@ -562,11 +563,15 @@ RouteUI::show_sends_press(GdkEventButton* ev) show_sends_button->set_active (!show_sends_button->get_active()); + /* start blinking */ + if (show_sends_button->get_active()) { /* show sends to this bus */ MixerStrip::SwitchIO (_route); + send_blink_connection = ARDOUR_UI::instance()->Blink.connect (mem_fun(*this, &RouteUI::send_blink)); } else { /* everybody back to normal */ + send_blink_connection.disconnect (); MixerStrip::SwitchIO (boost::shared_ptr()); } @@ -582,6 +587,20 @@ RouteUI::show_sends_release (GdkEventButton* ev) return true; } +void +RouteUI::send_blink (bool onoff) +{ + if (!show_sends_button) { + return; + } + + if (onoff) { + show_sends_button->set_state (STATE_ACTIVE); + } else { + show_sends_button->set_state (STATE_NORMAL); + } +} + void RouteUI::solo_changed(void* src) { diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 5a1933997d..de8d7ea30c 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -83,6 +83,9 @@ class RouteUI : public virtual AxisView BindableToggleButton* solo_button; BindableToggleButton* rec_enable_button; /* audio tracks */ BindableToggleButton* show_sends_button; /* busses */ + + void send_blink (bool); + sigc::connection send_blink_connection; virtual std::string solo_button_name () const { return "SoloButton"; } virtual std::string safe_solo_button_name () const { return "SafeSoloButton"; } diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index 7bdc7ed02f..b47263b547 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -52,6 +52,8 @@ class Send : public Delivery bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool configure_io (ChanCount in, ChanCount out); + bool set_name (const std::string& str); + static uint32_t how_many_sends(); static void make_unique (XMLNode &, Session &); diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 852f27d38f..5874b91cf6 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -167,3 +167,16 @@ Send::make_unique (XMLNode &state, Session &session) io->property("name")->set_value (name); } } + +bool +Send::set_name (const std::string& new_name) +{ + char buf[32]; + std::string unique_name; + + snprintf (buf, sizeof (buf), "%u", _bitslot); + unique_name = new_name; + unique_name += buf; + + return Delivery::set_name (unique_name); +} -- 2.30.2