Das BlinkenSendButtons
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 17 May 2009 17:05:56 +0000 (17:05 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 17 May 2009 17:05:56 +0000 (17:05 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5097 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour3_ui_dark.rc.in
gtk2_ardour/gain_meter.h
gtk2_ardour/mixer_strip.cc
gtk2_ardour/route_ui.cc
gtk2_ardour/route_ui.h
libs/ardour/ardour/send.h
libs/ardour/send.cc

index 6a92cc7819d33194181251518a20424115852d89..bac7baae8cc8603db9af5772bc02df8f76dab8da 100644 (file)
@@ -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"
index 29d941f49af4ac6cc88e21a02c3d3ad35df49d5e..ea817bcae2f21b8df22ba3f5aca678c4577f3fda 100644 (file)
@@ -63,6 +63,7 @@ class GainMeterBase : virtual public sigc::trackable
        virtual ~GainMeterBase ();
 
        virtual void set_io (boost::shared_ptr<ARDOUR::IO>);
+       boost::shared_ptr<ARDOUR::IO> io() const { return _io; }
 
        void update_gain_sensitive ();
        void update_meters ();
index 4d8d196b4b82e15d46b0eb457a0c755f81118401..fdc1e2f39bda81795326dce5219d7f850cee2898 100644 (file)
@@ -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<Route> 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<Route> 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 ();
 }
+
index 5efb3a6a2c04cc6cd7e2f90412a9924c7d1d63f7..393ab011f3a1c54de3d41a05f6455017d37b432e 100644 (file)
@@ -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<Route>());
                        }
 
@@ -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)
 {
index 5a1933997dde9bc60d53194c2283e436edaabc1f..de8d7ea30c27d779ac8ea4626a5d18560ebb8a1b 100644 (file)
@@ -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"; }
index 7bdc7ed02fb51776070822a8184bbbd3a6846a58..b47263b547e87083add5567876382194a2ab21f9 100644 (file)
@@ -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 &);
 
index 852f27d38fdb8224c3d47f79b01f717ba1d7ad3b..5874b91cf6bada9398c2e836e080ea70a8580687 100644 (file)
@@ -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);
+}