summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2012-10-10 04:31:59 +0000
committerHans Baier <hansfbaier@googlemail.com>2012-10-10 04:31:59 +0000
commit3f5c6f81906c40b34c9fca76184854a45d53cc3a (patch)
tree6e92a8aa63500f10ce93de5f04c9ab369ee386e2 /libs/evoral
parentf8b7687f78e9a12b9386dde2585c4abfff6a224e (diff)
enable and extend EVORAL_MIDI_XML. Useful for Debugging. Any objections?
git-svn-id: svn://localhost/ardour2/branches/3.0@13223 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/src/MIDIEvent.cpp22
-rw-r--r--libs/evoral/wscript4
2 files changed, 24 insertions, 2 deletions
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')