move all (G)UI related configuration parameters into UIConfiguration, not RCConfiguration
[ardour.git] / gtk2_ardour / mixer_ui.cc
index 9db4b0bde393b87fbfb6b9a2e06de5955ae30a50..e20f78a61b6424804d7c5d9fe9f959ac97d6452e 100644 (file)
@@ -91,7 +91,7 @@ Mixer_UI::Mixer_UI ()
        , in_group_row_change (false)
        , track_menu (0)
        , _monitor_section (0)
-       , _strip_width (Config->get_default_narrow_ms() ? Narrow : Wide)
+       , _strip_width (ARDOUR_UI::config()->get_default_narrow_ms() ? Narrow : Wide)
        , ignore_reorder (false)
         , _in_group_rebuild_or_clear (false)
         , _route_deletion_in_progress (false)
@@ -120,7 +120,7 @@ Mixer_UI::Mixer_UI ()
        b->show_all ();
 
        scroller.add (*b);
-       scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+       scroller.set_policy (Gtk::POLICY_ALWAYS, Gtk::POLICY_AUTOMATIC);
 
        setup_track_display ();
 
@@ -246,8 +246,6 @@ Mixer_UI::Mixer_UI ()
 
        MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());
 
-        MonitorSection::setup_knob_images ();
-
 #ifndef DEFER_PLUGIN_SELECTOR_LOAD
        _plugin_selector = new PluginSelector (PluginManager::instance ());
 #endif
@@ -293,7 +291,7 @@ Mixer_UI::show_window ()
                        ms = (*ri)[track_columns.strip];
                        ms->set_width_enum (ms->get_width_enum (), ms->width_owner());
                        /* Fix visibility of mixer strip stuff */
-                       ms->parameter_changed (X_("mixer-strip-visibility"));
+                       ms->parameter_changed (X_("mixer-element-visibility"));
                }
        }
        
@@ -370,7 +368,7 @@ Mixer_UI::add_strips (RouteList& routes)
                        strip = new MixerStrip (*this, _session, route);
                        strips.push_back (strip);
 
-                       Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
+                       ARDOUR_UI::config()->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
                        
                        if (strip->width_owner() != strip) {
                                strip->set_width_enum (_strip_width, this);
@@ -392,7 +390,6 @@ Mixer_UI::add_strips (RouteList& routes)
                        
                        strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed));
                        strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
-                       strip->signal_enter_notify_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_enter_event), strip));
                }
 
        } catch (...) {
@@ -405,6 +402,30 @@ Mixer_UI::add_strips (RouteList& routes)
        redisplay_track_list ();
 }
 
+void
+Mixer_UI::deselect_all_strip_processors ()
+{
+       for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
+               (*i)->deselect_all_processors();
+       }
+}
+
+void
+Mixer_UI::select_none ()
+{
+       _selection.clear_routes();
+       deselect_all_strip_processors();
+}
+
+void
+Mixer_UI::delete_processors ()
+{
+       for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
+               (*i)->delete_processors();
+       }
+}
+
+
 void
 Mixer_UI::remove_strip (MixerStrip* strip)
 {
@@ -597,7 +618,7 @@ Mixer_UI::sync_treeview_from_order_keys ()
 void
 Mixer_UI::follow_editor_selection ()
 {
-       if (!Config->get_link_editor_and_mixer_selection() || _following_editor_selection) {
+       if (!ARDOUR_UI::config()->get_link_editor_and_mixer_selection() || _following_editor_selection) {
                return;
        }
 
@@ -635,19 +656,6 @@ Mixer_UI::strip_by_route (boost::shared_ptr<Route> r)
        return 0;
 }
 
-bool
-Mixer_UI::strip_enter_event (GdkEventCrossing *ev, MixerStrip *strip)
-{
-       if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
-               ;  //don't change the current selection, user is doing it manually
-       } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
-               _selection.add (strip);
-       } else
-               _selection.set (strip);
-       return false;
-}
-
-
 bool
 Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
 {
@@ -668,6 +676,7 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
                                        
                                        vector<MixerStrip*> tmp;
                                        bool accumulate = false;
+                                       bool found_another = false;
                                        
                                        tmp.push_back (strip);
 
@@ -686,6 +695,7 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
                                                        /* hit selected strip. if currently accumulating others,
                                                           we're done. if not accumulating others, start doing so.
                                                        */
+                                                       found_another = true;
                                                        if (accumulate) {
                                                                /* done */
                                                                break;
@@ -699,9 +709,12 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
                                                }
                                        }
 
-                                       for (vector<MixerStrip*>::iterator i = tmp.begin(); i != tmp.end(); ++i) {
-                                               _selection.add (*i);
-                                       }
+                                       if (found_another) {
+                                               for (vector<MixerStrip*>::iterator i = tmp.begin(); i != tmp.end(); ++i) {
+                                                       _selection.add (*i);
+                                               }
+                                       } else
+                                               _selection.set (strip);  //user wants to start a range selection, but there aren't any others selected yet
                                }
 
                        } else {
@@ -1785,7 +1798,7 @@ Mixer_UI::parameter_changed (string const & p)
                        _group_tabs->hide ();
                }
        } else if (p == "default-narrow_ms") {
-               bool const s = Config->get_default_narrow_ms ();
+               bool const s = ARDOUR_UI::config()->get_default_narrow_ms ();
                for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
                        (*i)->set_width_enum (s ? Narrow : Wide, this);
                }
@@ -1926,16 +1939,8 @@ Mixer_UI::set_route_targets_for_operation ()
                return;
        }
 
-       /* nothing selected ... try to get mixer strip at mouse */
+//  removed "implicit" selections of strips, after discussion on IRC
 
-       int x, y;
-       get_pointer (x, y);
-       
-       MixerStrip* ms = strip_by_x (x);
-       
-       if (ms) {
-               _route_targets.insert (ms);
-       }
 }
 
 void