summaryrefslogtreecommitdiff
path: root/libs/evoral/evoral
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-29 22:47:40 +0000
committerDavid Robillard <d@drobilla.net>2008-09-29 22:47:40 +0000
commitb5ec66ae6cb60fa43c343d3d29340b2370d0b9d1 (patch)
tree217722d96b61288f44477c69ac3bbe5d2e7d43f1 /libs/evoral/evoral
parent03f188cc8b17edc7c727f62b22b4577a2fdbfbe8 (diff)
Can't call the wrong function when there's only one of them: remove ARDOUR::Parameter and just use Evoral::Parameter (move Ardour specific functionality to EventTypeMap where it belongs).
Less than pretty in places but easily seddable just in case... git-svn-id: svn://localhost/ardour2/branches/3.0@3838 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral')
-rw-r--r--libs/evoral/evoral/Parameter.hpp18
-rw-r--r--libs/evoral/evoral/TypeMap.hpp7
-rw-r--r--libs/evoral/evoral/midi_events.h6
3 files changed, 10 insertions, 21 deletions
diff --git a/libs/evoral/evoral/Parameter.hpp b/libs/evoral/evoral/Parameter.hpp
index 1ff01df197..d21b1ee3b8 100644
--- a/libs/evoral/evoral/Parameter.hpp
+++ b/libs/evoral/evoral/Parameter.hpp
@@ -40,22 +40,10 @@ namespace Evoral {
class Parameter
{
public:
- Parameter(uint32_t type, uint8_t channel, uint32_t id=0)
+ Parameter(uint32_t type, uint8_t channel=0, uint32_t id=0)
: _type(type), _id(id), _channel(channel)
{}
- Parameter(const std::string& str) {
- int channel;
- if (sscanf(str.c_str(), "%d_c%d_n%d", &_type, &channel, &_id) == 3) {
- if (channel >= 0 && channel <= 127) {
- _channel = channel;
- } else {
- std::cerr << "WARNING: Channel out of range: " << channel << std::endl;
- }
- }
- std::cerr << "WARNING: Unable to create parameter from string: " << str << std::endl;
- }
-
virtual ~Parameter() {}
inline uint32_t type() const { return _type; }
@@ -113,10 +101,6 @@ public:
inline operator bool() const { return (_type != 0); }
- virtual std::string symbol() const {
- return (boost::format("%1%_c%2%_n%3%") % _type % (int)_channel % _id).str();
- }
-
/** Not used in indentity/comparison */
struct Metadata {
Metadata(double low=0.0, double high=1.0, double mid=0.0)
diff --git a/libs/evoral/evoral/TypeMap.hpp b/libs/evoral/evoral/TypeMap.hpp
index 91986e0dcb..9e3d64a047 100644
--- a/libs/evoral/evoral/TypeMap.hpp
+++ b/libs/evoral/evoral/TypeMap.hpp
@@ -47,7 +47,12 @@ public:
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;
+ virtual bool is_integer(const Evoral::Parameter& param) const = 0;
+
+ /** Create a parameter with the given type ID */
+ virtual Parameter new_parameter(uint32_t type, uint8_t channel, uint32_t id) const = 0;
+
+ virtual std::string to_symbol(const Parameter& param) const = 0;
};
} // namespace Evoral
diff --git a/libs/evoral/evoral/midi_events.h b/libs/evoral/evoral/midi_events.h
index 1c786aa6f7..d0329cdaf8 100644
--- a/libs/evoral/evoral/midi_events.h
+++ b/libs/evoral/evoral/midi_events.h
@@ -18,8 +18,8 @@
*
*/
-#ifndef RAUL_MIDI_EVENTS_H
-#define RAUL_MIDI_EVENTS_H
+#ifndef EVORAL_MIDI_EVENTS_H
+#define EVORAL_MIDI_EVENTS_H
/**
@@ -130,4 +130,4 @@
/** \} */
-#endif /* RAUL_MIDI_EVENTS_H */
+#endif /* EVORAL_MIDI_EVENTS_H */