+void
+MonitorSection::map_state ()
+{
+ if (!_route || !_monitor) {
+ return;
+ }
+
+ gain_control->get_adjustment()->set_value (gain_to_slider_position (_route->gain_control()->get_value()));
+ dim_control->get_adjustment()->set_value (_monitor->dim_level());
+ solo_boost_control->get_adjustment()->set_value (_monitor->solo_boost_level());
+
+ Glib::RefPtr<Action> act;
+
+ update_solo_model ();
+
+ act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all");
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->cut_all());
+ }
+ }
+
+ act = ActionManager::get_action (X_("Monitor"), "monitor-dim-all");
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->dim_all());
+ }
+ }
+
+ act = ActionManager::get_action (X_("Monitor"), "monitor-mono");
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->mono());
+ }
+ }
+
+ uint32_t nchans = _monitor->output_streams().n_audio();
+
+ assert (nchans == _channel_buttons.size ());
+
+ for (uint32_t n = 0; n < nchans; ++n) {
+
+ char action_name[32];
+
+ snprintf (action_name, sizeof (action_name), "monitor-cut-%u", n+1);
+ act = ActionManager::get_action (X_("Monitor"), action_name);
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->cut (n));
+ }
+ }
+
+ snprintf (action_name, sizeof (action_name), "monitor-dim-%u", n+1);
+ act = ActionManager::get_action (X_("Monitor"), action_name);
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->dimmed (n));
+ }
+ }
+
+ snprintf (action_name, sizeof (action_name), "monitor-solo-%u", n+1);
+ act = ActionManager::get_action (X_("Monitor"), action_name);
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->soloed (n));
+ }
+ }
+
+ snprintf (action_name, sizeof (action_name), "monitor-invert-%u", n+1);
+ act = ActionManager::get_action (X_("Monitor"), action_name);
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact) {
+ tact->set_active (_monitor->inverted (n));
+ }
+ }
+ }
+}
+
+void
+MonitorSection::do_blink (bool onoff)
+{
+ solo_blink (onoff);
+ audition_blink (onoff);
+}
+
+void
+MonitorSection::audition_blink (bool onoff)
+{
+ if (_session == 0) {
+ return;
+ }
+
+ if (_session->is_auditioning()) {
+ if (onoff) {
+ rude_audition_button.set_state (STATE_ACTIVE);
+ } else {
+ rude_audition_button.set_state (STATE_NORMAL);
+ }
+ } else {
+ rude_audition_button.set_active (false);
+ rude_audition_button.set_state (STATE_NORMAL);
+ }
+}
+