* added XML deserialisation for control and program changes

* added pointer checks
* fixed typos in comments


git-svn-id: svn://localhost/ardour2/branches/3.0@4234 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Baier 2008-11-22 15:40:19 +00:00
parent 5de817c250
commit 2f07b77503
4 changed files with 39 additions and 23 deletions

View file

@ -22,14 +22,24 @@ namespace Evoral {
#ifdef EVORAL_MIDI_XML
MIDIEvent::MIDIEvent(const XMLNode& event)
MIDIEvent::MIDIEvent(const XMLNode& event)
: Event()
{
string name = event.name();
if (name == "ControlChange") {
_buffer = (uint8_t*) ::malloc(3);
_owns_buffer = true;
set_type(MIDI_CMD_CONTROL);
set_cc_number(atoi(event.property("Control")->value().c_str()));
set_cc_value (atoi(event.property("Value")->value().c_str()));
} else if (name == "ProgramChange") {
_buffer = (uint8_t*) ::malloc(2);
_owns_buffer = true;
set_type(MIDI_CMD_PGM_CHANGE);
set_pgm_number(atoi(event.property("Number")->value().c_str()));
}
}