#include "gtkmm2ext/bindable_button.h"
#include "gtkmm2ext/tearoff.h"
#include "gtkmm2ext/actions.h"
+#include "gtkmm2ext/motionfeedback.h"
#include "ardour/dB.h"
#include "ardour/monitor_processor.h"
#include "gui_thread.h"
#include "monitor_section.h"
#include "public_editor.h"
-#include "utils.h"
#include "volume_controller.h"
+#include "utils.h"
#include "i18n.h"
, dim_control (0)
, solo_boost_adjustment (1.0, 1.0, 3.0, 0.01, 0.1) // upper and lower will be reset to match model
, solo_boost_control (0)
- , solo_cut_adjustment (0.0, 0.0, 1.0, 0.01, 0.1) // upper and lower will be reset to match model
+ , solo_cut_adjustment (0.0, 0.0, 1.0, 0.01, 0.1)
, solo_cut_control (0)
, solo_in_place_button (solo_model_group, _("SiP"))
, afl_button (solo_model_group, _("AFL"))
, dim_all_button (_("dim"))
, mono_button (_("mono"))
, rude_solo_button (_("soloing"))
+ , rude_iso_button (_("isolated"))
, rude_audition_button (_("auditioning"))
- , exclusive_solo_button (_("Exclusive solo"))
+ , exclusive_solo_button (_("Exclusive"))
+ , solo_mute_override_button (_("Solo/Mute"))
{
Glib::RefPtr<Action> act;
/* Dim */
- dim_control = new VolumeController (little_knob_pixbuf, &dim_adjustment, false, 30, 30);
+ dim_control = new VolumeController (little_knob_pixbuf, &dim_adjustment, false, 30, 30);
HBox* dim_packer = manage (new HBox);
dim_packer->show ();
rude_solo_button.set_name ("TransportSoloAlert");
rude_solo_button.show ();
+ rude_iso_button.set_name ("MonitorIsoAlert");
+ rude_iso_button.show ();
+
rude_audition_button.set_name ("TransportAuditioningAlert");
rude_audition_button.show ();
rude_solo_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_solo), false);
UI::instance()->set_tip (rude_solo_button, _("When active, something is soloed.\nClick to de-solo everything"));
+ rude_iso_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_isolate), false);
+ UI::instance()->set_tip (rude_iso_button, _("When active, something is solo-isolated.\nClick to de-isolate everything"));
+
rude_audition_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_audition), false);
UI::instance()->set_tip (rude_audition_button, _("When active, auditioning is active.\nClick to stop the audition"));
act->connect_proxy (pfl_button);
}
-
/* Solo Boost */
solo_boost_control = new VolumeController (little_knob_pixbuf, &solo_boost_adjustment, false, 30, 30);
solo_packer->pack_start (*spin_packer, true, true);
- exclusive_solo_button.set_name (X_("MonitorCutButton"));
+ exclusive_solo_button.set_name (X_("MonitorOptButton"));
+ ARDOUR_UI::instance()->set_tip (&exclusive_solo_button, _("Exclusive solo means that only 1 solo is active at a time"));
+
+ act = ActionManager::get_action (X_("Monitor"), X_("toggle-exclusive-solo"));
+ if (act) {
+ act->connect_proxy (exclusive_solo_button);
+ }
+
+ solo_mute_override_button.set_name (X_("MonitorOptButton"));
+ ARDOUR_UI::instance()->set_tip (&solo_mute_override_button, _("If enabled, solo will override mute\n(a soloed & muted track or bus will be audible)"));
+
+ act = ActionManager::get_action (X_("Monitor"), X_("toggle-mute-overrides-solo"));
+ if (act) {
+ act->connect_proxy (solo_mute_override_button);
+ }
+ HBox* solo_opt_box = manage (new HBox);
+ solo_opt_box->set_spacing (12);
+ solo_opt_box->set_homogeneous (true);
+ solo_opt_box->pack_start (exclusive_solo_button);
+ solo_opt_box->pack_start (solo_mute_override_button);
+ solo_opt_box->show ();
+
upper_packer.set_spacing (12);
- upper_packer.pack_start (rude_solo_button, false, false);
+
+ Gtk::HBox* rude_box = manage (new HBox);
+ rude_box->pack_start (rude_solo_button, true, true);
+ rude_box->pack_start (rude_iso_button, true, true);
+
+ upper_packer.pack_start (*rude_box, false, false);
upper_packer.pack_start (rude_audition_button, false, false);
upper_packer.pack_start (solo_model_box, false, false);
- upper_packer.pack_start (exclusive_solo_button, false, false);
+ upper_packer.pack_start (*solo_opt_box, false, false);
upper_packer.pack_start (*solo_packer, false, false);
act = ActionManager::get_action (X_("Monitor"), X_("monitor-cut-all"));
/* Gain */
- gain_control = new VolumeController (big_knob_pixbuf, &gain_adjustment, false, 80, 80);
+ gain_control = new VolumeController (big_knob_pixbuf, &gain_adjustment, false, 80, 80);
spin_label = manage (new Label (_("Gain")));
spin_packer = manage (new VBox);
_route = _session->monitor_out ();
if (_route) {
- /* session with control outs */
+ /* session with monitor section */
_monitor = _route->monitor_control ();
assign_controllables ();
} else {
- /* session with no control outs */
+ /* session with no monitor section */
_monitor.reset ();
_route.reset ();
}
-
} else {
/* no session */
+
_monitor.reset ();
_route.reset ();
control_connections.drop_connections ();
- }
+ rude_iso_button.set_active (false);
+ rude_solo_button.set_active (false);
- /* both might be null */
+ assign_controllables ();
+ }
}
MonitorSection::ChannelButtonSet::ChannelButtonSet ()
solo_button_label.set_text ("rec");
}
+void
+MonitorSection::toggle_exclusive_solo ()
+{
+ if (!_monitor) {
+ return;
+ }
+
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "toggle-exclusive-solo");
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+ Config->set_exclusive_solo (tact->get_active());
+ }
+
+}
+
+
+void
+MonitorSection::toggle_mute_overrides_solo ()
+{
+ if (!_monitor) {
+ return;
+ }
+
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "toggle-mute-overrides-solo");
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+ Config->set_solo_mute_override (tact->get_active());
+ }
+}
+
void
MonitorSection::dim_all ()
{
{
string action_name;
string action_descr;
+ Glib::RefPtr<Action> act;
monitor_actions = ActionGroup::create (X_("Monitor"));
ActionManager::add_action_group (monitor_actions);
ActionManager::register_toggle_action (monitor_actions, "monitor-dim-all", "",
sigc::mem_fun (*this, &MonitorSection::dim_all));
+ act = ActionManager::register_toggle_action (monitor_actions, "toggle-exclusive-solo", "",
+ sigc::mem_fun (*this, &MonitorSection::toggle_exclusive_solo));
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+ tact->set_active (Config->get_exclusive_solo());
+
+ act = ActionManager::register_toggle_action (monitor_actions, "toggle-mute-overrides-solo", "",
+ sigc::mem_fun (*this, &MonitorSection::toggle_mute_overrides_solo));
+
+ tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+ tact->set_active (Config->get_solo_mute_override());
+
+
/* note the 1-based counting (for naming - backend uses 0-based) */
for (uint32_t chn = 1; chn <= 16; ++chn) {
{
try {
- big_knob_pixbuf = ::get_icon ("bigknob");
-
+ big_knob_pixbuf = MotionFeedback::render_pixbuf (80);
+
} catch (...) {
- error << "No knob image found (or not loadable) at "
- << " .... "
- << endmsg;
+ error << "No usable large knob image" << endmsg;
+ throw failed_constructor ();
+ }
+
+ if (!big_knob_pixbuf) {
+ error << "No usable large knob image" << endmsg;
throw failed_constructor ();
}
try {
-
- little_knob_pixbuf = ::get_icon ("littleknob");
+
+ little_knob_pixbuf = MotionFeedback::render_pixbuf (30);
} catch (...) {
- error << "No knob image found (or not loadable) at "
- << " .... "
- << endmsg;
+ error << "No usable small knob image" << endmsg;
+ throw failed_constructor ();
+ }
+
+ if (!little_knob_pixbuf) {
+ error << "No usable small knob image" << endmsg;
throw failed_constructor ();
}
+
}
bool
if (act) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact) {
- cerr << "Set monitor cut all action to " << _monitor->cut_all () << endl;
tact->set_active (_monitor->cut_all());
- } else {
- cerr << " no global cut action\n";
}
- } else {
- cerr << " no global cut action2\n";
}
act = ActionManager::get_action (X_("Monitor"), "monitor-dim-all");
} else {
rude_solo_button.set_state (STATE_NORMAL);
}
+
+ if (_session->soloing()) {
+ rude_iso_button.set_active (_session->solo_isolated());
+ }
+
} else {
// rude_solo_button.set_active (false);
rude_solo_button.set_state (STATE_NORMAL);
+ rude_iso_button.set_active (false);
}
}
bool
-MonitorSection::cancel_solo (GdkEventButton* ev)
+MonitorSection::cancel_solo (GdkEventButton*)
{
if (_session) {
if (_session->soloing()) {
}
bool
-MonitorSection::cancel_audition (GdkEventButton* ev)
+MonitorSection::cancel_isolate (GdkEventButton*)
+{
+ if (_session) {
+ boost::shared_ptr<RouteList> rl (_session->get_routes ());
+ _session->set_solo_isolated (rl, false, Session::rt_cleanup, true);
+ }
+
+ return true;
+}
+
+bool
+MonitorSection::cancel_audition (GdkEventButton*)
{
if (_session) {
_session->cancel_audition();
return;
}
+ if (_session) {
+ boost::shared_ptr<Controllable> c = _session->solo_cut_control();
+ solo_cut_control->set_controllable (c);
+ solo_cut_control->get_adjustment()->set_value (c->get_value());
+ } else {
+ solo_cut_control->set_controllable (none);
+ }
+
if (_route) {
gain_control->set_controllable (_route->gain_control());
- control_link (control_connections, _route->gain_control(), gain_adjustment);
} else {
gain_control->set_controllable (none);
}
dim_control->set_controllable (c);
dim_adjustment.set_lower (c->lower());
dim_adjustment.set_upper (c->upper());
- control_link (control_connections, c, dim_adjustment);
c = _monitor->solo_boost_control ();
solo_boost_control->set_controllable (c);
solo_boost_adjustment.set_lower (c->lower());
solo_boost_adjustment.set_upper (c->upper());
- control_link (control_connections, c, solo_boost_adjustment);
} else {