summaryrefslogtreecommitdiff
path: root/src/setup/sound.c
diff options
context:
space:
mode:
authorSimon Howard2010-09-09 23:13:06 +0000
committerSimon Howard2010-09-09 23:13:06 +0000
commit120d90c67b2a4aa0a8883c4897241dee2222acd2 (patch)
treeb439e48483ebbd698c2daa6e24eeaaab1ba97470 /src/setup/sound.c
parent79268587fc730e17cbd974a5583c7185604b59a3 (diff)
parent22fc405736dc4796958de221c07d52432f1b271b (diff)
downloadchocolate-doom-120d90c67b2a4aa0a8883c4897241dee2222acd2.tar.gz
chocolate-doom-120d90c67b2a4aa0a8883c4897241dee2222acd2.tar.bz2
chocolate-doom-120d90c67b2a4aa0a8883c4897241dee2222acd2.zip
Merge from raven-branch.
Subversion-branch: /branches/strife-branch Subversion-revision: 2051
Diffstat (limited to 'src/setup/sound.c')
-rw-r--r--src/setup/sound.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/setup/sound.c b/src/setup/sound.c
index 45787eba..d8dc129e 100644
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -40,17 +40,18 @@ typedef enum
NUM_SFXMODES
} sfxmode_t;
-static char *sfxmode_strings[] =
+static char *sfxmode_strings[] =
{
"Disabled",
"Digital",
"PC speaker"
};
-typedef enum
+typedef enum
{
MUSICMODE_DISABLED,
- MUSICMODE_MIDI,
+ MUSICMODE_OPL,
+ MUSICMODE_NATIVE,
MUSICMODE_CD,
NUM_MUSICMODES
} musicmode_t;
@@ -58,15 +59,17 @@ typedef enum
static char *musicmode_strings[] =
{
"Disabled",
- "MIDI",
+ "OPL (Adlib/SB)",
+ "Native MIDI",
"CD audio"
};
// Config file variables:
int snd_sfxdevice = SNDDEVICE_SB;
-int snd_musicdevice = SNDDEVICE_SB;
+int snd_musicdevice = SNDDEVICE_GENMIDI;
int snd_samplerate = 22050;
+int opl_io_port = 0x388;
static int numChannels = 8;
static int sfxVolume = 15;
@@ -108,7 +111,10 @@ static void UpdateSndDevices(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(data))
case MUSICMODE_DISABLED:
snd_musicdevice = SNDDEVICE_NONE;
break;
- case MUSICMODE_MIDI:
+ case MUSICMODE_NATIVE:
+ snd_musicdevice = SNDDEVICE_GENMIDI;
+ break;
+ case MUSICMODE_OPL:
snd_musicdevice = SNDDEVICE_SB;
break;
case MUSICMODE_CD:
@@ -139,20 +145,26 @@ void ConfigSound(void)
{
snd_sfxmode = SFXMODE_DISABLED;
}
-
+
// Is music enabled?
- if (snd_musicdevice == SNDDEVICE_NONE)
+ if (snd_musicdevice == SNDDEVICE_GENMIDI)
{
- snd_musicmode = MUSICMODE_DISABLED;
+ snd_musicmode = MUSICMODE_NATIVE;
}
else if (snd_musicmode == SNDDEVICE_CD)
{
snd_musicmode = MUSICMODE_CD;
}
+ else if (snd_musicdevice == SNDDEVICE_SB
+ || snd_musicdevice == SNDDEVICE_ADLIB
+ || snd_musicdevice == SNDDEVICE_AWE32)
+ {
+ snd_musicmode = MUSICMODE_OPL;
+ }
else
{
- snd_musicmode = MUSICMODE_MIDI;
+ snd_musicmode = MUSICMODE_DISABLED;
}
// Doom has PC speaker sound effects, but others do not:
@@ -188,7 +200,7 @@ void ConfigSound(void)
music_table = TXT_NewTable(2),
NULL);
- TXT_SetColumnWidths(sfx_table, 20, 5);
+ TXT_SetColumnWidths(sfx_table, 20, 14);
TXT_AddWidgets(sfx_table,
TXT_NewLabel("Sound effects"),
@@ -209,7 +221,7 @@ void ConfigSound(void)
NULL);
}
- TXT_SetColumnWidths(music_table, 20, 5);
+ TXT_SetColumnWidths(music_table, 20, 14);
TXT_AddWidgets(music_table,
TXT_NewLabel("Music"),
@@ -222,7 +234,6 @@ void ConfigSound(void)
TXT_SignalConnect(sfx_mode_control, "changed", UpdateSndDevices, NULL);
TXT_SignalConnect(music_mode_control, "changed", UpdateSndDevices, NULL);
-
}
void BindSoundVariables(void)