summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-02-11 22:44:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-02-11 22:44:55 +0000
commit8e79cd5610789b377d0975640a555cc45d9300cb (patch)
treebc23a75849eee38e0dd14c28718f5192b9485732 /gtk2_ardour
parent60d516dad6b6aa3dad954c171486eb63b112a3c6 (diff)
This one's for oofus: optionally show solo mute status (FEATURE FREEZE my ass!)
git-svn-id: svn://localhost/ardour2/trunk@1448 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/add_route_dialog.cc2
-rw-r--r--gtk2_ardour/ardour.menus1
-rw-r--r--gtk2_ardour/ardour2_ui.rc15
-rw-r--r--gtk2_ardour/ardour_ui.h1
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc2
-rw-r--r--gtk2_ardour/ardour_ui_options.cc8
-rw-r--r--gtk2_ardour/mixer_strip.cc3
-rw-r--r--gtk2_ardour/route_time_axis.cc3
-rw-r--r--gtk2_ardour/route_ui.cc89
-rw-r--r--gtk2_ardour/route_ui.h2
10 files changed, 89 insertions, 37 deletions
diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc
index f4cc2c6d6a..448fa7ea8f 100644
--- a/gtk2_ardour/add_route_dialog.cc
+++ b/gtk2_ardour/add_route_dialog.cc
@@ -148,7 +148,7 @@ AddRouteDialog::track_type_chosen ()
if (track_button.get_active()) {
track_mode_combo.set_sensitive (true);
} else {
- track_mode_combo.set_sensitive (true);
+ track_mode_combo.set_sensitive (false);
}
}
diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus
index 0ba48a0d45..ba007e5cae 100644
--- a/gtk2_ardour/ardour.menus
+++ b/gtk2_ardour/ardour.menus
@@ -318,6 +318,7 @@
<menuitem action='LatchedSolo'/>
<menuitem action='SoloInPlace'/>
<menuitem action='SoloViaBus'/>
+ <menuitem action='ShowSoloMutes'/>
</menu>
<menu action='Crossfades'>
<menuitem action='toggle-xfades-active'/>
diff --git a/gtk2_ardour/ardour2_ui.rc b/gtk2_ardour/ardour2_ui.rc
index 62a615f190..38ac346b8f 100644
--- a/gtk2_ardour/ardour2_ui.rc
+++ b/gtk2_ardour/ardour2_ui.rc
@@ -190,9 +190,8 @@ style "track_rec_enable_button" = "small_button"
fg[ACTIVE] = { 0.0, 0.0, 0.0 }
fg[PRELIGHT] = { 0.0, 0.0, 0.0 }
- bg[SELECTED] = { 1.0, 0.0, 0.0 }
- bg[ACTIVE] = { 0.91, 0.68, 0.68}
- bg[PRELIGHT] = { 1.0, 0.0, 0.0 }
+ bg[ACTIVE] = { 1.0, 0.0, 0.0 } # actively recording
+ bg[SELECTED] = { 0.91, 0.68, 0.68} # enabled, not active
}
style "gain_fader"
@@ -247,8 +246,10 @@ style "mute_button" = "small_button"
{
bg[PRELIGHT] = { 1.0, 0.65, 0.13 }
bg[ACTIVE] = { 1.0, 0.98, 0.53 }
-
+ bg[SELECTED] = { 0.90, 0.89, 0.73 }
+
fg[PRELIGHT] = { 0, 0, 0 }
+ fg[SELECTED] = { 0, 0, 0 }
fg[ACTIVE] = { 0, 0, 0 }
}
@@ -1075,10 +1076,8 @@ widget "*NewSessionDialogButton*" style "options_window"
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 "*MixerRecordEnableButton" style "mixer_rec_enable_button"
-widget "*MixerRecordEnableButton*" style "mixer_rec_enable_button"
-widget "*TrackRecordEnableButton" style "track_rec_enable_button"
-widget "*TrackRecordEnableButton*" style "track_rec_enable_button"
+widget "*RecordEnableButton" style "track_rec_enable_button"
+widget "*RecordEnableButton*" style "track_rec_enable_button"
widget "*MuteButton*" style "mute_button"
widget "*TrackLoopButton*" style "track_loop_button"
widget "*PanAutomationLineSelector*" style "multiline_combo"
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 5d7421c4e3..4d8d82f31b 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -690,6 +690,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void toggle_StopTransportAtEndOfSession();
void toggle_GainReduceFastTransport();
void toggle_LatchedSolo();
+ void toggle_ShowSoloMutes();
void toggle_LatchedRecordEnable ();
void toggle_RegionEquivalentsOverlap ();
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index a4cd3c2d99..fa047d65d0 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -406,6 +406,8 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (option_actions, X_("LatchedSolo"), _("Latched solo"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedSolo));
ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_toggle_action (option_actions, X_("ShowSoloMutes"), _("Show solo muting"), mem_fun (*this, &ARDOUR_UI::toggle_ShowSoloMutes));
+ ActionManager::session_sensitive_actions.push_back (act);
/* !!! REMEMBER THAT RADIO ACTIONS HAVE TO BE HANDLED WITH MORE FINESSE THAN SIMPLE TOGGLES !!! */
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 5674d6dee1..fec0f83752 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -390,6 +390,12 @@ ARDOUR_UI::toggle_LatchedSolo()
}
void
+ARDOUR_UI::toggle_ShowSoloMutes()
+{
+ ActionManager::toggle_config_state ("options", "ShowSoloMutes", &Configuration::set_show_solo_mutes, &Configuration::get_show_solo_mutes);
+}
+
+void
ARDOUR_UI::mtc_port_changed ()
{
bool have_mtc;
@@ -778,6 +784,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
} else if (PARAM_IS ("solo-latched")) {
ActionManager::map_some_state ("options", "LatchedSolo", &Configuration::get_solo_latched);
+ } else if (PARAM_IS ("show-solo-mutes")) {
+ ActionManager::map_some_state ("options", "ShowSoloMutes", &Configuration::get_show_solo_mutes);
} else if (PARAM_IS ("solo-model")) {
map_solo_model ();
} else if (PARAM_IS ("auto-play")) {
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 03fb941b58..21eb495066 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -181,9 +181,8 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt
if (is_audio_track()) {
- rec_enable_button->set_name ("MixerRecordEnableButton");
- rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
+ rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
AudioTrack* at = audio_track();
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 6c4a726c0c..a86fe45887 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -142,8 +142,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
}
rec_enable_button->show_all ();
- rec_enable_button->set_name ("TrackRecordEnableButton");
+ rec_enable_button->set_name ("RecordEnableButton");
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
+ rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
}
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 249826d350..c122f666eb 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -74,6 +74,8 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
_route->active_changed.connect (mem_fun (*this, &RouteUI::route_active_changed));
mute_button = manage (new BindableToggleButton (_route->mute_control(), m_name ));
+ mute_button->set_self_managed (true);
+
solo_button = manage (new BindableToggleButton (_route->solo_control(), s_name ));
mute_button->set_name ("MuteButton");
@@ -82,7 +84,8 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
vector<Gdk::Color> colors;
Gdk::Color c;
- /* mute+solo buttons get 2 color states, so add one here to supplement the existing one */
+ ::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);
@@ -97,6 +100,10 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
_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));
+
+ /* when solo changes, update mute state too, in case the user wants us to display it */
+
+ _session.SoloChanged.connect (mem_fun(*this, &RouteUI::solo_changed_so_update_mute));
update_solo_display ();
update_mute_display ();
@@ -110,13 +117,19 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
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_("TrackRecordEnableButton"), 0xff, 0, 0, 0, "bg", Gtk::STATE_SELECTED, false ));
+ ::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_("TrackRecordEnableButton"), 0xff, 0, 0, 0, "bg", Gtk::STATE_ACTIVE, false ));
+ ::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);
@@ -322,9 +335,10 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
if (!ignore_toggle && is_track() && rec_enable_button) {
if (ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
+
// do nothing on midi bind event
- }
- else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
+
+ } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::Control|Keyboard::Shift))) {
_session.begin_reversible_command (_("rec-enable change"));
Session::GlobalRecordEnableStateCommand *cmd = new Session::GlobalRecordEnableStateCommand(_session, this);
@@ -346,16 +360,16 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
} else {
reversibly_apply_audio_track_boolean ("rec-enable change", &AudioTrack::set_record_enable, !audio_track()->record_enabled(), this);
-
- ignore_toggle = true;
- rec_enable_button->set_active(audio_track()->record_enabled());
- ignore_toggle = false;
}
-
- stop_signal (*rec_enable_button, "button-press-event");
}
- return TRUE;
+ return true;
+}
+
+bool
+RouteUI::rec_enable_release (GdkEventButton* ev)
+{
+ return true;
}
void
@@ -397,6 +411,12 @@ RouteUI::update_solo_display ()
}
void
+RouteUI::solo_changed_so_update_mute ()
+{
+ Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_mute_display));
+}
+
+void
RouteUI::mute_changed(void* src)
{
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_mute_display));
@@ -405,13 +425,38 @@ RouteUI::mute_changed(void* src)
void
RouteUI::update_mute_display ()
{
- bool x;
+ bool model = _route->record_enabled();
+ bool view = mute_button->get_active();
+
+ /* first make sure the button's "depressed" visual
+ is correct.
+ */
- if (mute_button->get_active() != (x = _route->muted())){
+ if (model != view) {
ignore_toggle = true;
- mute_button->set_active(x);
+ mute_button->set_active (model);
ignore_toggle = false;
}
+
+ /* now attend to visual state */
+
+ if (Config->get_show_solo_mutes()) {
+ if (_route->muted()) {
+ mute_button->set_visual_state (2);
+ } else if (!_route->soloed() && _route->solo_muted()) {
+
+ mute_button->set_visual_state (1);
+ } else {
+ mute_button->set_visual_state (0);
+ }
+ } else {
+ if (_route->muted()) {
+ mute_button->set_visual_state (2);
+ } else {
+ mute_button->set_visual_state (0);
+ }
+ }
+
}
void
@@ -435,7 +480,7 @@ RouteUI::update_rec_display ()
/* first make sure the button's "depressed" visual
is correct.
*/
-
+
if (model != view) {
ignore_toggle = true;
rec_enable_button->set_active (model);
@@ -449,22 +494,16 @@ RouteUI::update_rec_display ()
switch (_session.record_status ()) {
case Session::Disabled:
case Session::Enabled:
- if (rec_enable_button->get_state() != Gtk::STATE_ACTIVE) {
- rec_enable_button->set_state (Gtk::STATE_ACTIVE);
- }
+ rec_enable_button->set_visual_state (1);
break;
case Session::Recording:
- if (rec_enable_button->get_state() != Gtk::STATE_SELECTED) {
- rec_enable_button->set_state (Gtk::STATE_SELECTED);
- }
+ rec_enable_button->set_visual_state (2);
break;
}
} else {
- if (rec_enable_button->get_state() != Gtk::STATE_NORMAL) {
- rec_enable_button->set_state (Gtk::STATE_NORMAL);
- }
+ rec_enable_button->set_visual_state (0);
}
}
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index 12b04635d2..c7c7fb0944 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -92,8 +92,10 @@ class RouteUI : public virtual AxisView
bool solo_press(GdkEventButton*);
bool solo_release(GdkEventButton*);
bool rec_enable_press(GdkEventButton*);
+ bool rec_enable_release(GdkEventButton*);
void solo_changed(void*);
+ void solo_changed_so_update_mute ();
void mute_changed(void*);
virtual void redirects_changed (void *) {}
void route_rec_enable_changed();