mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Remove superfluous typedefs.
Don't set range on sysex parameters (fix warning). git-svn-id: svn://localhost/ardour2/branches/3.0@4568 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d0cc3120ae
commit
de2681f7cd
7 changed files with 22 additions and 33 deletions
|
|
@ -116,16 +116,12 @@ EventTypeMap::interpolation_of(const Evoral::Parameter& param)
|
||||||
case MIDI_CTL_OMNI_OFF:
|
case MIDI_CTL_OMNI_OFF:
|
||||||
case MIDI_CTL_OMNI_ON:
|
case MIDI_CTL_OMNI_ON:
|
||||||
case MIDI_CTL_MONO:
|
case MIDI_CTL_MONO:
|
||||||
case MIDI_CTL_POLY:
|
case MIDI_CTL_POLY:
|
||||||
|
|
||||||
return Evoral::ControlList::Discrete;
|
return Evoral::ControlList::Discrete;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: return Evoral::ControlList::Linear; break;
|
default: return Evoral::ControlList::Linear; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break;
|
case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break;
|
||||||
case MidiChannelPressureAutomation: return Evoral::ControlList::Linear; break;
|
case MidiChannelPressureAutomation: return Evoral::ControlList::Linear; break;
|
||||||
case MidiPitchBenderAutomation: return Evoral::ControlList::Linear; break;
|
case MidiPitchBenderAutomation: return Evoral::ControlList::Linear; break;
|
||||||
|
|
@ -166,6 +162,8 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const
|
||||||
Evoral::MIDI::controller_range(min, max, normal); break;
|
Evoral::MIDI::controller_range(min, max, normal); break;
|
||||||
case MidiPitchBenderAutomation:
|
case MidiPitchBenderAutomation:
|
||||||
Evoral::MIDI::bender_range(min, max, normal); break;
|
Evoral::MIDI::bender_range(min, max, normal); break;
|
||||||
|
case MidiSystemExclusiveAutomation:
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.set_range(type, min, max, normal);
|
p.set_range(type, min, max, normal);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Evoral {
|
||||||
template<typename Time>
|
template<typename Time>
|
||||||
class Note {
|
class Note {
|
||||||
public:
|
public:
|
||||||
Note(uint8_t chan=0, Time time=0, EventLength len=0, uint8_t note=0, uint8_t vel=0x40);
|
Note(uint8_t chan=0, Time time=0, Time len=0, uint8_t note=0, uint8_t vel=0x40);
|
||||||
Note(const Note<Time>& copy);
|
Note(const Note<Time>& copy);
|
||||||
~Note();
|
~Note();
|
||||||
|
|
||||||
|
|
@ -50,17 +50,17 @@ public:
|
||||||
inline Time end_time() const { return _off_event.time(); }
|
inline Time end_time() const { return _off_event.time(); }
|
||||||
inline uint8_t note() const { return _on_event.note(); }
|
inline uint8_t note() const { return _on_event.note(); }
|
||||||
inline uint8_t velocity() const { return _on_event.velocity(); }
|
inline uint8_t velocity() const { return _on_event.velocity(); }
|
||||||
inline EventLength length() const { return _off_event.time() - _on_event.time(); }
|
inline Time length() const { return _off_event.time() - _on_event.time(); }
|
||||||
inline uint8_t channel() const {
|
inline uint8_t channel() const {
|
||||||
assert(_on_event.channel() == _off_event.channel());
|
assert(_on_event.channel() == _off_event.channel());
|
||||||
return _on_event.channel();
|
return _on_event.channel();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void set_time(Time t) { _off_event.time() = t + length(); _on_event.time() = t; }
|
inline void set_time(Time t) { _off_event.time() = t + length(); _on_event.time() = t; }
|
||||||
inline void set_note(uint8_t n) { _on_event.buffer()[1] = n; _off_event.buffer()[1] = n; }
|
inline void set_note(uint8_t n) { _on_event.buffer()[1] = n; _off_event.buffer()[1] = n; }
|
||||||
inline void set_velocity(uint8_t n) { _on_event.buffer()[2] = n; }
|
inline void set_velocity(uint8_t n) { _on_event.buffer()[2] = n; }
|
||||||
inline void set_length(EventLength l) { _off_event.time() = _on_event.time() + l; }
|
inline void set_length(Time l) { _off_event.time() = _on_event.time() + l; }
|
||||||
inline void set_channel(uint8_t c) { _on_event.set_channel(c); _off_event.set_channel(c); }
|
inline void set_channel(uint8_t c) { _on_event.set_channel(c); _off_event.set_channel(c); }
|
||||||
|
|
||||||
inline Event<Time>& on_event() { return _on_event; }
|
inline Event<Time>& on_event() { return _on_event; }
|
||||||
inline const Event<Time>& on_event() const { return _on_event; }
|
inline const Event<Time>& on_event() const { return _on_event; }
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,9 @@ public:
|
||||||
void end_write(bool delete_stuck=false);
|
void end_write(bool delete_stuck=false);
|
||||||
|
|
||||||
size_t read(EventSink<Time>& dst,
|
size_t read(EventSink<Time>& dst,
|
||||||
timestamp_t start,
|
Time start,
|
||||||
timedur_t length,
|
Time length,
|
||||||
timestamp_t stamp_offset) const;
|
Time stamp_offset) const;
|
||||||
|
|
||||||
/** Resizes vector if necessary (NOT realtime safe) */
|
/** Resizes vector if necessary (NOT realtime safe) */
|
||||||
void append(const Event<Time>& ev);
|
void append(const Event<Time>& ev);
|
||||||
|
|
@ -210,7 +210,7 @@ private:
|
||||||
ControlLists _dirty_controls;
|
ControlLists _dirty_controls;
|
||||||
|
|
||||||
const const_iterator _end_iter;
|
const const_iterator _end_iter;
|
||||||
mutable FrameTime _next_read;
|
mutable Time _next_read;
|
||||||
bool _percussive;
|
bool _percussive;
|
||||||
|
|
||||||
uint8_t _lowest_note;
|
uint8_t _lowest_note;
|
||||||
|
|
|
||||||
|
|
@ -27,15 +27,6 @@ namespace Evoral {
|
||||||
/** Frame count (i.e. length of time in audio frames) */
|
/** Frame count (i.e. length of time in audio frames) */
|
||||||
typedef uint32_t FrameTime;
|
typedef uint32_t FrameTime;
|
||||||
|
|
||||||
/** Time-stamp of an event */
|
|
||||||
typedef double timestamp_t;
|
|
||||||
|
|
||||||
/** Duration of time in timestamp_t units */
|
|
||||||
typedef timestamp_t timedur_t;
|
|
||||||
|
|
||||||
/** Time stamp of an event */
|
|
||||||
typedef double EventLength;
|
|
||||||
|
|
||||||
/** Type of an event (opaque, mapped by application) */
|
/** Type of an event (opaque, mapped by application) */
|
||||||
typedef uint32_t EventType;
|
typedef uint32_t EventType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Evoral {
|
namespace Evoral {
|
||||||
|
|
||||||
template<typename Time>
|
template<typename Time>
|
||||||
Note<Time>::Note(uint8_t chan, Time t, EventLength l, uint8_t n, uint8_t v)
|
Note<Time>::Note(uint8_t chan, Time t, Time l, uint8_t n, uint8_t v)
|
||||||
// FIXME: types?
|
// FIXME: types?
|
||||||
: _on_event(0xDE, t, 3, NULL, true)
|
: _on_event(0xDE, t, 3, NULL, true)
|
||||||
, _off_event(0xAD, t + l, 3, NULL, true)
|
, _off_event(0xAD, t + l, 3, NULL, true)
|
||||||
|
|
|
||||||
|
|
@ -446,16 +446,16 @@ Sequence<Time>::Sequence(const TypeMap& type_map, size_t size)
|
||||||
assert( ! _end_iter._locked);
|
assert( ! _end_iter._locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Read events in frame range \a start .. \a start+cnt into \a dst,
|
/** Read events in frame range \a start .. \a (start + dur) into \a dst,
|
||||||
* adding \a offset to each event's timestamp.
|
* adding \a offset to each event's timestamp.
|
||||||
* \return number of events written to \a dst
|
* \return number of events written to \a dst
|
||||||
*/
|
*/
|
||||||
template<typename Time>
|
template<typename Time>
|
||||||
size_t
|
size_t
|
||||||
Sequence<Time>::read(EventSink<Time>& dst, timestamp_t start, timedur_t nframes, timestamp_t offset) const
|
Sequence<Time>::read(EventSink<Time>& dst, Time start, Time dur, Time offset) const
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SEQUENCE
|
#ifdef DEBUG_SEQUENCE
|
||||||
debugout << this << " read @ " << start << " * " << nframes << " + " << offset << endl;
|
debugout << this << " read @ " << start << " * " << dur << " + " << offset << endl;
|
||||||
debugout << this << " # notes: " << n_notes() << endl;
|
debugout << this << " # notes: " << n_notes() << endl;
|
||||||
debugout << this << " # controls: " << _controls.size() << endl;
|
debugout << this << " # controls: " << _controls.size() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -466,16 +466,16 @@ Sequence<Time>::read(EventSink<Time>& dst, timestamp_t start, timedur_t nframes,
|
||||||
#ifdef DEBUG_SEQUENCE
|
#ifdef DEBUG_SEQUENCE
|
||||||
debugout << "Repositioning iterator from " << _next_read << " to " << start << endl;
|
debugout << "Repositioning iterator from " << _next_read << " to " << start << endl;
|
||||||
#endif
|
#endif
|
||||||
_read_iter = const_iterator(*this, (double)start);
|
_read_iter = const_iterator(*this, start);
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG_SEQUENCE
|
#ifdef DEBUG_SEQUENCE
|
||||||
debugout << "Using cached iterator at " << _next_read << endl;
|
debugout << "Using cached iterator at " << _next_read << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
_next_read = (FrameTime) floor (start + nframes);
|
_next_read = start + dur;
|
||||||
|
|
||||||
while (_read_iter != end() && _read_iter->time() < start + nframes) {
|
while (_read_iter != end() && _read_iter->time() < start + dur) {
|
||||||
assert(_read_iter->size() > 0);
|
assert(_read_iter->size() > 0);
|
||||||
assert(_read_iter->buffer());
|
assert(_read_iter->buffer());
|
||||||
dst.write(_read_iter->time() + offset,
|
dst.write(_read_iter->time() + offset,
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ SequenceTest::preserveEventOrderingTest (void)
|
||||||
TestSink<Time> sink;
|
TestSink<Time> sink;
|
||||||
sink.writing.connect(sigc::mem_fun(&sink, &TestSink<Time>::assertLastEventTimeEarlier));
|
sink.writing.connect(sigc::mem_fun(&sink, &TestSink<Time>::assertLastEventTimeEarlier));
|
||||||
|
|
||||||
seq->read(sink, timestamp_t(0), timedur_t(1200), timestamp_t(0));
|
seq->read(sink, 0, 1200, 0);
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(size_t(12), test_notes.size());
|
CPPUNIT_ASSERT_EQUAL(size_t(12), test_notes.size());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue