diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-13 14:25:17 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-13 14:25:17 +0000 |
commit | d405df54ec37ef039d1044b727044e109b110ffa (patch) | |
tree | e5f2ceaf405716feb9f4c3af00554095a27de042 /gtk2_ardour | |
parent | 8e79cd5610789b377d0975640a555cc45d9300cb (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')
-rw-r--r-- | gtk2_ardour/ardour2_ui.rc | 115 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 36 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.cc | 68 | ||||
-rw-r--r-- | gtk2_ardour/utils.cc | 1 |
5 files changed, 102 insertions, 120 deletions
diff --git a/gtk2_ardour/ardour2_ui.rc b/gtk2_ardour/ardour2_ui.rc index 38ac346b8f..e53a2f9c0f 100644 --- a/gtk2_ardour/ardour2_ui.rc +++ b/gtk2_ardour/ardour2_ui.rc @@ -186,12 +186,32 @@ style "small_red_active_and_selected_button" = "small_button" style "track_rec_enable_button" = "small_button" { +} + +style "track_rec_enable_button_active" = "small_button" +{ fg[SELECTED] = { 0.0, 0.0, 0.0 } fg[ACTIVE] = { 0.0, 0.0, 0.0 } fg[PRELIGHT] = { 0.0, 0.0, 0.0 } + fg[NORMAL] = { 0.0, 0.0, 0.0 } + bg[NORMAL] = { 1.0, 0.0, 0.0 } # actively recording bg[ACTIVE] = { 1.0, 0.0, 0.0 } # actively recording + bg[SELECTED] = { 1.0, 0.0, 0.0 } # actively recording + bg[PRELIGHT] = { 1.0, 0.0, 0.0 } # actively recording +} + +style "track_rec_enable_button_alternate" = "small_button" +{ + fg[SELECTED] = { 0.0, 0.0, 0.0 } + fg[ACTIVE] = { 0.0, 0.0, 0.0 } + fg[PRELIGHT] = { 0.0, 0.0, 0.0 } + fg[NORMAL] = { 0.0, 0.0, 0.0 } + + bg[NORMAL] = { 0.91, 0.68, 0.68} # enabled, not active + bg[ACTIVE] = { 0.91, 0.68, 0.68} # enabled, not active bg[SELECTED] = { 0.91, 0.68, 0.68} # enabled, not active + bg[PRELIGHT] = { 0.91, 0.68, 0.68} # enabled, not active } style "gain_fader" @@ -209,51 +229,76 @@ style "mixer_rec_enable_button" = "track_rec_enable_button" style "solo_button" = "small_button" { - bg[PRELIGHT] = { 0, 1.0, 0 } - bg[ACTIVE] = { 0.66, 0.97, 0.19 } + # font_name = "sans 7" + # xthickness = 0 + # ythickness = 0 +} + +style "solo_button_alternate" = "small_button" +{ + # font_name = "sans 7" + # xthickness = 0 + # ythickness = 0 + + bg[NORMAL] = { 0.19, 0.97, 0.69 } # solo-safe + bg[ACTIVE] = { 0.19, 0.97, 0.69 } # solo-safe + bg[SELECTED] = { 0.19, 0.97, 0.69 } # solo-safe + bg[PRELIGHT] = { 0.19, 0.97, 0.69 } # solo-safe - fg[PRELIGHT] = { 0, 0, 0 } fg[ACTIVE] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } } -style "safe_solo_button" = "small_button" + +style "solo_button_active" = "small_button" { - bg[PRELIGHT] = { 0, 1.0, 0 } - bg[ACTIVE] = { 0.19, 0.97, 0.69 } + # font_name = "sans 7" + # xthickness = 0 + # ythickness = 0 + + bg[NORMAL] = { 0.66, 0.97, 0.19 } # solo + bg[ACTIVE] = { 0.66, 0.97, 0.19 } # solo + bg[SELECTED] = { 0.66, 0.97, 0.19 } # solo + bg[PRELIGHT] = { 0.66, 0.97, 0.19 } # solo - fg[PRELIGHT] = { 0, 0, 0 } fg[ACTIVE] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } } -style "mixer_solo_button" = "solo_button" +style "mute_button" = "small_button" { - font_name = "sans 7" - xthickness = 0 - ythickness = 0 - } -style "mixer_safe_solo_button" = "safe_solo_button" +style "mute_button_alternate" = "small_button" { - font_name = "sans 7" - xthickness = 0 - ythickness = 0 + bg[ACTIVE] = { 1.0, 0.98, 0.53 } + bg[NORMAL] = { 1.0, 0.98, 0.53 } + bg[SELECTED] = { 1.0, 0.98, 0.53 } + bg[PRELIGHT] = { 1.0, 0.98, 0.53 } + fg[SELECTED] = { 0, 0, 0 } + fg[ACTIVE] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } } - -style "mute_button" = "small_button" +style "mute_button_active" = "small_button" { - bg[PRELIGHT] = { 1.0, 0.65, 0.13 } - bg[ACTIVE] = { 1.0, 0.98, 0.53 } + bg[NORMAL] = { 0.90, 0.89, 0.73 } + bg[ACTIVE] = { 0.90, 0.89, 0.73 } + bg[PRELIGHT] = { 0.90, 0.89, 0.73 } bg[SELECTED] = { 0.90, 0.89, 0.73 } - fg[PRELIGHT] = { 0, 0, 0 } fg[SELECTED] = { 0, 0, 0 } fg[ACTIVE] = { 0, 0, 0 } + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } } - style "multiline_combo" = "small_button" { font_name = "sans 8" @@ -291,9 +336,19 @@ style "time_button" = "default_buttons_menus" style "transport_button" { +} + +style "transport_button_active" +{ + bg[NORMAL] = { 0.50, 1.0, 0.50 } bg[ACTIVE] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1, 1, 1 } - fg[PRELIGHT] = { 1, 1, 1 } + bg[SELECTED] = { 0.50, 1.0, 0.50 } + bg[PRELIGHT] = { 0.50, 1.0, 0.50 } + + fg[NORMAL] = { 0, 0, 0 } + fg[PRELIGHT] = { 0, 0, 0 } + fg[SELECTED] = { 0, 0, 0 } + fg[ACTIVE] = { 0, 0, 0 } } style "transport_rec_button" @@ -1077,16 +1132,18 @@ widget "*MixerSendSwitch*" style "very_small_red_active_and_selected_button" widget "*OptionEditorToggleButton" style "small_red_active_and_selected_button" widget "*NewSessionDialogButton" style "small_red_active_and_selected_button" widget "*RecordEnableButton" style "track_rec_enable_button" -widget "*RecordEnableButton*" style "track_rec_enable_button" +widget "*RecordEnableButton-active" style "track_rec_enable_button_active" +widget "*RecordEnableButton-alternate" style "track_rec_enable_button_alternate" widget "*MuteButton*" style "mute_button" +widget "*MuteButton-alternate*" style "mute_button_alternate" +widget "*MuteButton-active*" style "mute_button_active" widget "*TrackLoopButton*" style "track_loop_button" widget "*PanAutomationLineSelector*" style "multiline_combo" widget "*EditorTimeButton*" style "time_button" widget "*EditorMixerButton*" style "default_buttons_menus" widget "*SoloButton*" style "solo_button" -widget "*SoloButton.*" style "solo_button" -widget "*SafeSoloButton*" style "safe_solo_button" -widget "*SafeSoloButton.*" style "safe_solo_button" +widget "*SoloButton-alternate*" style "solo_button_alternate" +widget "*SoloButton-active*" style "solo_button_active" widget "*MixerPhaseInvertButton*" style "very_small_button" widget "*MixerPhaseInvertButton.*" style "very_small_button" widget "*MixerAutomationRecordingButton*" style "very_small_button" @@ -1104,7 +1161,7 @@ widget "*MixerCommentButton*" style "very_small_button" widget "*EditGroupButton" style "very_small_button" widget "*EditGroupButtonLabel" style "very_small_button" widget "*TransportButton" style "transport_button" -widget "*TransportButton*" style "transport_button" +widget "*TransportButton-active" style "transport_button_active" widget "*ShuttleButton" style "transport_button" widget "*ShuttleButton*" style "transport_button" widget "*ShuttleDisplay" style "transport_button" diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 645982a198..f233c972f2 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1489,7 +1489,7 @@ ARDOUR_UI::_blink (void *arg) void ARDOUR_UI::blink () { - Blink (blink_on = !blink_on); /* EMIT_SIGNAL */ + // Blink (blink_on = !blink_on); /* EMIT_SIGNAL */ } void diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index d3c3fc0690..63104f0034 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -223,50 +223,14 @@ ARDOUR_UI::setup_transport () rec_button.set_name ("TransportRecButton"); auto_loop_button.set_name ("TransportButton"); - vector<Gdk::Color> colors; - Gdk::Color c; - - set_color(c, rgba_from_style ("TransportButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_ACTIVE, false )); - colors.push_back (c); - auto_return_button.set_name ("TransportButton"); - auto_return_button.set_colors (colors); auto_play_button.set_name ("TransportButton"); - auto_play_button.set_colors (colors); auto_input_button.set_name ("TransportButton"); - auto_input_button.set_colors (colors); punch_in_button.set_name ("TransportButton"); - punch_in_button.set_colors (colors); punch_out_button.set_name ("TransportButton"); - punch_out_button.set_colors (colors); click_button.set_name ("TransportButton"); - click_button.set_colors (colors); time_master_button.set_name ("TransportButton"); - time_master_button.set_colors (colors); - colors.clear (); - - /* record button has 3 color states, so we set 2 extra here */ - set_color(c, rgba_from_style ("TransportRecButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_PRELIGHT, false )); - colors.push_back (c); - - set_color(c, rgba_from_style ("TransportRecButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_ACTIVE, false )); - colors.push_back (c); - - rec_button.set_colors (colors); - colors.clear (); - - /* other buttons get 2 color states, so add one here */ - set_color(c, rgba_from_style ("TransportButton", 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false )); - colors.push_back (c); - - stop_button.set_colors (colors); - roll_button.set_colors (colors); - auto_loop_button.set_colors (colors); - play_selection_button.set_colors (colors); - goto_start_button.set_colors (colors); - goto_end_button.set_colors (colors); - stop_button.set_size_request(29, -1); roll_button.set_size_request(29, -1); auto_loop_button.set_size_request(29, -1); 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 { diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 622cf62527..15cf01d85a 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -263,6 +263,7 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, s r = waverc->fg[state].red / 257; g = waverc->fg[state].green / 257; b = waverc->fg[state].blue / 257; + /* what a hack ... "a" is for "active" */ if (state == Gtk::STATE_NORMAL && rgba) { a = waverc->fg[GTK_STATE_ACTIVE].red / 257; |