From 5309c327ec96de33838e45ddb1489a632c2a4c68 Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Wed, 21 Jan 2009 10:20:27 +0000 Subject: * make MIDI-specific menu show up on all MIDI lanes * style guide, comments and a little refactoring (remove duplication) git-svn-id: svn://localhost/ardour2/branches/3.0@4422 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/event_type_map.h | 12 ++++++++---- libs/ardour/event_type_map.cc | 6 ++++++ libs/evoral/src/ControlList.cpp | 6 +++++- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/event_type_map.h b/libs/ardour/ardour/event_type_map.h index dfa11d6408..d6f26aeac7 100644 --- a/libs/ardour/ardour/event_type_map.h +++ b/libs/ardour/ardour/event_type_map.h @@ -24,6 +24,8 @@ #include #include +class Evoral::Parameter; + namespace ARDOUR { /** This is the interface Ardour provides to Evoral about what @@ -35,10 +37,12 @@ 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; - Evoral::Parameter new_parameter(uint32_t type, uint8_t channel=0, uint32_t id=0) const; - Evoral::Parameter new_parameter(const std::string& str) const; - std::string to_symbol(const Evoral::Parameter& param) const; + bool is_integer(const Evoral::Parameter& param) const; + Evoral::Parameter new_parameter(uint32_t type, uint8_t channel=0, uint32_t id=0) const; + Evoral::Parameter new_parameter(const std::string& str) const; + std::string to_symbol(const Evoral::Parameter& param) const; + + bool is_midi_parameter(const Evoral::Parameter& param); static EventTypeMap& instance() { return event_type_map; } diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc index 39c2e3d6eb..a4d8317a42 100644 --- a/libs/ardour/event_type_map.cc +++ b/libs/ardour/event_type_map.cc @@ -38,6 +38,12 @@ EventTypeMap::type_is_midi(uint32_t type) const return (type >= MidiCCAutomation) && (type <= MidiChannelPressureAutomation); } +bool +EventTypeMap::is_midi_parameter(const Evoral::Parameter& param) +{ + return type_is_midi(param.type()); +} + uint8_t EventTypeMap::parameter_midi_type(const Evoral::Parameter& param) const { diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index 5ec8c2dac9..022945b0f8 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -770,6 +770,7 @@ ControlList::unlocked_eval (double x) const if (x >= _events.front()->when) { return _events.front()->value; } else { + // hansfbaier: v--------- Why commented ??? // return _default_value; return _events.front()->value; } @@ -780,6 +781,7 @@ ControlList::unlocked_eval (double x) const } else if (x == _events.front()->when) { return _events.front()->value; } else if (x < _events.front()->when) { + // hansfbaier: v--------- Why commented ??? // return _default_value; return _events.front()->value; } @@ -789,8 +791,9 @@ ControlList::unlocked_eval (double x) const upos = _events.back()->when; uval = _events.back()->value; - if (_interpolation == Discrete) + if (_interpolation == Discrete) { return lval; + } /* linear interpolation betweeen the two points */ @@ -805,6 +808,7 @@ ControlList::unlocked_eval (double x) const } else if (x == _events.front()->when) { return _events.front()->value; } else if (x < _events.front()->when) { + // hansfbaier: v--------- Why commented ??? // return _default_value; return _events.front()->value; } -- cgit v1.2.3