, no_track_list_redisplay (false)
, in_group_row_change (false)
, track_menu (0)
- , _monitor_section (0)
, _plugin_selector (0)
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
, _spill_scroll_position (0)
favorite_plugins_display.show();
add_button.show ();
+ XMLNode* mnode = ARDOUR_UI::instance()->tearoff_settings (X_("monitor-section"));
+ if (mnode) {
+ _monitor_section.tearoff().set_state (*mnode);
+ }
+
MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());
VCAMasterStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_master, this, _1), gui_context());
Mixer_UI::~Mixer_UI ()
{
- if (_monitor_section) {
- monitor_section_detached ();
- delete _monitor_section;
- }
+ monitor_section_detached ();
+
delete _plugin_selector;
delete track_menu;
}
if (route->is_monitor()) {
- if (!_monitor_section) {
- _monitor_section = new MonitorSection (_session);
-
- XMLNode* mnode = ARDOUR_UI::instance()->tearoff_settings (X_("monitor-section"));
- if (mnode) {
- _monitor_section->tearoff().set_state (*mnode);
- }
-
- set_monitor_action_sensitivity(true);
- }
-
- out_packer.pack_end (_monitor_section->tearoff(), false, false);
- _monitor_section->set_session (_session);
- _monitor_section->tearoff().show_all ();
+ out_packer.pack_end (_monitor_section.tearoff(), false, false);
+ _monitor_section.set_session (_session);
+ _monitor_section.tearoff().show_all ();
- _monitor_section->tearoff().Detach.connect (sigc::mem_fun(*this, &Mixer_UI::monitor_section_detached));
- _monitor_section->tearoff().Attach.connect (sigc::mem_fun(*this, &Mixer_UI::monitor_section_attached));
+ _monitor_section.tearoff().Detach.connect (sigc::mem_fun(*this, &Mixer_UI::monitor_section_detached));
+ _monitor_section.tearoff().Attach.connect (sigc::mem_fun(*this, &Mixer_UI::monitor_section_attached));
- if (_monitor_section->tearoff().torn_off()) {
+ if (_monitor_section.tearoff().torn_off()) {
monitor_section_detached ();
} else {
monitor_section_attached ();
Mixer_UI::set_session (Session* sess)
{
SessionHandlePtr::set_session (sess);
+ _monitor_section.set_session (sess);
if (_plugin_selector) {
_plugin_selector->set_session (_session);
_group_tabs->set_session (sess);
- if (_monitor_section) {
- _monitor_section->set_session (_session);
- }
-
if (!_session) {
_selection.clear ();
return;
delete (*i);
}
- if (_monitor_section) {
- _monitor_section->tearoff().hide_visible ();
- }
+ _monitor_section.tearoff().hide_visible ();
monitor_section_detached ();
//show/hide the channelstrip VCA assign buttons on channelstrips:
UIConfiguration::instance().set_mixer_strip_visibility (VisibilityGroup::add_element (UIConfiguration::instance().get_mixer_strip_visibility(), X_("VCA")));
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleVCAPane");
- assert (act);
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleVCAPane");
act->set_sensitive (true);
//if we were showing VCAs before, show them now:
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact);
- showhide_vcas ( tact->get_active () );
+ showhide_vcas (act->get_active ());
}
_group_tabs->set_dirty ();
void
Mixer_UI::toggle_mixer_list ()
{
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMixerList");
- if (act) {
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- showhide_mixer_list (tact->get_active());
- }
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleMixerList");
+ showhide_mixer_list (act->get_active());
}
void
void
Mixer_UI::toggle_monitor_section ()
{
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMonitorSection");
- if (act) {
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- showhide_monitor_section (tact->get_active());
- }
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleMonitorSection");
+ showhide_monitor_section (act->get_active());
}
void
Mixer_UI::showhide_monitor_section (bool yn)
{
- if (!monitor_section()) {
- return;
- }
- if (monitor_section()->tearoff().torn_off()) {
+ if (monitor_section().tearoff().torn_off()) {
return;
}
if (yn) {
- monitor_section()->tearoff().show();
+ monitor_section().tearoff().show();
} else {
- monitor_section()->tearoff().hide();
+ monitor_section().tearoff().hide();
}
}
void
Mixer_UI::toggle_vcas ()
{
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleVCAPane");
- if (act) {
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- showhide_vcas (tact->get_active());
- }
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleVCAPane");
+ showhide_vcas (act->get_active());
}
void
void
Mixer_UI::toggle_mixbuses ()
{
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMixbusPane");
- if (act) {
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- showhide_mixbuses (tact->get_active());
- }
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleMixbusPane");
+ showhide_mixbuses (act->get_active());
}
void
node.get_property ("show-mixer", _visible);
if (node.get_property ("maximised", yn)) {
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleMaximalMixer"));
- assert (act);
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- bool fs = tact && tact->get_active();
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Common"), X_("ToggleMaximalMixer"));
+ bool fs = act && act->get_active();
if (yn ^ fs) {
ActionManager::do_action ("Common", "ToggleMaximalMixer");
}
}
if (node.get_property ("show-mixer-list", yn)) {
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Mixer"), X_("ToggleMixerList"));
- assert (act);
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact);
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMixerList"));
/* do it twice to force the change */
- tact->set_active (!yn);
- tact->set_active (yn);
+ act->set_active (!yn);
+ act->set_active (yn);
}
if (node.get_property ("monitor-section-visible", yn)) {
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Mixer"), X_("ToggleMonitorSection"));
- assert (act);
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact);
-
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMonitorSection"));
/* do it twice to force the change */
- tact->set_active (!yn);
- tact->set_active (yn);
+ act->set_active (!yn);
+ act->set_active (yn);
}
if (node.get_property ("show-vca-pane", yn)) {
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Mixer"), X_("ToggleVCAPane"));
- assert (act);
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact);
-
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleVCAPane"));
/* do it twice to force the change */
- tact->set_active (!yn);
- tact->set_active (yn);
+ act->set_active (!yn);
+ act->set_active (yn);
}
#ifdef MIXBUS
if (node.get_property ("show-mixbus-pane", yn)) {
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Mixer"), X_("ToggleMixbusPane"));
- assert (act);
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact);
-
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMixbusPane"));
/* do it twice to force the change */
- tact->set_active (!yn);
- tact->set_active (yn);
+ act->set_active (!yn);
+ act->set_active (yn);
}
#endif
node->set_property ("show-mixer", _visible);
node->set_property ("maximised", _maximised);
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMixerList");
- assert (act); Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact); node->set_property ("show-mixer-list", tact->get_active ());
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleMixerList");
+ node->set_property ("show-mixer-list", act->get_active ());
- act = ActionManager::get_action ("Mixer", "ToggleMonitorSection");
- assert (act); tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact); node->set_property ("monitor-section-visible", tact->get_active ());
+ act = ActionManager::get_toggle_action ("Mixer", "ToggleMonitorSection");
+ node->set_property ("monitor-section-visible", act->get_active ());
- act = ActionManager::get_action ("Mixer", "ToggleVCAPane");
- assert (act); tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact); node->set_property ("show-vca-pane", tact->get_active ());
+ act = ActionManager::get_toggle_action ("Mixer", "ToggleVCAPane");
+ node->set_property ("show-vca-pane", act->get_active ());
#ifdef MIXBUS
- act = ActionManager::get_action ("Mixer", "ToggleMixbusPane");
- assert (act); tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact); node->set_property ("show-mixbus-pane", tact->get_active ());
+ act = ActionManager::get_toggle_action ("Mixer", "ToggleMixbusPane");
+ node->set_property ("show-mixbus-pane", act->get_active ());
#endif
return *node;
}
void
-Mixer_UI::set_monitor_action_sensitivity (bool yn)
+Mixer_UI::monitor_section_going_away ()
{
- // TODO use ActionMap::find_toggle_action()->set_*();
- Glib::RefPtr<Action> act;
- Glib::RefPtr<ToggleAction> tact;
+ XMLNode* ui_node = Config->extra_xml(X_("UI"));
- act = ActionManager::get_action (X_("Monitor"), "UseMonitorSection");
- tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
- tact->set_active (yn);
-
- act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all");
- tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
- tact->set_sensitive (yn);
-
- act = ActionManager::get_action (X_("Monitor"), "monitor-dim-all");
- tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
- tact->set_sensitive (yn);
-
- act = ActionManager::get_action (X_("Monitor"), "monitor-mono");
- tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
- tact->set_sensitive (yn);
-}
+ /* immediate state save.
+ *
+ * Tearoff settings are otherwise only stored during
+ * save_ardour_state(). The mon-section may or may not
+ * exist at that point.
+ */
-void
-Mixer_UI::monitor_section_going_away ()
-{
- /* Set sensitivity based on existence of the monitor bus */
-
- set_monitor_action_sensitivity(false);
-
- if (_monitor_section) {
-
- XMLNode* ui_node = Config->extra_xml(X_("UI"));
- /* immediate state save.
- *
- * Tearoff settings are otherwise only stored during
- * save_ardour_state(). The mon-section may or may not
- * exist at that point.
- * */
- if (ui_node) {
- XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
- if (tearoff_node) {
- tearoff_node->remove_nodes_and_delete (X_("monitor-section"));
- XMLNode* t = new XMLNode (X_("monitor-section"));
- _monitor_section->tearoff().add_state (*t);
- tearoff_node->add_child_nocopy (*t);
- }
+ if (ui_node) {
+ XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
+ if (tearoff_node) {
+ tearoff_node->remove_nodes_and_delete (X_("monitor-section"));
+ XMLNode* t = new XMLNode (X_("monitor-section"));
+ _monitor_section.tearoff().add_state (*t);
+ tearoff_node->add_child_nocopy (*t);
}
- monitor_section_detached ();
- out_packer.remove (_monitor_section->tearoff());
- _monitor_section->set_session (0);
}
+
+ monitor_section_detached ();
+ out_packer.remove (_monitor_section.tearoff());
}
void
void
Mixer_UI::monitor_section_attached ()
{
- Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMonitorSection");
- assert (act); act->set_sensitive (true);
-
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- assert (tact);
- showhide_monitor_section ( tact->get_active () );
+ Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleMonitorSection");
+ act->set_sensitive (true);
+ showhide_monitor_section (act->get_active ());
}
void
ActionManager::register_toggle_action (group, X_("ToggleVCAPane"), _("Mixer: Show VCAs"), sigc::mem_fun (*this, &Mixer_UI::toggle_vcas));
#ifdef MIXBUS
- ActionManager::register_toggle_action (group, X_("ToggleMixbusPane"), _("Mixer: Show Mixbuses"), sigc::mem_fun (*this, &Mixer_UI::toggle_mixbus_pane));
+ ActionManager::register_toggle_action (group, X_("ToggleMixbusPane"), _("Mixer: Show Mixbuses"), sigc::mem_fun (*this, &Mixer_UI::toggle_mixbuses));
#endif
ActionManager::register_toggle_action (group, X_("ToggleMonitorSection"), _("Mixer: Show Monitor Section"), sigc::mem_fun (*this, &Mixer_UI::toggle_monitor_section));