aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-12-25 18:34:44 +0000
committerMax Horn2004-12-25 18:34:44 +0000
commitfec3df209601b812034fafed53ef74b7ee732512 (patch)
tree14572de096e66b3720faf67dbd9d3cf3f3926422
parent0d2fa6ecf02d5745db90d78c78e546b3fe62d373 (diff)
downloadscummvm-rg350-fec3df209601b812034fafed53ef74b7ee732512.tar.gz
scummvm-rg350-fec3df209601b812034fafed53ef74b7ee732512.tar.bz2
scummvm-rg350-fec3df209601b812034fafed53ef74b7ee732512.zip
Moved the softsynth midi drivers into a sound/softsynth; amongst other things, this fixes bug #1083058
svn-id: r16316
-rw-r--r--Makefile.common2
-rw-r--r--TODO5
-rw-r--r--backends/midi/mt32/module.mk17
-rw-r--r--backends/module.mk10
-rw-r--r--base/main.cpp55
-rwxr-xr-xconfigure1
-rw-r--r--sound/mididrv.cpp51
-rw-r--r--sound/module.mk9
-rw-r--r--sound/softsynth/.cvsignore (renamed from backends/midi/mt32/.cvsignore)0
-rw-r--r--sound/softsynth/adlib.cpp (renamed from backends/midi/adlib.cpp)2
-rw-r--r--sound/softsynth/emumidi.h (renamed from backends/midi/emumidi.h)0
-rw-r--r--sound/softsynth/mt32.cpp (renamed from backends/midi/mt32.cpp)4
-rw-r--r--sound/softsynth/mt32/.cvsignore1
-rw-r--r--sound/softsynth/mt32/freeverb.cpp (renamed from backends/midi/mt32/freeverb.cpp)2
-rw-r--r--sound/softsynth/mt32/freeverb.h (renamed from backends/midi/mt32/freeverb.h)0
-rw-r--r--sound/softsynth/mt32/i386.cpp (renamed from backends/midi/mt32/i386.cpp)0
-rw-r--r--sound/softsynth/mt32/i386.h (renamed from backends/midi/mt32/i386.h)0
-rw-r--r--sound/softsynth/mt32/module.mk17
-rw-r--r--sound/softsynth/mt32/mt32_file.cpp (renamed from backends/midi/mt32/mt32_file.cpp)0
-rw-r--r--sound/softsynth/mt32/mt32_file.h (renamed from backends/midi/mt32/mt32_file.h)0
-rw-r--r--sound/softsynth/mt32/mt32emu.h (renamed from backends/midi/mt32/mt32emu.h)0
-rw-r--r--sound/softsynth/mt32/part.cpp (renamed from backends/midi/mt32/part.cpp)0
-rw-r--r--sound/softsynth/mt32/part.h (renamed from backends/midi/mt32/part.h)0
-rw-r--r--sound/softsynth/mt32/partial.cpp (renamed from backends/midi/mt32/partial.cpp)0
-rw-r--r--sound/softsynth/mt32/partial.h (renamed from backends/midi/mt32/partial.h)0
-rw-r--r--sound/softsynth/mt32/partialManager.cpp (renamed from backends/midi/mt32/partialManager.cpp)0
-rw-r--r--sound/softsynth/mt32/partialManager.h (renamed from backends/midi/mt32/partialManager.h)0
-rw-r--r--sound/softsynth/mt32/structures.h (renamed from backends/midi/mt32/structures.h)0
-rw-r--r--sound/softsynth/mt32/synth.cpp (renamed from backends/midi/mt32/synth.cpp)0
-rw-r--r--sound/softsynth/mt32/synth.h (renamed from backends/midi/mt32/synth.h)0
-rw-r--r--sound/softsynth/mt32/tables.cpp (renamed from backends/midi/mt32/tables.cpp)0
-rw-r--r--sound/softsynth/mt32/tables.h (renamed from backends/midi/mt32/tables.h)0
-rw-r--r--sound/softsynth/ym2612.cpp (renamed from backends/midi/ym2612.cpp)2
33 files changed, 84 insertions, 94 deletions
diff --git a/Makefile.common b/Makefile.common
index 65dc3953a1..2dff01a468 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -90,7 +90,7 @@ MODULES += \
common
ifdef USE_MT32EMU
-MODULES += backends/midi/mt32
+MODULES += sound/softsynth/mt32
endif
######################################################################
diff --git a/TODO b/TODO
index 7738aebcb2..439922d8b7 100644
--- a/TODO
+++ b/TODO
@@ -166,11 +166,6 @@ Audio
* Add "sound types" to the mixer; client code will be able to pass such a type
whenever registering an audio stream. Then, volume control will be changed
to be based on the sound type.
-* Move the 'softsynth' MIDI drivers (adlib, MT32, ym2612) from backends/midi
- to sound/ (or a new dir like sound/mididrivers or sound/softsynth).
- This would solve bug #1083058; it'd also be more logical, since the portable
- softsynths don't really belong into the backends/ dir, which is meant for
- platform specific code.
Config Manager
==============
diff --git a/backends/midi/mt32/module.mk b/backends/midi/mt32/module.mk
deleted file mode 100644
index 9f0594190f..0000000000
--- a/backends/midi/mt32/module.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-MODULE := backends/midi/mt32
-
-MODULE_OBJS := \
- backends/midi/mt32/mt32_file.o \
- backends/midi/mt32/i386.o \
- backends/midi/mt32/part.o \
- backends/midi/mt32/partial.o \
- backends/midi/mt32/partialManager.o \
- backends/midi/mt32/synth.o \
- backends/midi/mt32/tables.o \
- backends/midi/mt32/freeverb.o
-
-MODULE_DIRS += \
- backends/midi/mt32
-
-# Include common rules
-include $(srcdir)/common.rules
diff --git a/backends/module.mk b/backends/module.mk
index 07201bfca3..ca042772ba 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -5,23 +5,19 @@ MODULE_OBJS := \
backends/fs/posix/posix-fs.o \
backends/fs/morphos/abox-fs.o \
backends/fs/windows/windows-fs.o \
- backends/midi/adlib.o \
+ backends/midi/alsa.o \
backends/midi/coreaudio.o \
backends/midi/morphos.o \
backends/midi/null.o \
backends/midi/quicktime.o \
backends/midi/seq.o \
- backends/midi/alsa.o \
- backends/midi/windows.o \
- backends/midi/ym2612.o \
- backends/midi/mt32.o
+ backends/midi/windows.o
MODULE_DIRS += \
backends \
backends/fs/posix \
backends/fs/morphos \
- backends/fs/windows \
- backends/midi
+ backends/fs/windows
# Include common rules
include $(srcdir)/common.rules
diff --git a/base/main.cpp b/base/main.cpp
index 4b8875ae70..0dfa193fff 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -438,58 +438,3 @@ void free_check(void *ptr) {
}
#endif
*/
-
-
-// WORKAROUND bug # 1083058: We put this here and not in sound/mididrv.cpp
-// where it belongs to avoid the annoying behavior of some unix linkers (which
-// leads to linker errors due to too much code being stripped from the binary.
-MidiDriver *MidiDriver::createMidi(int midiDriver) {
- switch(midiDriver) {
- case MD_NULL: return MidiDriver_NULL_create();
-
- // In the case of Adlib, we won't specify anything.
- // IMuse is designed to set up its own Adlib driver
- // if need be, and we only have to specify a native
- // driver.
- case MD_ADLIB: return NULL;
-
-#ifdef USE_MT32EMU
- case MD_MT32: return MidiDriver_MT32_create(g_engine->_mixer);
-#endif
-
- case MD_TOWNS: return MidiDriver_YM2612_create(g_engine->_mixer);
-
- // Right now PC Speaker and PCjr are handled
- // outside the MidiDriver architecture, so
- // don't create anything for now.
- case MD_PCSPK:
- case MD_PCJR: return NULL;
-#if defined(__PALM_OS__)
- case MD_YPA1: return MidiDriver_YamahaPa1_create();
-#ifndef DISABLE_TAPWAVE
- case MD_ZODIAC: return MidiDriver_Zodiac_create();
-#endif
-#endif
-#if defined(WIN32) && !defined(_WIN32_WCE)
- case MD_WINDOWS: return MidiDriver_WIN_create();
-#endif
-#if defined(__MORPHOS__)
- case MD_ETUDE: return MidiDriver_ETUDE_create();
-#endif
-#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX)
- case MD_SEQ: return MidiDriver_SEQ_create();
-#endif
-#if (defined(MACOSX) || defined(macintosh)) && !defined(__PALM_OS__)
- case MD_QTMUSIC: return MidiDriver_QT_create();
-#endif
-#if defined(MACOSX)
- case MD_COREAUDIO: return MidiDriver_CORE_create();
-#endif
-#if defined(UNIX) && defined(USE_ALSA)
- case MD_ALSA: return MidiDriver_ALSA_create();
-#endif
- }
-
- error("Invalid midi driver selected");
- return NULL;
-}
diff --git a/configure b/configure
index 35f13d5aeb..6a4a52e8a7 100755
--- a/configure
+++ b/configure
@@ -811,7 +811,6 @@ if test "$_mt32emu" = no ; then
else
_def_mt32emu='#define USE_MT32EMU'
_mak_mt32emu='USE_MT32EMU = 1'
- INCLUDES="$INCLUDES -I\$(srcdir)/backends/midi/mt32"
fi
#
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index 9872cf65d0..11fa0d3b15 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -137,3 +137,54 @@ int MidiDriver::detectMusicDriver(int midiFlags) {
return musicDriver;
}
+
+MidiDriver *MidiDriver::createMidi(int midiDriver) {
+ switch(midiDriver) {
+ case MD_NULL: return MidiDriver_NULL_create();
+
+ // In the case of Adlib, we won't specify anything.
+ // IMuse is designed to set up its own Adlib driver
+ // if need be, and we only have to specify a native
+ // driver.
+ case MD_ADLIB: return NULL;
+
+#ifdef USE_MT32EMU
+ case MD_MT32: return MidiDriver_MT32_create(g_engine->_mixer);
+#endif
+
+ case MD_TOWNS: return MidiDriver_YM2612_create(g_engine->_mixer);
+
+ // Right now PC Speaker and PCjr are handled
+ // outside the MidiDriver architecture, so
+ // don't create anything for now.
+ case MD_PCSPK:
+ case MD_PCJR: return NULL;
+#if defined(__PALM_OS__)
+ case MD_YPA1: return MidiDriver_YamahaPa1_create();
+#ifndef DISABLE_TAPWAVE
+ case MD_ZODIAC: return MidiDriver_Zodiac_create();
+#endif
+#endif
+#if defined(WIN32) && !defined(_WIN32_WCE)
+ case MD_WINDOWS: return MidiDriver_WIN_create();
+#endif
+#if defined(__MORPHOS__)
+ case MD_ETUDE: return MidiDriver_ETUDE_create();
+#endif
+#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX)
+ case MD_SEQ: return MidiDriver_SEQ_create();
+#endif
+#if (defined(MACOSX) || defined(macintosh)) && !defined(__PALM_OS__)
+ case MD_QTMUSIC: return MidiDriver_QT_create();
+#endif
+#if defined(MACOSX)
+ case MD_COREAUDIO: return MidiDriver_CORE_create();
+#endif
+#if defined(UNIX) && defined(USE_ALSA)
+ case MD_ALSA: return MidiDriver_ALSA_create();
+#endif
+ }
+
+ error("Invalid midi driver selected");
+ return NULL;
+}
diff --git a/sound/module.mk b/sound/module.mk
index 12b5da5868..e5e409d416 100644
--- a/sound/module.mk
+++ b/sound/module.mk
@@ -14,11 +14,14 @@ MODULE_OBJS := \
sound/rate.o \
sound/voc.o \
sound/vorbis.o \
- sound/flac.o
-# sound/resample.o \
+ sound/flac.o \
+ sound/softsynth/adlib.o \
+ sound/softsynth/ym2612.o \
+ sound/softsynth/mt32.o \
MODULE_DIRS += \
- sound
+ sound \
+ sound/softsynth
# Include common rules
include $(srcdir)/common.rules
diff --git a/backends/midi/mt32/.cvsignore b/sound/softsynth/.cvsignore
index 39a06683b7..39a06683b7 100644
--- a/backends/midi/mt32/.cvsignore
+++ b/sound/softsynth/.cvsignore
diff --git a/backends/midi/adlib.cpp b/sound/softsynth/adlib.cpp
index 1c4e4cf35f..97967af89f 100644
--- a/backends/midi/adlib.cpp
+++ b/sound/softsynth/adlib.cpp
@@ -18,7 +18,7 @@
* $Header$
*/
-#include "emumidi.h"
+#include "sound/softsynth/emumidi.h"
#include "common/util.h"
#include "sound/fmopl.h"
diff --git a/backends/midi/emumidi.h b/sound/softsynth/emumidi.h
index 34cd4b0983..34cd4b0983 100644
--- a/backends/midi/emumidi.h
+++ b/sound/softsynth/emumidi.h
diff --git a/backends/midi/mt32.cpp b/sound/softsynth/mt32.cpp
index 8bf3807603..4789e46fc7 100644
--- a/backends/midi/mt32.cpp
+++ b/sound/softsynth/mt32.cpp
@@ -23,9 +23,9 @@
#ifdef USE_MT32EMU
-#include "backends/midi/mt32/mt32emu.h"
+#include "sound/softsynth/mt32/mt32emu.h"
-#include "backends/midi/emumidi.h"
+#include "sound/softsynth/emumidi.h"
#include "sound/mpu401.h"
#include "common/util.h"
diff --git a/sound/softsynth/mt32/.cvsignore b/sound/softsynth/mt32/.cvsignore
new file mode 100644
index 0000000000..39a06683b7
--- /dev/null
+++ b/sound/softsynth/mt32/.cvsignore
@@ -0,0 +1 @@
+.deps
diff --git a/backends/midi/mt32/freeverb.cpp b/sound/softsynth/mt32/freeverb.cpp
index df3e3bf2a2..0c366fe62f 100644
--- a/backends/midi/mt32/freeverb.cpp
+++ b/sound/softsynth/mt32/freeverb.cpp
@@ -31,7 +31,7 @@
// This code is public domain
#include "stdafx.h"
-#include "backends/midi/mt32/freeverb.h"
+#include "sound/softsynth/mt32/freeverb.h"
comb::comb() {
filterstore = 0;
diff --git a/backends/midi/mt32/freeverb.h b/sound/softsynth/mt32/freeverb.h
index d618f79670..d618f79670 100644
--- a/backends/midi/mt32/freeverb.h
+++ b/sound/softsynth/mt32/freeverb.h
diff --git a/backends/midi/mt32/i386.cpp b/sound/softsynth/mt32/i386.cpp
index e2e4b0f790..e2e4b0f790 100644
--- a/backends/midi/mt32/i386.cpp
+++ b/sound/softsynth/mt32/i386.cpp
diff --git a/backends/midi/mt32/i386.h b/sound/softsynth/mt32/i386.h
index c26fcb4110..c26fcb4110 100644
--- a/backends/midi/mt32/i386.h
+++ b/sound/softsynth/mt32/i386.h
diff --git a/sound/softsynth/mt32/module.mk b/sound/softsynth/mt32/module.mk
new file mode 100644
index 0000000000..2e48efa9d6
--- /dev/null
+++ b/sound/softsynth/mt32/module.mk
@@ -0,0 +1,17 @@
+MODULE := sound/softsynth/mt32
+
+MODULE_OBJS := \
+ sound/softsynth/mt32/mt32_file.o \
+ sound/softsynth/mt32/i386.o \
+ sound/softsynth/mt32/part.o \
+ sound/softsynth/mt32/partial.o \
+ sound/softsynth/mt32/partialManager.o \
+ sound/softsynth/mt32/synth.o \
+ sound/softsynth/mt32/tables.o \
+ sound/softsynth/mt32/freeverb.o
+
+MODULE_DIRS += \
+ sound/softsynth/mt32
+
+# Include common rules
+include $(srcdir)/common.rules
diff --git a/backends/midi/mt32/mt32_file.cpp b/sound/softsynth/mt32/mt32_file.cpp
index 8cf4e14a7d..8cf4e14a7d 100644
--- a/backends/midi/mt32/mt32_file.cpp
+++ b/sound/softsynth/mt32/mt32_file.cpp
diff --git a/backends/midi/mt32/mt32_file.h b/sound/softsynth/mt32/mt32_file.h
index 7ebb6449b6..7ebb6449b6 100644
--- a/backends/midi/mt32/mt32_file.h
+++ b/sound/softsynth/mt32/mt32_file.h
diff --git a/backends/midi/mt32/mt32emu.h b/sound/softsynth/mt32/mt32emu.h
index 9fffa721f5..9fffa721f5 100644
--- a/backends/midi/mt32/mt32emu.h
+++ b/sound/softsynth/mt32/mt32emu.h
diff --git a/backends/midi/mt32/part.cpp b/sound/softsynth/mt32/part.cpp
index 5aee1202b2..5aee1202b2 100644
--- a/backends/midi/mt32/part.cpp
+++ b/sound/softsynth/mt32/part.cpp
diff --git a/backends/midi/mt32/part.h b/sound/softsynth/mt32/part.h
index 1214ec52f9..1214ec52f9 100644
--- a/backends/midi/mt32/part.h
+++ b/sound/softsynth/mt32/part.h
diff --git a/backends/midi/mt32/partial.cpp b/sound/softsynth/mt32/partial.cpp
index 32ff9e9af7..32ff9e9af7 100644
--- a/backends/midi/mt32/partial.cpp
+++ b/sound/softsynth/mt32/partial.cpp
diff --git a/backends/midi/mt32/partial.h b/sound/softsynth/mt32/partial.h
index 0834a64c15..0834a64c15 100644
--- a/backends/midi/mt32/partial.h
+++ b/sound/softsynth/mt32/partial.h
diff --git a/backends/midi/mt32/partialManager.cpp b/sound/softsynth/mt32/partialManager.cpp
index 776276edda..776276edda 100644
--- a/backends/midi/mt32/partialManager.cpp
+++ b/sound/softsynth/mt32/partialManager.cpp
diff --git a/backends/midi/mt32/partialManager.h b/sound/softsynth/mt32/partialManager.h
index ee145d4c9f..ee145d4c9f 100644
--- a/backends/midi/mt32/partialManager.h
+++ b/sound/softsynth/mt32/partialManager.h
diff --git a/backends/midi/mt32/structures.h b/sound/softsynth/mt32/structures.h
index b04d98b0fd..b04d98b0fd 100644
--- a/backends/midi/mt32/structures.h
+++ b/sound/softsynth/mt32/structures.h
diff --git a/backends/midi/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp
index 1ba543b581..1ba543b581 100644
--- a/backends/midi/mt32/synth.cpp
+++ b/sound/softsynth/mt32/synth.cpp
diff --git a/backends/midi/mt32/synth.h b/sound/softsynth/mt32/synth.h
index 1501593cbd..1501593cbd 100644
--- a/backends/midi/mt32/synth.h
+++ b/sound/softsynth/mt32/synth.h
diff --git a/backends/midi/mt32/tables.cpp b/sound/softsynth/mt32/tables.cpp
index 4a17165733..4a17165733 100644
--- a/backends/midi/mt32/tables.cpp
+++ b/sound/softsynth/mt32/tables.cpp
diff --git a/backends/midi/mt32/tables.h b/sound/softsynth/mt32/tables.h
index 0c85796f4f..0c85796f4f 100644
--- a/backends/midi/mt32/tables.h
+++ b/sound/softsynth/mt32/tables.h
diff --git a/backends/midi/ym2612.cpp b/sound/softsynth/ym2612.cpp
index b4af3c6854..b9ad9b35ca 100644
--- a/backends/midi/ym2612.cpp
+++ b/sound/softsynth/ym2612.cpp
@@ -22,7 +22,7 @@
* $Header$
*/
-#include "emumidi.h"
+#include "sound/softsynth/emumidi.h"
#include <math.h>