fix valid sound driver config values + faudio fix
Fix name of FAudio option XRC control: "FAudio" and not "Faudio". Create list of valid sound driver options by using macros for the ones that are compiled in (with windows being a special case.)
This commit is contained in:
parent
1f4487b836
commit
296e8e1693
|
@ -3442,7 +3442,7 @@ bool MainFrame::BindControls()
|
||||||
#if !defined(__WXMSW__) || defined(NO_XAUDIO2)
|
#if !defined(__WXMSW__) || defined(NO_XAUDIO2)
|
||||||
rb->Hide();
|
rb->Hide();
|
||||||
#endif
|
#endif
|
||||||
audapi_rb("Faudio", AUD_FAUDIO);
|
audapi_rb("FAudio", AUD_FAUDIO);
|
||||||
#ifdef NO_FAUDIO
|
#ifdef NO_FAUDIO
|
||||||
rb->Hide();
|
rb->Hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -254,18 +254,29 @@ opt_desc opts[] = {
|
||||||
INTOPT("preferences/vsync", "VSync", wxTRANSLATE("Wait for vertical sync"), vsync, 0, 1),
|
INTOPT("preferences/vsync", "VSync", wxTRANSLATE("Wait for vertical sync"), vsync, 0, 1),
|
||||||
|
|
||||||
/// Sound
|
/// Sound
|
||||||
|
|
||||||
|
#define OAL_SOUND "openal|"
|
||||||
|
|
||||||
#ifdef NO_OAL
|
#ifdef NO_OAL
|
||||||
#ifdef __WXMSW__
|
# define OAL_SOUND ""
|
||||||
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|directsound|faudio|xaudio2")),
|
|
||||||
#else
|
|
||||||
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl")),
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#ifdef __WXMSW__
|
#define XAUDIO2_SOUND "xaudio2|"
|
||||||
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal|directsound|faudio|xaudio2")),
|
|
||||||
#else
|
#ifdef NO_XAUDIO2
|
||||||
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal")),
|
# define XAUDIO2_SOUND ""
|
||||||
#endif
|
#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
|
#endif
|
||||||
INTOPT("Sound/Buffers", "", wxTRANSLATE("Number of sound buffers"), gopts.audio_buffers, 2, 10),
|
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/Enable", "", wxTRANSLATE("Bit mask of sound channels to enable"), gopts.sound_en, 0, 0x30f),
|
||||||
|
|
|
@ -5,12 +5,18 @@
|
||||||
#include "strutils.h"
|
#include "strutils.h"
|
||||||
|
|
||||||
// From: https://stackoverflow.com/a/7408245/262458
|
// From: https://stackoverflow.com/a/7408245/262458
|
||||||
|
//
|
||||||
|
// modified to ignore empty tokens
|
||||||
std::vector<wxString> str_split(const wxString& text, const wxString& sep) {
|
std::vector<wxString> str_split(const wxString& text, const wxString& sep) {
|
||||||
std::vector<wxString> tokens;
|
std::vector<wxString> tokens;
|
||||||
std::size_t start = 0, end = 0;
|
std::size_t start = 0, end = 0;
|
||||||
|
|
||||||
while ((end = text.find(sep, start)) != std::string::npos) {
|
while ((end = text.find(sep, start)) != std::string::npos) {
|
||||||
tokens.push_back(text.substr(start, end - start));
|
wxString token = text.substr(start, end - start);
|
||||||
|
|
||||||
|
if (token.length())
|
||||||
|
tokens.push_back(token);
|
||||||
|
|
||||||
start = end + 1;
|
start = end + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue