Remove the __APPLE__ workaround for reading config files from a ctor.

'#' is a fairly accepted comment character for .ini files along with
the more official ';', but '//' isn't.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6872 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-18 00:04:29 +00:00
parent d0805aef37
commit 1a3cd2d34c
14 changed files with 30 additions and 79 deletions

View File

@ -37,11 +37,11 @@ namespace AudioCommon
std::string backend = ac_Config.sBackend;
if (backend == BACKEND_OPENAL && OpenALStream::isValid())
soundStream = new OpenALStream(mixer);
else if (backend == BACKEND_NULLSOUND && NullSound::isValid())
else if (backend == BACKEND_NULLSOUND && NullSound::isValid())
soundStream = new NullSound(mixer, g_dspInitialize.hWnd);
else if (backend == BACKEND_DIRECTSOUND && DSound::isValid())
soundStream = new DSound(mixer, g_dspInitialize.hWnd);
else if (backend == BACKEND_XAUDIO2 && XAudio2::isValid())
else if (backend == BACKEND_XAUDIO2 && XAudio2::isValid())
soundStream = new XAudio2(mixer);
else if (backend == BACKEND_AOSOUND && AOSound::isValid())
soundStream = new AOSound(mixer);

View File

@ -23,23 +23,17 @@ void AudioCommonConfig::Load(IniFile &file) {
file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
file.Get("Config", "EnableJIT", &m_EnableJIT, true);
file.Get("Config", "Volume", &m_Volume, 100);
#ifdef _WIN32
file.Get("Config", "Backend", &sBackend, BACKEND_DIRECTSOUND);
file.Get("Config", "Frequency", &sFrequency, "48,000 Hz");
#elif defined __APPLE__
std::string temp;
file.Get("Config", "Backend", &temp, BACKEND_COREAUDIO);
strncpy(sBackend, temp.c_str(), 128);
file.Get("Config", "Frequency", &temp, "48,000 Hz");
strncpy(sFrequency, temp.c_str(), 128);
#elif defined __linux__
#if defined __linux__ && HAVE_ALSA
file.Get("Config", "Backend", &sBackend, BACKEND_ALSA);
file.Get("Config", "Frequency", &sFrequency, "48,000 Hz");
#elif defined __APPLE__
file.Get("Config", "Backend", &sBackend, BACKEND_COREAUDIO);
#elif defined _WIN32
file.Get("Config", "Backend", &sBackend, BACKEND_DIRECTSOUND);
#else
file.Get("Config", "Backend", &sBackend, BACKEND_OPENAL);
file.Get("Config", "Frequency", &sFrequency, "48,000 Hz");
file.Get("Config", "Backend", &sBackend, BACKEND_NULLSOUND);
#endif
file.Get("Config", "Frequency", &sFrequency, "48,000 Hz");
file.Get("Config", "Volume", &m_Volume, 100);
}
// Set the values for the file

View File

@ -23,12 +23,12 @@
// Backend Types
#define BACKEND_NULLSOUND "No audio output"
#define BACKEND_COREAUDIO "CoreAudio"
#define BACKEND_DIRECTSOUND "DSound"
#define BACKEND_AOSOUND "AOSound"
#define BACKEND_OPENAL "OpenAL"
#define BACKEND_ALSA "ALSA"
#define BACKEND_PULSEAUDIO "Pulse"
#define BACKEND_ALSA "ALSA"
#define BACKEND_AOSOUND "AOSound"
#define BACKEND_COREAUDIO "CoreAudio"
#define BACKEND_DIRECTSOUND "DSound"
#define BACKEND_OPENAL "OpenAL"
#define BACKEND_PULSEAUDIO "Pulse"
#define BACKEND_XAUDIO2 "XAudio2"
struct AudioCommonConfig
@ -37,13 +37,8 @@ struct AudioCommonConfig
bool m_EnableThrottle;
bool m_EnableJIT;
int m_Volume;
#ifdef __APPLE__
char sBackend[128];
char sFrequency[128];
#else
std::string sBackend;
std::string sFrequency;
#endif
// Load from given file
void Load(IniFile &file);