Midi CC events have no event-ID
[ardour.git] / libs / evoral / evoral / Parameter.hpp
index 2164475cf9635f34e73567b08031f4fb94a5815a..1412699b4d2fab28c4b92b53f03d021d6a918b5e 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace Evoral {
 
-
 /** ID of a [play|record|automate]able parameter.
  *
  * A parameter is defined by (type, id, channel).  Type is an integer which
@@ -41,12 +40,10 @@ namespace Evoral {
 class LIBEVORAL_API Parameter
 {
 public:
-       Parameter(uint32_t type, uint8_t channel=0, uint32_t id=0)
+       inline Parameter(uint32_t type, uint8_t channel=0, uint32_t id=0)
                : _type(type), _id(id), _channel(channel)
        {}
 
-       virtual ~Parameter() {}
-
        inline uint32_t type()    const { return _type; }
        inline uint8_t  channel() const { return _channel; }
        inline uint32_t id()      const { return _id; }
@@ -60,6 +57,10 @@ public:
                return (_type == id._type && _channel == id._channel && _id == id._id );
        }
 
+       inline bool operator!=(const Parameter& id) const {
+               return !operator==(id);
+       }
+
        /** Strict weak ordering
         * See: http://www.sgi.com/tech/stl/StrictWeakOrdering.html
         * Sort Parameters first according to type then to channel and lastly to ID.
@@ -78,52 +79,12 @@ public:
 
        inline operator bool() const { return (_type != 0); }
 
-       /** Not used in indentity/comparison */
-       struct Metadata {
-               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, bool toggled) {
-               _type_metadata[type] = Metadata(min, max, normal, toggled);
-       }
-
-       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 {
-               if (_metadata)
-                       return *_metadata.get();
-               else
-                       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 toggled() const { return metadata().toggled; }
-
-protected:
-       // Default copy constructor is ok
-
-       // ID (used in comparison)
+private:
        uint32_t _type;
        uint32_t _id;
        uint8_t  _channel;
-
-       boost::shared_ptr<Metadata> _metadata;
-
-       typedef std::map<uint32_t, Metadata> TypeMetadata;
-       static TypeMetadata _type_metadata;
 };
 
-
 } // namespace Evoral
 
 #endif // EVORAL_PARAMETER_HPP