diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/wscript | 3 | ||||
-rw-r--r-- | libs/evoral/src/MIDIEvent.cpp | 22 | ||||
-rw-r--r-- | libs/evoral/wscript | 4 |
3 files changed, 26 insertions, 3 deletions
diff --git a/libs/ardour/wscript b/libs/ardour/wscript index fd572c6a2e..3a61df11d7 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -373,7 +373,8 @@ def build(bld): 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', 'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"', - 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"' + 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"', + 'EVORAL_MIDI_XML=1' ] #obj.source += ' st_stretch.cc st_pitch.cc ' diff --git a/libs/evoral/src/MIDIEvent.cpp b/libs/evoral/src/MIDIEvent.cpp index 53dfbbc423..68236747d2 100644 --- a/libs/evoral/src/MIDIEvent.cpp +++ b/libs/evoral/src/MIDIEvent.cpp @@ -71,8 +71,29 @@ MIDIEvent<Time>::to_xml() const result->add_property("Number", long(pgm_number())); break; + case MIDI_CMD_NOTE_ON: + result = new XMLNode("NoteOn"); + result->add_property("Channel", long(channel())); + result->add_property("Note", long(note())); + result->add_property("Velocity", long(velocity())); + break; + + case MIDI_CMD_NOTE_OFF: + result = new XMLNode("NoteOff"); + result->add_property("Channel", long(channel())); + result->add_property("Note", long(note())); + result->add_property("Velocity", long(velocity())); + break; + + case MIDI_CMD_BENDER: + result = new XMLNode("PitchBendChange"); + result->add_property("Channel", long(channel())); + result->add_property("Value", long(pitch_bender_value())); + break; + default: // The implementation is continued as needed + result = new XMLNode("NotImplemented"); break; } @@ -82,6 +103,7 @@ MIDIEvent<Time>::to_xml() const #endif // EVORAL_MIDI_XML template class MIDIEvent<Evoral::MusicalTime>; +template class MIDIEvent<long long>; } // namespace Evoral diff --git a/libs/evoral/wscript b/libs/evoral/wscript index 9cc0356c7f..bfb081217f 100644 --- a/libs/evoral/wscript +++ b/libs/evoral/wscript @@ -98,7 +98,7 @@ def build(bld): obj.use = 'libsmf libpbd' obj.vnum = EVORAL_LIB_VERSION obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3') - obj.defines = ['PACKAGE="libevoral"' ] + obj.defines = ['PACKAGE="libevoral"', 'EVORAL_MIDI_XML=1' ] if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'): # Static library (for unit test code coverage) @@ -117,7 +117,7 @@ def build(bld): obj.linkflags = '-lgcov' obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ] - obj.defines = ['PACKAGE="libevoral"' ] + obj.defines = ['PACKAGE="libevoral"', 'EVORAL_MIDI_XML=1' ] # Unit tests obj = bld(features = 'cxx cxxprogram') |