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
This commit is contained in:
parent
60d516dad6
commit
8e79cd5610
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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'/>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
|
|
|
@ -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 !!! */
|
||||
|
||||
|
|
|
@ -389,6 +389,12 @@ ARDOUR_UI::toggle_LatchedSolo()
|
|||
ActionManager::toggle_config_state ("options", "LatchedSolo", &Configuration::set_solo_latched, &Configuration::get_solo_latched);
|
||||
}
|
||||
|
||||
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 ()
|
||||
{
|
||||
|
@ -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")) {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -396,6 +410,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)
|
||||
{
|
||||
|
@ -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();
|
||||
|
||||
if (mute_button->get_active() != (x = _route->muted())){
|
||||
/* first make sure the button's "depressed" visual
|
||||
is correct.
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -62,6 +62,7 @@ CONFIG_VARIABLE (SoloModel, solo_model, "solo-model", InverseMute)
|
|||
CONFIG_VARIABLE (bool, solo_latched, "solo-latched", true)
|
||||
CONFIG_VARIABLE (bool, latched_record_enable, "latched-record-enable", false)
|
||||
CONFIG_VARIABLE (bool, all_safe, "all-safe", false)
|
||||
CONFIG_VARIABLE (bool, show_solo_mutes, "show-solo-mutes", false)
|
||||
|
||||
/* click */
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ class Route : public IO
|
|||
|
||||
void set_mute (bool yn, void *src);
|
||||
bool muted() const { return _muted; }
|
||||
bool solo_muted() const { return desired_solo_gain == 0.0; }
|
||||
|
||||
void set_mute_config (mute_type, bool, void *src);
|
||||
bool get_mute_config (mute_type);
|
||||
|
@ -256,7 +257,6 @@ class Route : public IO
|
|||
|
||||
bool _muted : 1;
|
||||
bool _soloed : 1;
|
||||
bool _solo_muted : 1;
|
||||
bool _solo_safe : 1;
|
||||
bool _phase_invert : 1;
|
||||
bool _recordable : 1;
|
||||
|
|
|
@ -663,6 +663,7 @@ class Session : public PBD::StatefulDestructible
|
|||
void set_all_mute (bool);
|
||||
|
||||
sigc::signal<void,bool> SoloActive;
|
||||
sigc::signal<void> SoloChanged;
|
||||
|
||||
void record_disenable_all ();
|
||||
void record_enable_all ();
|
||||
|
|
|
@ -2125,9 +2125,11 @@ Session::route_solo_changed (void* src, boost::weak_ptr<Route> wpr)
|
|||
modify_solo_mute (is_track, same_thing_soloed);
|
||||
|
||||
if (signal) {
|
||||
SoloActive (currently_soloing);
|
||||
SoloActive (currently_soloing); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
SoloChanged (); /* EMIT SIGNAL */
|
||||
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,13 +36,15 @@ class StateButton
|
|||
void set_colors (const std::vector<Gdk::Color>& colors);
|
||||
void set_visual_state (int);
|
||||
int get_visual_state () { return visual_state; }
|
||||
void set_self_managed (bool yn) { _self_managed = yn; }
|
||||
|
||||
protected:
|
||||
std::vector<Gdk::Color> colors;
|
||||
int visual_state;
|
||||
Gdk::Color saved_bg;
|
||||
bool have_saved_bg;
|
||||
|
||||
bool _self_managed;
|
||||
|
||||
virtual void bg_modify (Gtk::StateType, Gdk::Color) = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -95,10 +95,11 @@ StatefulButton::on_realize ()
|
|||
void
|
||||
StatefulToggleButton::on_toggled ()
|
||||
{
|
||||
if (get_active()) {
|
||||
set_visual_state (1);
|
||||
} else {
|
||||
set_visual_state (0);
|
||||
if (!_self_managed) {
|
||||
if (get_active()) {
|
||||
set_visual_state (1);
|
||||
} else {
|
||||
set_visual_state (0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user