Categorize the mixer actions.
[ardour.git] / gtk2_ardour / meterbridge.cc
index f687d0c72d5a37bafe6894b580ee885962586a9c..65438c414e9db19a025e60ba9d32dfeb3c35fcde 100644 (file)
@@ -54,7 +54,7 @@
 #include "meter_patterns.h"
 #include "timers.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace ARDOUR_UI_UTILS;
@@ -99,6 +99,16 @@ Meterbridge::Meterbridge ()
 
        set_wmclass (X_("ardour_mixer"), PROGRAM_NAME);
 
+#ifdef __APPLE__
+       set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
+#else
+       if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) {
+               set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
+       } else {
+               set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
+       }
+#endif
+
        Gdk::Geometry geom;
        geom.max_width = 1<<16;
        geom.max_height = max_height;
@@ -401,14 +411,16 @@ Meterbridge::on_scroll()
 struct PresentationInfoRouteSorter
 {
        bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
-               if (a->is_master()) {
-                       /* master before everything else */
-                       return true;
-               } else if (b->is_master()) {
-                       /* everything else before b */
+               if (a->is_master() || a->is_monitor()) {
+                       /* "a" is a special route (master, monitor, etc), and comes
+                        * last in the mixer ordering
+                        */
                        return false;
+               } else if (b->is_master() || b->is_monitor()) {
+                       /* everything comes before b */
+                       return true;
                }
-               return a->presentation_info() < b->presentation_info();
+               return a->presentation_info().order() < b->presentation_info().order();
        }
 };
 
@@ -434,12 +446,11 @@ Meterbridge::set_session (Session* s)
        _show_master = _session->config.get_show_master_on_meterbridge();
        _show_midi = _session->config.get_show_midi_on_meterbridge();
 
-       PresentationInfoRouteSorter sorter;
        boost::shared_ptr<RouteList> routes = _session->get_routes();
 
-       RouteList copy(*routes);
-       copy.sort(sorter);
-       add_strips(copy);
+       RouteList copy (*routes);
+       copy.sort (PresentationInfoRouteSorter());
+       add_strips (copy);
 
        _session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&Meterbridge::add_strips, this, _1), gui_context());
        _session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Meterbridge::update_title, this), gui_context());