Don't add auditioner and click to MIDI connection port matrices.
[ardour.git] / gtk2_ardour / mixer_ui.cc
index 1c31f400ff62df035794ba4524fbdace1fe64eb0..16f3089825b6e7bd4dbfc8b3370181d87e547b3e 100644 (file)
@@ -338,9 +338,7 @@ Mixer_UI::add_strip (RouteList& routes)
                route->NameChanged.connect (bind (mem_fun(*this, &Mixer_UI::strip_name_changed), strip));
 
                strip->GoingAway.connect (bind (mem_fun(*this, &Mixer_UI::remove_strip), strip));
-#ifdef GTKOSX
-               strip->WidthChanged.connect (mem_fun(*this, &Mixer_UI::queue_draw_all_strips));
-#endif 
+               strip->WidthChanged.connect (mem_fun(*this, &Mixer_UI::strip_width_changed));
                strip->signal_button_release_event().connect (bind (mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
        }
 
@@ -376,27 +374,14 @@ Mixer_UI::remove_strip (MixerStrip* strip)
        strip_redisplay_does_not_sync_order_keys = false;
 }
 
-const char*
-Mixer_UI::get_order_key() 
-{
-       return X_("signal");
-#if 0
-       if (Config->get_sync_all_route_ordering()) {
-               return X_("editor");
-       } else {
-               return X_("signal");
-       }
-#endif
-}
-
 void
-Mixer_UI::sync_order_keys (const char *src)
+Mixer_UI::sync_order_keys (string const & src)
 {
        vector<int> neworder;
        TreeModel::Children rows = track_model->children();
        TreeModel::Children::iterator ri;
 
-       if ((strcmp (src, get_order_key()) == 0) || !session || (session->state_of_the_state() & Session::Loading) || rows.empty()) {
+       if (src == N_("signal") || !session || (session->state_of_the_state() & Session::Loading) || rows.empty()) {
                return;
        }
 
@@ -410,8 +395,9 @@ Mixer_UI::sync_order_keys (const char *src)
        for (order = 0, ri = rows.begin(); ri != rows.end(); ++ri, ++order) {
                boost::shared_ptr<Route> route = (*ri)[track_columns.route];
                int old_key = order;
-               int new_key = route->order_key (get_order_key());
+               int new_key = route->order_key (N_("signal"));
 
+               assert (new_key < neworder.size());
                neworder[new_key] = old_key;
 
                if (new_key != old_key) {
@@ -488,7 +474,7 @@ Mixer_UI::connect_to_session (Session* sess)
               show_window();
        }
 
-       _group_tabs->set_session (sess);
+       _group_tabs->connect_to_session (sess);
 
        start_updating ();
 }
@@ -673,7 +659,7 @@ Mixer_UI::hide_all_audiotracks ()
 }
 
 void
-Mixer_UI::track_list_reorder (const TreeModel::Path& path, const TreeModel::iterator& iter, int* new_order)
+Mixer_UI::track_list_reorder (const TreeModel::Path&, const TreeModel::iterator&, int* /*new_order*/)
 {
        strip_redisplay_does_not_sync_order_keys = true;
        session->set_remote_control_ids();
@@ -682,7 +668,7 @@ Mixer_UI::track_list_reorder (const TreeModel::Path& path, const TreeModel::iter
 }
 
 void
-Mixer_UI::track_list_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
+Mixer_UI::track_list_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&)
 {
        // never reset order keys because of a property change
        strip_redisplay_does_not_reset_order_keys = true; 
@@ -692,7 +678,7 @@ Mixer_UI::track_list_change (const Gtk::TreeModel::Path& path,const Gtk::TreeMod
 }
 
 void
-Mixer_UI::track_list_delete (const Gtk::TreeModel::Path& path)
+Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&)
 {
        /* this could require an order sync */
        session->set_remote_control_ids();
@@ -725,7 +711,7 @@ Mixer_UI::redisplay_track_list ()
                        strip->route()->set_order_key (N_("signal"), order);
 
                        if (!strip_redisplay_does_not_reset_order_keys) {
-                               strip->route()->set_order_key (get_order_key(), order);
+                               strip->route()->set_order_key (N_("signal"), order);
                        } 
 
                        if (strip->packed()) {
@@ -763,7 +749,7 @@ Mixer_UI::redisplay_track_list ()
        }
        
        if (!strip_redisplay_does_not_reset_order_keys && !strip_redisplay_does_not_sync_order_keys) {
-               session->sync_order_keys (get_order_key());
+               session->sync_order_keys (N_("signal"));
        }
 
        // Rebind all of the midi controls automatically
@@ -774,10 +760,12 @@ Mixer_UI::redisplay_track_list ()
        _group_tabs->set_dirty ();
 }
 
-#ifdef GTKOSX
 void
-Mixer_UI::queue_draw_all_strips ()
+Mixer_UI::strip_width_changed ()
 {
+       _group_tabs->set_dirty ();
+       
+#ifdef GTKOSX
        TreeModel::Children rows = track_model->children();
        TreeModel::Children::iterator i;
        long order;
@@ -795,8 +783,9 @@ Mixer_UI::queue_draw_all_strips ()
                        strip->queue_draw();
                }
        }
-}
 #endif
+       
+}
 
 void
 Mixer_UI::set_auto_rebinding( bool val )
@@ -883,7 +872,7 @@ Mixer_UI::auto_rebind_midi_controls ()
 struct SignalOrderRouteSorter {
     bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
            /* use of ">" forces the correct sort order */
-           return a->order_key (Mixer_UI::get_order_key()) < b->order_key (Mixer_UI::get_order_key());
+           return a->order_key (N_("signal")) < b->order_key (N_("signal"));
     }
 };
 
@@ -1111,7 +1100,7 @@ Mixer_UI::route_groups_changed ()
 void
 Mixer_UI::new_route_group ()
 {
-       session->add_route_group (new RouteGroup (*session, ""));
+       session->add_route_group (new RouteGroup (*session, "", RouteGroup::Active, (RouteGroup::Property) (RouteGroup::Gain |RouteGroup::Mute | RouteGroup::Solo)));
 }
 
 void
@@ -1196,7 +1185,7 @@ Mixer_UI::route_group_name_edit (const Glib::ustring& path, const Glib::ustring&
 }
 
 void 
-Mixer_UI::route_group_row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
+Mixer_UI::route_group_row_change (const Gtk::TreeModel::Path&const Gtk::TreeModel::iterator& iter)
 {
        RouteGroup* group;
 
@@ -1402,7 +1391,7 @@ Mixer_UI::get_state (void)
 
 
 void 
-Mixer_UI::pane_allocation_handler (Allocation& alloc, Gtk::Paned* which)
+Mixer_UI::pane_allocation_handler (Allocation&, Gtk::Paned* which)
 {
        int pos;
        XMLProperty* prop = 0;
@@ -1474,6 +1463,13 @@ Mixer_UI::on_key_press_event (GdkEventKey* ev)
        return key_press_focus_accelerator_handler (*this, ev);
 }
 
+bool
+Mixer_UI::on_key_release_event (GdkEventKey* ev)
+{
+       return Gtk::Window::on_key_release_event (ev);
+       // return key_press_focus_accelerator_handler (*this, ev);
+}
+
 void
 Mixer_UI::parameter_changed (string const & p)
 {