X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmixer_ui.cc;h=37286e8e586660011270d877453df5ba72672870;hb=29eac8ee4e813b8e0d48ea04135e7e6ab45af070;hp=23bc8c52db523f073344e8669ca1f8320abb51db;hpb=c70aee50e0c48dd1fa63338bb3b6f1193495e79c;p=ardour.git diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 23bc8c52db..37286e8e58 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -106,13 +106,12 @@ Mixer_UI::Mixer_UI () , _monitor_section (0) , _plugin_selector (0) , _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide) + , _spill_scroll_position (0) , ignore_reorder (false) , _in_group_rebuild_or_clear (false) , _route_deletion_in_progress (false) , _maximised (false) - , _show_mixer_list (true) , _strip_selection_change_without_scroll (false) - , myactions (X_("mixer")) , _selection (*this, *this) { register_actions (); @@ -135,17 +134,31 @@ Mixer_UI::Mixer_UI () scroller_base.drag_dest_set (target_table); scroller_base.signal_drag_data_received().connect (sigc::mem_fun(*this, &Mixer_UI::scroller_drag_data_received)); - //create a button to add mixer strips ( replaces the old buttons in the mixer list ) - Button* add_button = manage (new Button); - add_button->show (); + /* create a button to add VCA strips ... will get packed in redisplay_track_list() */ Widget* w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON)); w->show (); - add_button->add (*w); - add_button->signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_track_or_bus)); + add_vca_button.add (*w); + add_vca_button.set_can_focus(false); + add_vca_button.signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_track_or_bus)); - // add as last item of strip packer + /* create a button to add mixer strips */ + w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON)); + w->show (); + add_button.add (*w); + add_button.set_can_focus(false); + add_button.signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_track_or_bus)); + + /* add as last item of strip packer */ strip_packer.pack_end (scroller_base, true, true); - strip_packer.pack_end (*add_button, false, false); + strip_packer.pack_end (add_button, false, false); + +#ifdef MIXBUS + /* create a drop-shadow at the end of the mixer strips */ + mb_shadow.set_size_request( 4, -1 ); + mb_shadow.set_name("EditorWindow"); + mb_shadow.show(); + strip_packer.pack_end (mb_shadow, false, false); +#endif _group_tabs = new MixerGroupTabs (this); VBox* b = manage (new VBox); @@ -216,7 +229,6 @@ Mixer_UI::Mixer_UI () favorite_plugins_display.set_headers_visible (true); favorite_plugins_display.set_rules_hint (true); favorite_plugins_display.set_can_focus (false); - favorite_plugins_display.set_tooltip_column (0); favorite_plugins_display.add_object_drag (favorite_plugins_columns.plugin.index(), "PluginFavoritePtr"); favorite_plugins_display.set_drag_column (favorite_plugins_columns.name.index()); favorite_plugins_display.add_drop_targets (target_list); @@ -225,6 +237,9 @@ Mixer_UI::Mixer_UI () favorite_plugins_display.signal_drop.connect (sigc::mem_fun (*this, &Mixer_UI::plugin_drop)); favorite_plugins_display.signal_row_expanded().connect (sigc::mem_fun (*this, &Mixer_UI::save_favorite_ui_state)); favorite_plugins_display.signal_row_collapsed().connect (sigc::mem_fun (*this, &Mixer_UI::save_favorite_ui_state)); + if (UIConfiguration::instance().get_use_tooltips()) { + favorite_plugins_display.set_tooltip_column (0); + } favorite_plugins_model->signal_row_has_child_toggled().connect (sigc::mem_fun (*this, &Mixer_UI::sync_treeview_favorite_ui_state)); favorite_plugins_scroller.add (favorite_plugins_display); @@ -268,7 +283,7 @@ Mixer_UI::Mixer_UI () list_hpane.set_check_divider_position (true); list_hpane.add (list_vpacker); list_hpane.add (global_hpacker); - list_hpane.set_child_minsize (list_vpacker, 1); + list_hpane.set_child_minsize (list_vpacker, 30); XMLNode const * settings = ARDOUR_UI::instance()->mixer_settings(); float fract; @@ -312,7 +327,6 @@ Mixer_UI::Mixer_UI () mixer_scroller_vpacker.show(); list_vpacker.show(); group_display_button_label.show(); - group_display_button.show(); group_display_scroller.show(); favorite_plugins_scroller.show(); group_display_vbox.show(); @@ -332,6 +346,7 @@ Mixer_UI::Mixer_UI () list_hpane.show(); group_display.show(); favorite_plugins_display.show(); + add_button.show (); 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()); @@ -347,6 +362,7 @@ Mixer_UI::Mixer_UI () #endif PluginManager::instance ().PluginListChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::plugin_list_changed, this), gui_context()); + PluginManager::instance ().PluginStatusChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::plugin_list_changed, this), gui_context()); ARDOUR::Plugin::PresetsChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::refill_favorite_plugins, this), gui_context()); } @@ -360,6 +376,16 @@ Mixer_UI::~Mixer_UI () delete track_menu; } +struct MixerStripSorter { + bool operator() (const MixerStrip* ms_a, const MixerStrip* ms_b) + { + boost::shared_ptr const& a = ms_a->stripable (); + boost::shared_ptr const& b = ms_b->stripable (); + return ARDOUR::Stripable::Sorter(true)(a, b); + } +}; + + void Mixer_UI::escape () { @@ -544,6 +570,8 @@ Mixer_UI::add_stripables (StripableList& slist) if (mnode) { _monitor_section->tearoff().set_state (*mnode); } + + set_monitor_action_sensitivity(true); } out_packer.pack_end (_monitor_section->tearoff(), false, false); @@ -577,7 +605,12 @@ Mixer_UI::add_stripables (StripableList& slist) show_strip (strip); - if (!route->is_master()) { + if (route->is_master()) { + + out_packer.pack_start (*strip, false, false); + strip->set_packed (true); + + } else { TreeModel::Row row = *(track_model->insert (insert_iter)); @@ -585,11 +618,6 @@ Mixer_UI::add_stripables (StripableList& slist) row[stripable_columns.visible] = strip->marked_for_display(); row[stripable_columns.stripable] = route; row[stripable_columns.strip] = strip; - - } else { - - out_packer.pack_start (*strip, false, false); - strip->set_packed (true); } strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed)); @@ -625,16 +653,24 @@ Mixer_UI::deselect_all_strip_processors () } void -Mixer_UI::select_all_tracks () +Mixer_UI::select_none () { - PublicEditor::instance().select_all_tracks (); + _selection.clear_routes(); + deselect_all_strip_processors(); } void -Mixer_UI::select_none () +Mixer_UI::select_next_strip () { - _selection.clear_routes(); deselect_all_strip_processors(); + _session->selection().select_next_stripable (true, false); +} + +void +Mixer_UI::select_prev_strip () +{ + deselect_all_strip_processors(); + _session->selection().select_prev_stripable (true, false); } void @@ -897,15 +933,6 @@ Mixer_UI::axis_view_by_control (boost::shared_ptr c) const return 0; } -struct MixerStripSorter { - bool operator() (const MixerStrip* ms_a, const MixerStrip* ms_b) - { - boost::shared_ptr const& a = ms_a->stripable (); - boost::shared_ptr const& b = ms_b->stripable (); - return ARDOUR::Stripable::Sorter(true)(a, b); - } -}; - bool Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip) { @@ -1426,6 +1453,9 @@ Mixer_UI::redisplay_track_list () if (ss) { boost::shared_ptr sv = boost::dynamic_pointer_cast (ss); if (sv) { + if (_spill_scroll_position <= 0 && scroller.get_hscrollbar()) { + _spill_scroll_position = scroller.get_hscrollbar()->get_adjustment()->get_value(); + } spill_redisplay (sv); return; } @@ -1437,19 +1467,12 @@ Mixer_UI::redisplay_track_list () container_clear (vca_hpacker); - //create a button to add mixer strips ( replaces the old buttons in the mixer list ) - Button* add_vca_button = manage (new Button); - Widget* w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON)); - w->show (); - add_vca_button->add (*w); - add_vca_button->signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_track_or_bus)); - vca_hpacker.pack_end (vca_scroller_base, true, true); - vca_hpacker.pack_end (*add_vca_button, false, false); + vca_hpacker.pack_end (add_vca_button, false, false); - add_vca_button->show (); + add_vca_button.show (); vca_scroller_base.show(); - + for (i = rows.begin(); i != rows.end(); ++i) { AxisView* s = (*i)[stripable_columns.strip]; @@ -1503,14 +1526,38 @@ Mixer_UI::redisplay_track_list () /* update visibility of VCA assign buttons */ if (n_masters == 0) { + //show/hide the channelstrip VCA assign buttons on channelstrips: UIConfiguration::instance().set_mixer_strip_visibility (VisibilityGroup::remove_element (UIConfiguration::instance().get_mixer_strip_visibility(), X_("VCA"))); + + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleVCAPane"); + if (act) { + act->set_sensitive (false); + } + + //remove the VCA packer, but don't change our prior setting for show/hide: vca_vpacker.hide (); } else { + //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"))); - vca_vpacker.show (); + + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleVCAPane"); + assert (act); + act->set_sensitive (true); + + //if we were showing VCAs before, show them now: + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); + showhide_vcas ( tact->get_active () ); } _group_tabs->set_dirty (); + + if (_spill_scroll_position > 0 && scroller.get_hscrollbar()) { + Adjustment* adj = scroller.get_hscrollbar()->get_adjustment(); + adj->set_value (max (adj->get_lower(), min (adj->get_upper(), _spill_scroll_position))); + } + _spill_scroll_position = 0; + } void @@ -1559,18 +1606,7 @@ void Mixer_UI::initial_track_display () { StripableList sl; - - boost::shared_ptr routes = _session->get_routes(); - - for (RouteList::iterator r = routes->begin(); r != routes->end(); ++r) { - sl.push_back (*r); - } - - VCAList vcas = _session->vca_manager().vcas(); - - for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) { - sl.push_back (boost::dynamic_pointer_cast (*v)); - } + _session->get_stripables (sl); sl.sort (PresentationInfoMixerSorter()); @@ -1668,10 +1704,10 @@ Mixer_UI::build_track_menu () items.push_back (MenuElem (_("Hide All"), sigc::mem_fun(*this, &Mixer_UI::hide_all_routes))); items.push_back (MenuElem (_("Show All Audio Tracks"), sigc::mem_fun(*this, &Mixer_UI::show_all_audiotracks))); items.push_back (MenuElem (_("Hide All Audio Tracks"), sigc::mem_fun(*this, &Mixer_UI::hide_all_audiotracks))); - items.push_back (MenuElem (_("Show All Audio Busses"), sigc::mem_fun(*this, &Mixer_UI::show_all_audiobus))); - items.push_back (MenuElem (_("Hide All Audio Busses"), sigc::mem_fun(*this, &Mixer_UI::hide_all_audiobus))); items.push_back (MenuElem (_("Show All Midi Tracks"), sigc::mem_fun (*this, &Mixer_UI::show_all_miditracks))); items.push_back (MenuElem (_("Hide All Midi Tracks"), sigc::mem_fun (*this, &Mixer_UI::hide_all_miditracks))); + items.push_back (MenuElem (_("Show All Busses"), sigc::mem_fun(*this, &Mixer_UI::show_all_audiobus))); + items.push_back (MenuElem (_("Hide All Busses"), sigc::mem_fun(*this, &Mixer_UI::hide_all_audiobus))); } @@ -1902,19 +1938,38 @@ Mixer_UI::route_group_property_changed (RouteGroup* group, const PropertyChange& } void -Mixer_UI::show_mixer_list (bool yn) +Mixer_UI::toggle_mixer_list () +{ + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleMixerList"); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + showhide_mixer_list (tact->get_active()); + } +} + +void +Mixer_UI::showhide_mixer_list (bool yn) { if (yn) { list_vpacker.show (); } else { list_vpacker.hide (); } +} - _show_mixer_list = yn; +void +Mixer_UI::toggle_monitor_section () +{ + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleMonitorSection"); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + showhide_monitor_section (tact->get_active()); + } } + void -Mixer_UI::show_monitor_section (bool yn) +Mixer_UI::showhide_monitor_section (bool yn) { if (!monitor_section()) { return; @@ -1930,6 +1985,49 @@ Mixer_UI::show_monitor_section (bool yn) } } +void +Mixer_UI::toggle_vcas () +{ + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleVCAPane"); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + showhide_vcas (tact->get_active()); + } +} + +void +Mixer_UI::showhide_vcas (bool yn) +{ + if (yn) { + vca_vpacker.show(); + } else { + vca_vpacker.hide(); + } +} + +#ifdef MIXBUS +void +Mixer_UI::toggle_mixbuses () +{ + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleMixbusPane"); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + showhide_mixbuses (tact->get_active()); + } +} + +void +Mixer_UI::showhide_mixbuses (bool on) +{ + if (on) { + mb_vpacker.show(); + } else { + mb_vpacker.hide(); + } +} +#endif + + void Mixer_UI::route_group_name_edit (const std::string& path, const std::string& new_text) { @@ -2137,9 +2235,10 @@ Mixer_UI::set_state (const XMLNode& node, int version) } if (node.get_property ("show-mixer-list", yn)) { - Glib::RefPtr act = ActionManager::get_action (X_("Common"), X_("ToggleMixerList")); + Glib::RefPtr act = ActionManager::get_action (X_("Mixer"), X_("ToggleMixerList")); assert (act); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); /* do it twice to force the change */ tact->set_active (!yn); @@ -2147,19 +2246,47 @@ Mixer_UI::set_state (const XMLNode& node, int version) } if (node.get_property ("monitor-section-visible", yn)) { - Glib::RefPtr act = ActionManager::get_action ("Common", "ToggleMonitorSection"); + Glib::RefPtr act = ActionManager::get_action (X_("Mixer"), X_("ToggleMonitorSection")); + assert (act); + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); + + /* do it twice to force the change */ + tact->set_active (!yn); + tact->set_active (yn); + } + + if (node.get_property ("show-vca-pane", yn)) { + Glib::RefPtr act = ActionManager::get_action (X_("Mixer"), X_("ToggleVCAPane")); + assert (act); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); + /* do it twice to force the change */ + tact->set_active (!yn); + tact->set_active (yn); + } + +#ifdef MIXBUS + if (node.get_property ("show-mixbus-pane", yn)) { + Glib::RefPtr act = ActionManager::get_action (X_("Mixer"), X_("ToggleMixbusPane")); + assert (act); + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); + + /* do it twice to force the change */ + tact->set_active (!yn); tact->set_active (yn); - show_monitor_section (yn); } +#endif - XMLNode* plugin_order; - if ((plugin_order = find_named_node (node, "PluginOrder")) != 0) { + //check for the user's plugin_order file + XMLNode plugin_order_new(X_("PO")); + if (PluginManager::instance().load_plugin_order_file(plugin_order_new)) { store_current_favorite_order (); std::list order; - const XMLNodeList& kids = plugin_order->children("PluginInfo"); + const XMLNodeList& kids = plugin_order_new.children("PluginInfo"); XMLNodeConstIterator i; for (i = kids.begin(); i != kids.end(); ++i) { std::string unique_id; @@ -2173,10 +2300,59 @@ Mixer_UI::set_state (const XMLNode& node, int version) PluginStateSorter cmp (order); favorite_order.sort (cmp); sync_treeview_from_favorite_order (); + + } else { + //if there is no user file, then use an existing one from instant.xml + //NOTE: if you are loading an old session, this might come from the session's instant.xml + //Todo: in the next major version, we should probably stop doing the instant.xml check, and just use the new file + XMLNode* plugin_order; + if ((plugin_order = find_named_node (node, "PluginOrder")) != 0) { + store_current_favorite_order (); + std::list order; + const XMLNodeList& kids = plugin_order->children("PluginInfo"); + XMLNodeConstIterator i; + for (i = kids.begin(); i != kids.end(); ++i) { + std::string unique_id; + if ((*i)->get_property ("unique-id", unique_id)) { + order.push_back (unique_id); + if ((*i)->get_property ("expanded", yn)) { + favorite_ui_state[unique_id] = yn; + } + } + } + + PluginStateSorter cmp (order); + favorite_order.sort (cmp); + sync_treeview_from_favorite_order (); + } } + return 0; } +void +Mixer_UI::save_plugin_order_file () +{ + //this writes the plugin order to the user's preference file ( plugin_metadata/plugin_order ) + + //NOTE: this replaces the old code that stores info in instant.xml + //why? because instant.xml prefers the per-session settings, and we want this to be a global pref + + store_current_favorite_order (); + XMLNode plugin_order ("PluginOrder"); + uint32_t cnt = 0; + for (PluginInfoList::const_iterator i = favorite_order.begin(); i != favorite_order.end(); ++i, ++cnt) { + XMLNode* p = new XMLNode ("PluginInfo"); + p->set_property ("sort", cnt); + p->set_property ("unique-id", (*i)->unique_id); + if (favorite_ui_state.find ((*i)->unique_id) != favorite_ui_state.end ()) { + p->set_property ("expanded", favorite_ui_state[(*i)->unique_id]); + } + plugin_order.add_child_nocopy (*p); + } + PluginManager::instance().save_plugin_order_file( plugin_order ); +} + XMLNode& Mixer_UI::get_state () { @@ -2191,27 +2367,25 @@ Mixer_UI::get_state () node->set_property ("narrow-strips", (_strip_width == Narrow)); node->set_property ("show-mixer", _visible); - node->set_property ("show-mixer-list", _show_mixer_list); node->set_property ("maximised", _maximised); - Glib::RefPtr act = ActionManager::get_action ("Common", "ToggleMonitorSection"); - Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); - assert (tact); - node->set_property ("monitor-section-visible", tact->get_active ()); + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleMixerList"); + assert (act); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); node->set_property ("show-mixer-list", tact->get_active ()); - store_current_favorite_order (); - XMLNode* plugin_order = new XMLNode ("PluginOrder"); - uint32_t cnt = 0; - for (PluginInfoList::const_iterator i = favorite_order.begin(); i != favorite_order.end(); ++i, ++cnt) { - XMLNode* p = new XMLNode ("PluginInfo"); - p->set_property ("sort", cnt); - p->set_property ("unique-id", (*i)->unique_id); - if (favorite_ui_state.find ((*i)->unique_id) != favorite_ui_state.end ()) { - p->set_property ("expanded", favorite_ui_state[(*i)->unique_id]); - } - plugin_order->add_child_nocopy (*p); - } - node->add_child_nocopy (*plugin_order); + act = ActionManager::get_action ("Mixer", "ToggleMonitorSection"); + assert (act); tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); node->set_property ("monitor-section-visible", tact->get_active ()); + + act = ActionManager::get_action ("Mixer", "ToggleVCAPane"); + assert (act); tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); node->set_property ("show-vca-pane", tact->get_active ()); + +#ifdef MIXBUS + act = ActionManager::get_action ("Mixer", "ToggleMixbusPane"); + assert (act); tact = Glib::RefPtr::cast_dynamic(act); + assert (tact); node->set_property ("show-mixbus-pane", tact->get_active ()); +#endif return *node; } @@ -2231,6 +2405,14 @@ Mixer_UI::scroll_left () using namespace Gtk::Box_Helpers; const BoxList& strips = strip_packer.children(); for (BoxList::const_iterator i = strips.begin(); i != strips.end(); ++i) { + if (i->get_widget() == & add_button) { + continue; + } +#ifdef MIXBUS + if (i->get_widget() == &mb_shadow) { + continue; + } +#endif lm += i->get_widget()->get_width (); if (lm >= lp) { lm -= i->get_widget()->get_width (); @@ -2255,6 +2437,14 @@ Mixer_UI::scroll_right () using namespace Gtk::Box_Helpers; const BoxList& strips = strip_packer.children(); for (BoxList::const_iterator i = strips.begin(); i != strips.end(); ++i) { + if (i->get_widget() == & add_button) { + continue; + } +#ifdef MIXBUS + if (i->get_widget() == &mb_shadow) { + continue; + } +#endif lm += i->get_widget()->get_width (); if (lm > lp + 1) { break; @@ -2442,10 +2632,39 @@ Mixer_UI::set_axis_targets_for_operation () } +void +Mixer_UI::set_monitor_action_sensitivity (bool yn) +{ + // TODO use ActionMap::find_toggle_action()->set_*(); + Glib::RefPtr act; + Glib::RefPtr tact; + + act = ActionManager::get_action (X_("Monitor"), "UseMonitorSection"); + tact = Glib::RefPtr::cast_dynamic (act); + tact->set_active (yn); + + act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all"); + tact = Glib::RefPtr::cast_dynamic (act); + tact->set_sensitive (yn); + + act = ActionManager::get_action (X_("Monitor"), "monitor-dim-all"); + tact = Glib::RefPtr::cast_dynamic (act); + tact->set_sensitive (yn); + + act = ActionManager::get_action (X_("Monitor"), "monitor-mono"); + tact = Glib::RefPtr::cast_dynamic (act); + tact->set_sensitive (yn); +} + 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. * @@ -2465,8 +2684,6 @@ Mixer_UI::monitor_section_going_away () monitor_section_detached (); out_packer.remove (_monitor_section->tearoff()); _monitor_section->set_session (0); - delete _monitor_section; - _monitor_section = 0; } } @@ -2523,16 +2740,18 @@ Mixer_UI::restore_mixer_space () void Mixer_UI::monitor_section_attached () { - Glib::RefPtr act = ActionManager::get_action ("Common", "ToggleMonitorSection"); + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleMonitorSection"); + assert (act); act->set_sensitive (true); + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); - act->set_sensitive (true); - show_monitor_section (tact->get_active ()); + assert (tact); + showhide_monitor_section ( tact->get_active () ); } void Mixer_UI::monitor_section_detached () { - Glib::RefPtr act = ActionManager::get_action ("Common", "ToggleMonitorSection"); + Glib::RefPtr act = ActionManager::get_action ("Mixer", "ToggleMonitorSection"); act->set_sensitive (false); } @@ -2981,48 +3200,52 @@ Mixer_UI::showing_spill_for (boost::shared_ptr s) const return s == spilled_strip.lock(); } -void -Mixer_UI::show_editor_window () const -{ - PublicEditor::instance().make_visible (); -} - void Mixer_UI::register_actions () { - Glib::RefPtr group = myactions.create_action_group (X_("Mixer")); + Glib::RefPtr group = ActionManager::create_action_group (this, X_("Mixer")); - myactions.register_action (group, "show-editor", _("Show Editor"), sigc::mem_fun (*this, &Mixer_UI::show_editor_window)); + ActionManager::register_action (group, "solo", _("Toggle Solo on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::solo_action)); + ActionManager::register_action (group, "mute", _("Toggle Mute on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::mute_action)); + ActionManager::register_action (group, "recenable", _("Toggle Rec-enable on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::rec_enable_action)); + ActionManager::register_action (group, "increment-gain", _("Decrease Gain on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::step_gain_up_action)); + ActionManager::register_action (group, "decrement-gain", _("Increase Gain on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::step_gain_down_action)); + ActionManager::register_action (group, "unity-gain", _("Set Gain to 0dB on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::unity_gain_action)); - myactions.register_action (group, "solo", _("Toggle Solo on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::solo_action)); - myactions.register_action (group, "mute", _("Toggle Mute on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::mute_action)); - myactions.register_action (group, "recenable", _("Toggle Rec-enable on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::rec_enable_action)); - myactions.register_action (group, "increment-gain", _("Decrease Gain on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::step_gain_up_action)); - myactions.register_action (group, "decrement-gain", _("Increase Gain on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::step_gain_down_action)); - myactions.register_action (group, "unity-gain", _("Set Gain to 0dB on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::unity_gain_action)); + ActionManager::register_action (group, "copy-processors", _("Copy Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::copy_processors)); + ActionManager::register_action (group, "cut-processors", _("Cut Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::cut_processors)); + ActionManager::register_action (group, "paste-processors", _("Paste Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::paste_processors)); + ActionManager::register_action (group, "delete-processors", _("Delete Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::delete_processors)); + ActionManager::register_action (group, "select-all-processors", _("Select All (visible) Processors"), sigc::mem_fun (*this, &Mixer_UI::select_all_processors)); + ActionManager::register_action (group, "toggle-processors", _("Toggle Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::toggle_processors)); + ActionManager::register_action (group, "ab-plugins", _("Toggle Selected Plugins"), sigc::mem_fun (*this, &Mixer_UI::ab_plugins)); + ActionManager::register_action (group, "select-none", _("Deselect all strips and processors"), sigc::mem_fun (*this, &Mixer_UI::select_none)); - myactions.register_action (group, "copy-processors", _("Copy Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::copy_processors)); - myactions.register_action (group, "cut-processors", _("Cut Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::cut_processors)); - myactions.register_action (group, "paste-processors", _("Paste Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::paste_processors)); - myactions.register_action (group, "delete-processors", _("Delete Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::delete_processors)); - myactions.register_action (group, "select-all-processors", _("Select All (visible) Processors"), sigc::mem_fun (*this, &Mixer_UI::select_all_processors)); - myactions.register_action (group, "toggle-processors", _("Toggle Selected Processors"), sigc::mem_fun (*this, &Mixer_UI::toggle_processors)); - myactions.register_action (group, "ab-plugins", _("Toggle Selected Plugins"), sigc::mem_fun (*this, &Mixer_UI::ab_plugins)); - myactions.register_action (group, "select-none", _("Deselect all strips and processors"), sigc::mem_fun (*this, &Mixer_UI::select_none)); - myactions.register_action (group, "select-all-tracks", _("Select All Tracks"), sigc::mem_fun (*this, &Mixer_UI::select_all_tracks)); + ActionManager::register_action (group, "select-next-stripable", _("Select Next Mixer Strip"), sigc::mem_fun (*this, &Mixer_UI::select_next_strip)); + ActionManager::register_action (group, "select-prev-stripable", _("Scroll Previous Mixer Strip"), sigc::mem_fun (*this, &Mixer_UI::select_prev_strip)); - myactions.register_action (group, "scroll-left", _("Scroll Mixer Window to the left"), sigc::mem_fun (*this, &Mixer_UI::scroll_left)); - myactions.register_action (group, "scroll-right", _("Scroll Mixer Window to the right"), sigc::mem_fun (*this, &Mixer_UI::scroll_right)); + ActionManager::register_action (group, "scroll-left", _("Scroll Mixer Window to the left"), sigc::mem_fun (*this, &Mixer_UI::scroll_left)); + ActionManager::register_action (group, "scroll-right", _("Scroll Mixer Window to the right"), sigc::mem_fun (*this, &Mixer_UI::scroll_right)); - myactions.register_action (group, "toggle-midi-input-active", _("Toggle MIDI Input Active for Mixer-Selected Tracks/Busses"), + ActionManager::register_action (group, "toggle-midi-input-active", _("Toggle MIDI Input Active for Mixer-Selected Tracks/Busses"), sigc::bind (sigc::mem_fun (*this, &Mixer_UI::toggle_midi_input_active), false)); + + ActionManager::register_toggle_action (group, X_("ToggleMixerList"), _("Mixer: Show Mixer List"), sigc::mem_fun (*this, &Mixer_UI::toggle_mixer_list)); + + 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)); +#endif + + ActionManager::register_toggle_action (group, X_("ToggleMonitorSection"), _("Mixer: Show Monitor Section"), sigc::mem_fun (*this, &Mixer_UI::toggle_monitor_section)); } void Mixer_UI::load_bindings () { - bindings = Bindings::get_bindings (X_("Mixer"), myactions); + bindings = Bindings::get_bindings (X_("Mixer")); } template void