remove debug output from last commit
[ardour.git] / gtk2_ardour / selectable.h
index fdd6f7ff9f1fc298a29e45ae60aab8f4cbede3cc..51fc5da027bafb62d5013dc336d0215e22b5558b 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef __ardour_gtk_selectable_h__
 #define __ardour_gtk_selectable_h__
 
-class Selectable 
+#include <sigc++/signal.h>
+
+class Selectable : public virtual sigc::trackable
 {
   public:
        Selectable() {
@@ -30,10 +31,20 @@ class Selectable
 
        virtual ~Selectable() {}
 
-       virtual void set_selected (bool) {
-               _selected = true;
+       virtual void set_selected (bool yn) {
+               if (yn != _selected) {
+                       _selected = yn;
+                       Selected (_selected); /* EMIT_SIGNAL */
+               }
+       }
+
+       bool get_selected() const {
+               return _selected;
        }
 
+       /** Emitted when the selected status of this Selectable changes */
+       sigc::signal<void, bool> Selected ;
+
   protected:
        bool _selected;
 };