move control surface prefs onto their own tab in the user prefs; for Generic MIDI...
[ardour.git] / libs / evoral / evoral / Parameter.hpp
index 95ee5daa8e344242b32c773c53fe1207f6d87c90..7142574dbd8b6f9cb600b55e58a86d5e4f3558f7 100644 (file)
@@ -1,6 +1,5 @@
-
 /* This file is part of Evoral.
- * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
+ * Copyright (C) 2008 David Robillard <http://drobilla.net>
  * Copyright (C) 2000-2008 Paul Davis
  *
  * Evoral is free software; you can redistribute it and/or modify it under the
@@ -79,20 +78,21 @@ public:
 
        /** Not used in indentity/comparison */
        struct Metadata {
-               Metadata(double low=0.0, double high=1.0, double mid=0.0)
-                       : min(low), max(high), normal(mid)
+               Metadata(double low=0.0, double high=1.0, double mid=0.0, bool tog=false)
+                       : min(low), max(high), normal(mid), toggled(tog)
                {}
                double min;
                double max;
                double normal;
+               bool   toggled;
        };
 
-       inline static void set_range(uint32_t type, double min, double max, double normal) {
-               _type_metadata[type] = Metadata(min, max, normal);
+       inline static void set_range(uint32_t type, double min, double max, double normal, bool toggled) {
+               _type_metadata[type] = Metadata(min, max, normal, toggled);
        }
 
-       inline void set_range(double min, double max, double normal) {
-               _metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal));
+       inline void set_range(double min, double max, double normal, bool toggled) {
+               _metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal, toggled));
        }
 
        inline Metadata& metadata() const {
@@ -102,9 +102,10 @@ public:
                        return _type_metadata[_type];
        }
 
-       inline double min()    const { return metadata().min; }
-       inline double max()    const { return metadata().max; }
-       inline double normal() const { return metadata().normal; }
+       inline double min()     const { return metadata().min; }
+       inline double max()     const { return metadata().max; }
+       inline double normal()  const { return metadata().normal; }
+       inline double toggled() const { return metadata().toggled; }
 
 protected:
        // Default copy constructor is ok