Move event specific ringbuffer stuff to evoral.
Sane event type interface between evoral and libardour (no more shared magic numbers). Cleanup Evoral::Sequence iterator, fix bugs, probably introduce new ones. Move MIDI specific event functions to Evoral::MIDIEvent (is-a Evoral::Event). git-svn-id: svn://localhost/ardour2/branches/3.0@3785 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -20,9 +20,11 @@
|
||||
|
||||
namespace Evoral {
|
||||
|
||||
#ifdef EVENT_ALLOW_ALLOC
|
||||
Event::Event(double t, uint32_t s, uint8_t* b, bool owns_buffer)
|
||||
: _time(t)
|
||||
#ifdef EVORAL_EVENT_ALLOC
|
||||
|
||||
Event::Event(uint32_t tid, EventTime t, uint32_t s, uint8_t* b, bool owns_buffer)
|
||||
: _type(tid)
|
||||
, _time(t)
|
||||
, _size(s)
|
||||
, _buffer(b)
|
||||
, _owns_buffer(owns_buffer)
|
||||
@@ -38,7 +40,8 @@ Event::Event(double t, uint32_t s, uint8_t* b, bool owns_buffer)
|
||||
}
|
||||
|
||||
Event::Event(const Event& copy, bool owns_buffer)
|
||||
: _time(copy._time)
|
||||
: _type(copy._type)
|
||||
, _time(copy._time)
|
||||
, _size(copy._size)
|
||||
, _buffer(copy._buffer)
|
||||
, _owns_buffer(owns_buffer)
|
||||
@@ -59,49 +62,7 @@ Event::~Event() {
|
||||
}
|
||||
}
|
||||
|
||||
#endif // EVENT_ALLOW_ALLOC
|
||||
|
||||
#ifdef EVENT_WITH_XML
|
||||
|
||||
Event::Event(const XMLNode& event)
|
||||
{
|
||||
string name = event.name();
|
||||
|
||||
if (name == "ControlChange") {
|
||||
|
||||
} else if (name == "ProgramChange") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr<XMLNode>
|
||||
Event::to_xml() const
|
||||
{
|
||||
XMLNode *result = 0;
|
||||
|
||||
switch (type()) {
|
||||
case MIDI_CMD_CONTROL:
|
||||
result = new XMLNode("ControlChange");
|
||||
result->add_property("Channel", channel());
|
||||
result->add_property("Control", cc_number());
|
||||
result->add_property("Value", cc_value());
|
||||
break;
|
||||
|
||||
case MIDI_CMD_PGM_CHANGE:
|
||||
result = new XMLNode("ProgramChange");
|
||||
result->add_property("Channel", channel());
|
||||
result->add_property("Number", pgm_number());
|
||||
break;
|
||||
|
||||
default:
|
||||
// The implementation is continued as needed
|
||||
break;
|
||||
}
|
||||
|
||||
return boost::shared_ptr<XMLNode>(result);
|
||||
}
|
||||
#endif // EVENT_WITH_XML
|
||||
#endif // EVORAL_EVENT_ALLOC
|
||||
|
||||
} // namespace MIDI
|
||||
|
||||
|
||||
Reference in New Issue
Block a user