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:
David Robillard 2009-02-14 23:41:05 +00:00
parent d0cc3120ae
commit de2681f7cd
7 changed files with 22 additions and 33 deletions

View file

@ -117,15 +117,11 @@ EventTypeMap::interpolation_of(const Evoral::Parameter& param)
case MIDI_CTL_OMNI_ON:
case MIDI_CTL_MONO:
case MIDI_CTL_POLY:
return Evoral::ControlList::Discrete;
break;
default: return Evoral::ControlList::Linear; break;
}
break;
case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break;
case MidiChannelPressureAutomation: 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;
case MidiPitchBenderAutomation:
Evoral::MIDI::bender_range(min, max, normal); break;
case MidiSystemExclusiveAutomation:
return p;
}
p.set_range(type, min, max, normal);

View file

@ -32,7 +32,7 @@ namespace Evoral {
template<typename Time>
class Note {
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();
@ -50,7 +50,7 @@ public:
inline Time end_time() const { return _off_event.time(); }
inline uint8_t note() const { return _on_event.note(); }
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 {
assert(_on_event.channel() == _off_event.channel());
return _on_event.channel();
@ -59,7 +59,7 @@ public:
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_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 Event<Time>& on_event() { return _on_event; }

View file

@ -81,9 +81,9 @@ public:
void end_write(bool delete_stuck=false);
size_t read(EventSink<Time>& dst,
timestamp_t start,
timedur_t length,
timestamp_t stamp_offset) const;
Time start,
Time length,
Time stamp_offset) const;
/** Resizes vector if necessary (NOT realtime safe) */
void append(const Event<Time>& ev);
@ -210,7 +210,7 @@ private:
ControlLists _dirty_controls;
const const_iterator _end_iter;
mutable FrameTime _next_read;
mutable Time _next_read;
bool _percussive;
uint8_t _lowest_note;

View file

@ -27,15 +27,6 @@ namespace Evoral {
/** Frame count (i.e. length of time in audio frames) */
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) */
typedef uint32_t EventType;

View file

@ -22,7 +22,7 @@
namespace Evoral {
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?
: _on_event(0xDE, t, 3, NULL, true)
, _off_event(0xAD, t + l, 3, NULL, true)

View file

@ -446,16 +446,16 @@ Sequence<Time>::Sequence(const TypeMap& type_map, size_t size)
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.
* \return number of events written to \a dst
*/
template<typename Time>
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
debugout << this << " read @ " << start << " * " << nframes << " + " << offset << endl;
debugout << this << " read @ " << start << " * " << dur << " + " << offset << endl;
debugout << this << " # notes: " << n_notes() << endl;
debugout << this << " # controls: " << _controls.size() << endl;
#endif
@ -466,16 +466,16 @@ Sequence<Time>::read(EventSink<Time>& dst, timestamp_t start, timedur_t nframes,
#ifdef DEBUG_SEQUENCE
debugout << "Repositioning iterator from " << _next_read << " to " << start << endl;
#endif
_read_iter = const_iterator(*this, (double)start);
_read_iter = const_iterator(*this, start);
} else {
#ifdef DEBUG_SEQUENCE
debugout << "Using cached iterator at " << _next_read << endl;
#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->buffer());
dst.write(_read_iter->time() + offset,

View file

@ -54,7 +54,7 @@ SequenceTest::preserveEventOrderingTest (void)
TestSink<Time> sink;
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());