add config file parameter to specify the desired port when using the ALSA music driver

svn-id: r11583
This commit is contained in:
Jonathan Gray 2003-12-11 14:38:43 +00:00
parent 3174cef127
commit 7c320d63de
3 changed files with 11 additions and 3 deletions

5
README
View file

@ -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.

View file

@ -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;
}

View file

@ -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;