Remove ARDOUR::Parameter::is_integer.
authorDavid Robillard <d@drobilla.net>
Mon, 29 Sep 2008 20:50:21 +0000 (20:50 +0000)
committerDavid Robillard <d@drobilla.net>
Mon, 29 Sep 2008 20:50:21 +0000 (20:50 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@3837 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/automation_line.cc
libs/ardour/ardour/event_type_map.h
libs/ardour/ardour/parameter.h
libs/ardour/event_type_map.cc
libs/evoral/evoral/TypeMap.hpp

index 8754bbc21ab62a36c18662a7d208e30ee4c53673..854eb57a9283e8208eeeea8e104ea7a560106d36 100644 (file)
@@ -614,10 +614,11 @@ AutomationLine::get_verbose_cursor_string (double fraction)
                }
        } else {
                view_to_model_y(fraction);
-               if (((ARDOUR::Parameter)alist->parameter()).is_integer())
+               if (EventTypeMap::instance().is_integer(alist->parameter())) {
                        snprintf (buf, sizeof (buf), "%d", (int)fraction);
-               else
+               } else {
                        snprintf (buf, sizeof (buf), "%.2f", fraction);
+               }
        }
 
        return buf;
index 6736feeb8614d69fd0c0c83ca1379f7b288f0192..4d7180c028b73f242d304e6931990e77064e0d05 100644 (file)
@@ -31,6 +31,8 @@ public:
        uint8_t  parameter_midi_type(const Evoral::Parameter& param) const;
        uint32_t midi_event_type(uint8_t status) const;
 
+       bool is_integer(const Evoral::Parameter& param) const;
+
        static EventTypeMap& instance() { return event_type_map; }
 
 private:
index edb157ed57907b73a2b3a06fa52e30a37147256b..a9aa05192418d5e689d5761dca08a1db2423db8a 100644 (file)
@@ -93,10 +93,6 @@ public:
 
        std::string symbol() const;
 
-       inline bool is_integer() const {
-               return (_type >= MidiCCAutomation && _type <= MidiChannelPressureAutomation);
-       }
-
        inline operator Parameter() { return (Parameter)*this; }
 };
 
index cd78fd02f7f571ffb077ee02028052a7ee4e4b44..2d724a26efdafb799f724e8baa624ccf91f3f022 100644 (file)
@@ -57,5 +57,12 @@ EventTypeMap::midi_event_type(uint8_t status) const
        }
 }
 
+bool
+EventTypeMap::is_integer(const Evoral::Parameter& param) const
+{
+       return (   param.type() >= MidiCCAutomation
+                       && param.type() <= MidiChannelPressureAutomation);
+}
+
 } // namespace ARDOUR
 
index 3ab8066f70a08139d97b6c7de19c25147a3ac2fc..91986e0dcbf68d37f5f2c2708bf45b369b488d74 100644 (file)
@@ -45,6 +45,9 @@ public:
        /** The type ID for a MIDI event with the given status byte
         */
        virtual uint32_t midi_event_type(uint8_t status) const = 0;
+       
+       /** Return true iff parameter should be locked to integer boundaries */
+       bool is_integer(const Evoral::Parameter& param) const;
 };
 
 } // namespace Evoral