aboutsummaryrefslogtreecommitdiff
path: root/scumm/imuse.cpp
diff options
context:
space:
mode:
authorMax Horn2005-05-25 09:32:19 +0000
committerMax Horn2005-05-25 09:32:19 +0000
commit83a3507507a71fd1d030d756c5883eb8cd0bcdcc (patch)
tree827bac86dd9d08360cc77853a026ad703cdda698 /scumm/imuse.cpp
parent7afc24881dfbb6bad7c367a19996abe246640da0 (diff)
downloadscummvm-rg350-83a3507507a71fd1d030d756c5883eb8cd0bcdcc.tar.gz
scummvm-rg350-83a3507507a71fd1d030d756c5883eb8cd0bcdcc.tar.bz2
scummvm-rg350-83a3507507a71fd1d030d756c5883eb8cd0bcdcc.zip
Changed misleading 'isGM' name to 'isMIDI'; cleanup in the isMIDI/isMT32 methods
svn-id: r18248
Diffstat (limited to 'scumm/imuse.cpp')
-rw-r--r--scumm/imuse.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index c3788fa58b..29b4daca76 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -32,6 +32,7 @@
#include "scumm/instrument.h"
#include "scumm/saveload.h"
#include "scumm/scumm.h"
+#include "scumm/util.h"
#include "sound/mididrv.h"
@@ -95,7 +96,7 @@ byte *IMuseInternal::findStartOfSound(int sound) {
ptr += 4;
// Okay, we're looking for one of those things: either
- // an 'MThd' tag(for SMF), or a 'FORM' tag(for XMIDI).
+ // an 'MThd' tag (for SMF), or a 'FORM' tag (for XMIDI).
size = 48; // Arbitrary; we should find our tag within the first 48 bytes of the resource
pos = 0;
while (pos < size) {
@@ -122,16 +123,15 @@ bool IMuseInternal::isMT32(int sound) {
switch (tag) {
case MKID('ADL '):
case MKID('ASFX'): // Special AD class for old Adlib sound effects
+ case MKID('SPK '):
return false;
+
case MKID('AMI '):
- return true;
case MKID('ROL '):
- return true;
- case MKID('GMD '):
- return false;
case MKID('MAC '):
return true;
- case MKID('SPK '):
+
+ case MKID('GMD '):
return false;
}
@@ -142,10 +142,12 @@ bool IMuseInternal::isMT32(int sound) {
if (ptr[8] == 'S' && ptr[9] == 'O')
return false;
+ warning("Unknown music type: '%s'", tag2str(tag));
+
return false;
}
-bool IMuseInternal::isGM(int sound) {
+bool IMuseInternal::isMIDI(int sound) {
byte *ptr = NULL;
uint32 tag;
@@ -159,19 +161,17 @@ bool IMuseInternal::isGM(int sound) {
switch (tag) {
case MKID('ADL '):
case MKID('ASFX'): // Special AD class for old Adlib sound effects
+ case MKID('SPK '):
+ return false;
return false;
case MKID('AMI '):
- return true; // Yeah... for our purposes, this is GM
case MKID('ROL '):
- return true; // Yeah... for our purposes, this is GM
- case MKID('GMD '):
+ case MKID('MAC '):
return true;
+
+ case MKID('GMD '):
case MKID('MIDI'):
return true;
- case MKID('MAC '):
- return true; // I guess this one too, since it qualifies under isMT32()
- case MKID('SPK '):
- return false;
}
// Old style 'RO' has equivalent properties to 'ROL'
@@ -182,13 +182,15 @@ bool IMuseInternal::isGM(int sound) {
if (ptr[8] == 'S' && ptr[9] == 'O')
return true;
+ warning("Unknown music type: '%s'", tag2str(tag));
+
return false;
}
MidiDriver *IMuseInternal::getBestMidiDriver(int sound) {
MidiDriver *driver = NULL;
- if (isGM(sound)) {
+ if (isMIDI(sound)) {
if (_midi_native) {
driver = _midi_native;
} else {
@@ -1736,7 +1738,7 @@ void Part::init() {
void Part::setup(Player *player) {
_player = player;
- _percussion = (player->isGM() && _chan == 9); // true;
+ _percussion = (player->isMIDI() && _chan == 9); // true;
_on = true;
_pri_eff = player->getPriority();
_pri = 0;