provide a heuristic to decide if the color has been set for a PresentationInfo object
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 9 Jun 2016 20:24:22 +0000 (16:24 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 9 Jun 2016 20:24:22 +0000 (16:24 -0400)
libs/ardour/ardour/presentation_info.h
libs/ardour/presentation_info.cc

index 5ad33ab1098fd03a8ab7b98631f01af0e71e3cb3..8a3c3674489146005e562dd7126dc007694771d3 100644 (file)
@@ -145,6 +145,8 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
        order_t  order() const { return _order; }
        color_t  color() const { return _color; }
 
+       bool color_set() const;
+
        void set_color (color_t);
        void set_selected (bool yn);
        void set_hidden (bool yn);
index e6200371c393cc4448747c7765fc31ea995e3372..cfed463d83b7e5f5fea76fce05583a0a70c2b29c 100644 (file)
@@ -166,6 +166,18 @@ PresentationInfo::set_color (PresentationInfo::color_t c)
        }
 }
 
+bool
+PresentationInfo::color_set () const
+{
+       /* all RGBA values zero? not set.
+        *
+        * this is heuristic, but it is fairly realistic. who will ever set
+        * a color to completely transparent black? only the constructor ..
+        */
+
+       return _color == 0;
+}
+
 void
 PresentationInfo::set_selected (bool yn)
 {