Skip to content

Commit

Permalink
fix audioapi opt enum, reorder xrc
Browse files Browse the repository at this point in the history
The config option name enum needs to match the actual enum, since the
value is an integer. Unavailable APIs are not shown using #ifdefs in
guiinit.cpp.

Also reorder the radio button xrcs to be in the order of the enum.
  • Loading branch information
rkitover committed Jan 2, 2019
1 parent 8cb3f5a commit 964f086
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
3 changes: 3 additions & 0 deletions src/wx/faudio.cpp
Expand Up @@ -25,6 +25,9 @@ int GetFADevices(FAudio* fa, wxArrayString* names, wxArrayString* ids,
{
HRESULT hr;
UINT32 dev_count = 0;

wxLogDebug("IN FAUDIO INIT");

hr = FAudio_GetDeviceCount(fa, &dev_count);

if (hr != S_OK) {
Expand Down
24 changes: 1 addition & 23 deletions src/wx/opts.cpp
Expand Up @@ -255,29 +255,7 @@ opt_desc opts[] = {

/// Sound

#define OAL_SOUND "openal|"

#ifdef NO_OAL
# define OAL_SOUND ""
#endif

#define XAUDIO2_SOUND "xaudio2|"

#ifdef NO_XAUDIO2
# define XAUDIO2_SOUND ""
#endif

#define FAUDIO_SOUND "faudio|"

#ifdef NO_FAUDIO
# define FAUDIO_SOUND ""
#endif

#ifdef __WXMSW__
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|" OAL_SOUND "directsound|" FAUDIO_SOUND "xaudio2")),
#else
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|" OAL_SOUND FAUDIO_SOUND)),
#endif
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal|directsound|xaudio2|faudio")),
INTOPT("Sound/Buffers", "", wxTRANSLATE("Number of sound buffers"), gopts.audio_buffers, 2, 10),
INTOPT("Sound/Enable", "", wxTRANSLATE("Bit mask of sound channels to enable"), gopts.sound_en, 0, 0x30f),
INTOPT("Sound/GBAFiltering", "", wxTRANSLATE("GBA sound filtering (%)"), gopts.gba_sound_filter, 0, 100),
Expand Down
18 changes: 11 additions & 7 deletions src/wx/xrc/SoundConfig.xrc
Expand Up @@ -109,31 +109,35 @@
<object class="sizeritem">
<object class="wxRadioButton" name="OpenAL">
<label>OpenAL</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="DirectSound">
<label>DirectSound</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="XAudio2">
<label>XAudio2</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="FAudio">
<label>FAudio</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="DirectSound">
<label>DirectSound</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
Expand Down

0 comments on commit 964f086

Please sign in to comment.