aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-11-25 14:24:12 +0100
committerHarald Eilertsen <haraldei@anduin.net>2020-11-25 14:24:12 +0100
commit813f84fb7c8106e104aaeea2e680a381de7d4349 (patch)
treec5b3e358d67609d6aca63b90fd83d0f88a085558
parent2dcf649c6c125083ac4c5bd93de89850a8cdaea7 (diff)
downloadcbconv-813f84fb7c8106e104aaeea2e680a381de7d4349.tar.gz
cbconv-813f84fb7c8106e104aaeea2e680a381de7d4349.tar.bz2
cbconv-813f84fb7c8106e104aaeea2e680a381de7d4349.zip
Drop terminating null byte from node value tags.
No longer needed after cmstring strips the null terminator.
-rw-r--r--src/main.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs
index 4bcc7a5..eb1e241 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -191,60 +191,60 @@ fn node_value<'a>(class: &str, data: &'a [u8]) -> IResult<&'a [u8], NodeValue<'a
let (r, appver) = p_appversion(&data)?;
Ok((r, NodeValue::Version(appver)))
},
- "PArrangement\0" => {
+ "PArrangement" => {
let (r, arr) = p_arrangement(&data)?;
Ok((r, NodeValue::Arrangement(arr)))
},
- "MRoot\0" |
- "MTrackList\0" => {
+ "MRoot" |
+ "MTrackList" => {
let (r, v) = counted_vec(&data)?;
Ok((r, NodeValue::Raw(v)))
},
- "MInstrumentTrackEvent\0" => {
+ "MInstrumentTrackEvent" => {
let (r, e) = m_instrument_track_event(&data)?;
Ok((r, NodeValue::InstrumentTrackEvent(e)))
},
- "MTempoTrackEvent\0" => {
+ "MTempoTrackEvent" => {
let (r, e) = m_tempo_track_event(&data)?;
Ok((r, NodeValue::TempoTrackEvent(e)))
},
- "MSignatureTrackEvent\0" => {
+ "MSignatureTrackEvent" => {
let (r, e) = m_signature_track_event(&data)?;
Ok((r, NodeValue::SignatureTrackEvent(e)))
},
- "MMidiPartEvent\0" => {
+ "MMidiPartEvent" => {
let (r, v) = count(be_u8, 30)(data)?;
Ok((r, NodeValue::MidiPartEvent(v)))
},
- "MMidiPart\0" => {
+ "MMidiPart" => {
let (r, v) = m_midi_part(&data)?;
Ok((r, NodeValue::MidiPart(v)))
},
- "MMidiNote\0" => {
+ "MMidiNote" => {
let (r, v) = be_u32(data)?;
Ok((r, NodeValue::MidiNote(v)))
},
- "MMidiPolyPressure\0" => {
+ "MMidiPolyPressure" => {
let (r, v) = be_u32(data)?;
Ok((r, NodeValue::MidiPolyPressure(v)))
},
- "MMidiAfterTouch\0" => {
+ "MMidiAfterTouch" => {
let (r, v) = be_u32(data)?;
Ok((r, NodeValue::MidiAfterTouch(v)))
},
- "MMidiProgramChange\0" => {
+ "MMidiProgramChange" => {
let (r, v) = be_u32(data)?;
Ok((r, NodeValue::MidiProgramChange(v)))
},
- "MMidiController\0" => {
+ "MMidiController" => {
let (r, v) = be_u32(data)?;
Ok((r, NodeValue::MidiController(v)))
},
- "MMidiPitchBend\0" => {
+ "MMidiPitchBend" => {
let (r, v) = be_u32(data)?;
Ok((r, NodeValue::MidiPitchBend(v)))
},
- "MMidiSysex\0" => {
+ "MMidiSysex" => {
let sep = vec![0xff, 0xff, 0xff, 0xff];
let (r, v) = take_until(sep.as_slice())(data)?;
Ok((r, NodeValue::MidiSysex(v.to_vec())))