selected Stripables now have a counter to indicate the order they were selected in
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 26 Feb 2017 17:17:50 +0000 (18:17 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 26 Feb 2017 17:24:56 +0000 (18:24 +0100)
libs/ardour/ardour/presentation_info.h
libs/ardour/presentation_info.cc

index 6984930f3d241a1aab9ca69a122cde7d2176019f..7c847e9fce8e9b7c263c739670d5909e0072b9d3 100644 (file)
@@ -158,6 +158,8 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
 
        bool order_set() const { return _flags & OrderSet; }
 
+       int selection_cnt() const { return _selection_cnt; }
+
        bool hidden() const { return _flags & Hidden; }
        bool selected() const { return _flags & Selected; }
        bool special() const { return _flags & (MasterOut|MonitorOut|Auditioner); }
@@ -263,11 +265,14 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
        order_t _order;
        Flag    _flags;
        color_t _color;
+       int     _selection_cnt;
 
        static PBD::PropertyChange _pending_static_changes;
        static Glib::Threads::Mutex static_signal_lock;
        static int _change_signal_suspended;
        static void send_static_change (const PBD::PropertyChange&);
+
+       static int selection_counter;
 };
 
 }
index 25048eaf98231eb9e5a9a9ab668c5657ad8fe9b6..e3e7700d403409c7ff436e63114b949681505f0c 100644 (file)
@@ -43,6 +43,7 @@ PBD::Signal1<void,PropertyChange const &> PresentationInfo::Change;
 Glib::Threads::Mutex PresentationInfo::static_signal_lock;
 int PresentationInfo::_change_signal_suspended = 0;
 PBD::PropertyChange PresentationInfo::_pending_static_changes;
+int PresentationInfo::selection_counter = 0;
 
 namespace ARDOUR {
        namespace Properties {
@@ -243,8 +244,10 @@ PresentationInfo::set_selected (bool yn)
        if (yn != selected()) {
                if (yn) {
                        _flags = Flag (_flags | Selected);
+                       _selection_cnt = g_atomic_int_add (&selection_counter, 1);
                } else {
                        _flags = Flag (_flags & ~Selected);
+                       _selection_cnt = 0;
                }
                send_change (PropertyChange (Properties::selected));
                send_static_change (PropertyChange (Properties::selected));