aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-07-09 10:42:47 +0000
committerMax Horn2008-07-09 10:42:47 +0000
commitd24e7706057aaf5d20c31d6eebf6e55440cfb20a (patch)
tree3bc2c33f83f9631536c49f8c076af06df1b56a97
parenta294d222136a72534871d2030f828891762146ed (diff)
downloadscummvm-rg350-d24e7706057aaf5d20c31d6eebf6e55440cfb20a.tar.gz
scummvm-rg350-d24e7706057aaf5d20c31d6eebf6e55440cfb20a.tar.bz2
scummvm-rg350-d24e7706057aaf5d20c31d6eebf6e55440cfb20a.zip
cleanup / code formatting
svn-id: r32973
-rw-r--r--sound/midiparser_smf.cpp25
-rw-r--r--sound/midiparser_xmidi.cpp22
2 files changed, 35 insertions, 12 deletions
diff --git a/sound/midiparser_smf.cpp b/sound/midiparser_smf.cpp
index ed5007ecb7..89b7d3f525 100644
--- a/sound/midiparser_smf.cpp
+++ b/sound/midiparser_smf.cpp
@@ -85,16 +85,26 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
_position._running_status = info.event;
switch (info.command()) {
- case 0xC: case 0xD:
+ case 0x9: // Note On
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = *(_position._play_pos++);
+ if (info.basic.param2 == 0)
+ info.event = info.channel() | 0x80;
+ info.length = 0;
+ break;
+
+ case 0xC:
+ case 0xD:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
- case 0x8: case 0x9: case 0xA: case 0xB: case 0xE:
+ case 0x8:
+ case 0xA:
+ case 0xB:
+ case 0xE:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++);
- if (info.command() == 0x9 && info.basic.param2 == 0)
- info.event = info.channel() | 0x80;
info.length = 0;
break;
@@ -110,7 +120,12 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
info.basic.param2 = 0;
break;
- case 0x6: case 0x8: case 0xA: case 0xB: case 0xC: case 0xE:
+ case 0x6:
+ case 0x8:
+ case 0xA:
+ case 0xB:
+ case 0xC:
+ case 0xE:
info.basic.param1 = info.basic.param2 = 0;
break;
diff --git a/sound/midiparser_xmidi.cpp b/sound/midiparser_xmidi.cpp
index f28c824a8e..7cf114dcc6 100644
--- a/sound/midiparser_xmidi.cpp
+++ b/sound/midiparser_xmidi.cpp
@@ -86,11 +86,19 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
}
break;
- case 0xC: case 0xD:
+ case 0xC:
+ case 0xD:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = 0;
break;
+ case 0x8:
+ case 0xA:
+ case 0xE:
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = *(_position._play_pos++);
+ break;
+
case 0xB:
info.basic.param1 = *(_position._play_pos++);
info.basic.param2 = *(_position._play_pos++);
@@ -128,11 +136,6 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
}
break;
- case 0x8: case 0xA: case 0xE:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
- break;
-
case 0xF: // Meta or SysEx event
switch (info.event & 0x0F) {
case 0x2: // Song Position Pointer
@@ -145,7 +148,12 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
info.basic.param2 = 0;
break;
- case 0x6: case 0x8: case 0xA: case 0xB: case 0xC: case 0xE:
+ case 0x6:
+ case 0x8:
+ case 0xA:
+ case 0xB:
+ case 0xC:
+ case 0xE:
info.basic.param1 = info.basic.param2 = 0;
break;