13
0

Das BlinkenSendButtons

git-svn-id: svn://localhost/ardour2/branches/3.0@5097 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-05-17 17:05:56 +00:00
parent d1f09a9403
commit 5a4d340b42
7 changed files with 58 additions and 3 deletions

View 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"

View 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 ();

View 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 ();
}

View 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)
{

View 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"; }

View 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 &);

View 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);
}