From 40820eebf561d1a7c35f07151d534253ad2a7ea5 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Tue, 17 Mar 2015 10:23:25 +0100 Subject: AUDIO: Add experimental hardware OPL support using ALSA --- audio/fmopl.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'audio/fmopl.cpp') diff --git a/audio/fmopl.cpp b/audio/fmopl.cpp index b0b3273e82..ded450629d 100644 --- a/audio/fmopl.cpp +++ b/audio/fmopl.cpp @@ -34,12 +34,21 @@ namespace OPL { +// Factory functions + +#ifdef USE_ALSA +namespace ALSA { + OPL *create(Config::OplType type); +} // End of namespace ALSA +#endif // USE_ALSA + // Config implementation enum OplEmulator { kAuto = 0, kMame = 1, - kDOSBox = 2 + kDOSBox = 2, + kALSA = 3 }; OPL::OPL() { @@ -53,6 +62,9 @@ const Config::EmulatorDescription Config::_drivers[] = { { "mame", _s("MAME OPL emulator"), kMame, kFlagOpl2 }, #ifndef DISABLE_DOSBOX_OPL { "db", _s("DOSBox OPL emulator"), kDOSBox, kFlagOpl2 | kFlagDualOpl2 | kFlagOpl3 }, +#endif +#ifdef USE_ALSA + { "alsa", _s("ALSA Direct FM"), kALSA, kFlagOpl2 | kFlagDualOpl2 }, #endif { 0, 0, 0, 0 } }; @@ -166,6 +178,11 @@ OPL *Config::create(DriverId driver, OplType type) { return new DOSBox::OPL(type); #endif +#ifdef USE_ALSA + case kALSA: + return ALSA::create(type); +#endif + default: warning("Unsupported OPL emulator %d", driver); // TODO: Maybe we should add some dummy emulator too, which just outputs -- cgit v1.2.3