aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2003-12-11 14:38:43 +0000
committerJonathan Gray2003-12-11 14:38:43 +0000
commit7c320d63de7032886f6c8022805501359ffec66e (patch)
tree9e401c3e78ac4a15207abee5ae86bd9fd3dd3a06
parent3174cef1273fb3ff266e8a06f3f89cdd7751855d (diff)
downloadscummvm-rg350-7c320d63de7032886f6c8022805501359ffec66e.tar.gz
scummvm-rg350-7c320d63de7032886f6c8022805501359ffec66e.tar.bz2
scummvm-rg350-7c320d63de7032886f6c8022805501359ffec66e.zip
add config file parameter to specify the desired port when using the ALSA music driver
svn-id: r11583
-rw-r--r--README5
-rw-r--r--backends/midi/alsa.cpp6
-rw-r--r--base/gameDetector.cpp3
3 files changed, 11 insertions, 3 deletions
diff --git a/README b/README
index 6f750d5949..279e6b6ea4 100644
--- a/README
+++ b/README
@@ -629,7 +629,8 @@ sequencer support does not work, you can always fall back on Adlib emulation.
7.4.1 Playing sound with ALSA sequencer: [UNIX ONLY]
----- ----------------------------------
If you have installed the ALSA driver with the sequencer support, then
-set the environment variable "SCUMMVM_PORT" to your sequencer port - e.g. 65:0
+set the environment variable SCUMMVM_PORT or the config file parameter
+alsa_port to your sequencer port. The default is "65:0".
Here is a little howto on how to use the ALSA sequencer with your soundcard.
In all cases, to have a list of all the sequencer ports you have, try the
@@ -825,6 +826,8 @@ The following keywords are recognized:
joystick_num number Number of joystick device to use for input
master_volume number The master volume setting (0-255)
music_driver string The music engine to use.
+ alsa_port string Port to use for output when using the
+ ALSA music driver.
music_volume number The music volume setting (0-255)
multi_midi bool If true, enable combination Adlib and native
MIDI.
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 7d2c7a7032..f8329621a9 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -29,6 +29,8 @@
#include "stdafx.h"
#include "common/util.h"
+#include "common/config-manager.h"
+
#include <alsa/asoundlib.h>
/*
@@ -84,8 +86,8 @@ int MidiDriver_ALSA::open() {
_isOpen = true;
if (!(var = getenv("SCUMMVM_PORT"))) {
- // default alsa port if none specified
- if (parse_addr("65:0", &seq_client, &seq_port) < 0) {
+ // use config option if no var specified
+ if (parse_addr(ConfMan.get("alsa_port").c_str(), &seq_client, &seq_port) < 0) {
error("Invalid port %s", var);
return -1;
}
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index 3f2f05da85..d597ee8e33 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -177,6 +177,9 @@ GameDetector::GameDetector() {
ConfMan.registerDefault("debuglevel", 0);
ConfMan.registerDefault("joystick_num", -1);
ConfMan.registerDefault("confirm_exit", false);
+#ifdef USE_ALSA
+ ConfMan.registerDefault("alsa_port", "65:0");
+#endif
_dumpScripts = false;