summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-02-13 14:25:17 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-02-13 14:25:17 +0000
commitd405df54ec37ef039d1044b727044e109b110ffa (patch)
treee5f2ceaf405716feb9f4c3af00554095a27de042 /gtk2_ardour/route_ui.cc
parent8e79cd5610789b377d0975640a555cc45d9300cb (diff)
the buttons will submit to my rule! prelight-when-active, be gonecd /usr/local/music/src/ardour
git-svn-id: svn://localhost/ardour2/trunk@1451 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r--gtk2_ardour/route_ui.cc68
1 files changed, 14 insertions, 54 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index c122f666eb..e2783a11b9 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -77,26 +77,11 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
mute_button->set_self_managed (true);
solo_button = manage (new BindableToggleButton (_route->solo_control(), s_name ));
+ solo_button->set_self_managed (true);
mute_button->set_name ("MuteButton");
solo_button->set_name ("SoloButton");
- vector<Gdk::Color> colors;
- Gdk::Color c;
-
- ::set_color(c, rgba_from_style (X_("MuteButton"), 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_SELECTED, false ));
- colors.push_back (c);
- ::set_color(c, rgba_from_style (X_("MuteButton"), 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false ));
- colors.push_back (c);
- mute_button->set_colors (colors);
-
- colors.clear ();
-
- /* mute+solo buttons get 2 color states, so add one here to supplement the existing one */
- ::set_color(c, rgba_from_style (X_("SoloButton"), 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false ));
- colors.push_back (c);
- solo_button->set_colors (colors);
-
_route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
_route->solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
_route->solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
@@ -116,24 +101,8 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
_session.RecordStateChanged.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
rec_enable_button = manage (new BindableToggleButton (t->rec_enable_control(), r_name ));
-
- /* we manage colors for the rec button, since it has 3 (disabled,enabled,recording),
- not just 2 (active&inactive)
- */
-
rec_enable_button->set_self_managed (true);
- colors.clear ();
-
- /* record button has 3 color states, so we set 2 extra here */
- ::set_color(c, rgba_from_style (X_("RecordEnableButton"), 0xff, 0, 0, 0, "bg", Gtk::STATE_SELECTED, false ));
- colors.push_back (c);
-
- ::set_color(c, rgba_from_style (X_("RecordEnableButton"), 0xff, 0, 0, 0, "bg", Gtk::STATE_ACTIVE, false ));
- colors.push_back (c);
-
- rec_enable_button->set_colors (colors);
-
update_rec_display ();
}
@@ -382,32 +351,22 @@ void
RouteUI::update_solo_display ()
{
bool x;
- vector<Gdk::Color> colors;
+ vector<Gdk::Color> fg_colors;
Gdk::Color c;
-
- if (_route->solo_safe() != was_solo_safe){
-
- if (_route->solo_safe()) {
- /* show solo safe */
- ::set_color(c, rgba_from_style (safe_solo_button_name(), 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false ));
- solo_button->set_name(safe_solo_button_name());
- } else {
- ::set_color(c, rgba_from_style (solo_button_name(), 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false ));
- solo_button->set_name(solo_button_name());
- }
-
- colors.push_back (c);
- solo_button->set_colors (colors);
-
- was_solo_safe = !was_solo_safe;
- }
-
+
if (solo_button->get_active() != (x = _route->soloed())){
ignore_toggle = true;
solo_button->set_active(x);
ignore_toggle = false;
}
+ if (_route->solo_safe()) {
+ solo_button->set_visual_state (2);
+ } else if (_route->soloed()) {
+ solo_button->set_visual_state (1);
+ } else {
+ solo_button->set_visual_state (0);
+ }
}
void
@@ -492,14 +451,15 @@ RouteUI::update_rec_display ()
if (model) {
switch (_session.record_status ()) {
- case Session::Disabled:
- case Session::Enabled:
+ case Session::Recording:
rec_enable_button->set_visual_state (1);
break;
- case Session::Recording:
+ case Session::Disabled:
+ case Session::Enabled:
rec_enable_button->set_visual_state (2);
break;
+
}
} else {