21 #ifdef EVORAL_MIDI_XML
29 #ifdef EVORAL_MIDI_XML
31 template<
typename Time>
32 MIDIEvent<Time>::MIDIEvent(
const XMLNode& event)
35 string name =
event.name();
37 if (name ==
"ControlChange") {
38 this->_buf = (uint8_t*) ::malloc(3);
39 this->_owns_buf =
true;
44 }
else if (name ==
"ProgramChange") {
45 this->_buf = (uint8_t*) ::malloc(2);
46 this->_owns_buf =
true;
54 template<
typename Time>
56 MIDIEvent<Time>::to_xml()
const
62 result =
new XMLNode(
"ControlChange");
69 result =
new XMLNode(
"ProgramChange");
82 result =
new XMLNode(
"NoteOff");
89 result =
new XMLNode(
"PitchBendChange");
91 result->
add_property(
"Value",
long(pitch_bender_value()));
96 result =
new XMLNode(
"NotImplemented");
103 #endif // EVORAL_MIDI_XML
105 template class MIDIEvent<Evoral::Beats>;
int atoi(const string &s)
#define MIDI_CMD_NOTE_OFF
const std::string & value() const
#define MIDI_CMD_PGM_CHANGE
XMLProperty * property(const char *)
XMLProperty * add_property(const char *name, const std::string &value)