Allow to specify the platform-default sound driver directly

- driver names "oss", "osx" and "win" can now be used instead of "default"
- updated sound initialization messages
This commit is contained in:
Volker Ruppert 2013-07-25 18:47:11 +00:00
parent 0da1d659d3
commit 3e27308899
5 changed files with 20 additions and 8 deletions

View File

@ -42,7 +42,7 @@ bx_sound_linux_c::bx_sound_linux_c()
wave_device[1] = NULL;
wave_fd[0] = -1;
wave_fd[1] = -1;
BX_INFO(("Sound lowlevel module 'linux' initialized"));
BX_INFO(("Sound lowlevel module 'oss' initialized"));
}
bx_sound_linux_c::~bx_sound_linux_c()

View File

@ -91,6 +91,18 @@ void bx_soundmod_ctl_c::init()
#if BX_WITH_SDL
} else if (!strcmp(driver, "sdl")) {
soundmod = new bx_sound_sdl_c();
#endif
#if (defined(linux) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__))
} else if (!strcmp(driver, "oss")) {
soundmod = new bx_sound_linux_c();
#endif
#if defined(macintosh)
} else if (!strcmp(driver, "osx")) {
soundmod = new bx_sound_osx_c();
#endif
#if defined(WIN32)
} else if (!strcmp(driver, "win")) {
soundmod = new bx_sound_windows_c();
#endif
} else if (!strcmp(driver, "dummy")) {
soundmod = new bx_sound_lowlevel_c();

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004-2011 The Bochs Project
// Copyright (C) 2004-2013 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -85,7 +85,7 @@ bx_sound_osx_c::bx_sound_osx_c()
tail = 0;
for (int i=0; i<BX_SOUND_OSX_NBUF; i++)
WaveLength[i] = 0;
BX_INFO(("Sound output module 'osx' initialized"));
BX_INFO(("Sound lowlevel module 'osx' initialized"));
}
bx_sound_osx_c::~bx_sound_osx_c()

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2012 The Bochs Project
// Copyright (C) 2012-2013 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -46,9 +46,9 @@ bx_sound_sdl_c::bx_sound_sdl_c()
{
WaveOpen = 0;
if (SDL_InitSubSystem(SDL_INIT_AUDIO)) {
BX_PANIC(("Initialization of sound output module 'sdl' failed"));
BX_PANIC(("Initialization of sound lowlevel module 'sdl' failed"));
} else {
BX_INFO(("Sound output module 'sdl' initialized"));
BX_INFO(("Sound lowlevel module 'sdl' initialized"));
}
}

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2011 The Bochs Project
// Copyright (C) 2001-2013 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -82,7 +82,7 @@ bx_sound_windows_c::bx_sound_windows_c()
#undef ALIGN
#undef NEWBUFFER
BX_INFO(("Sound output module 'win' initialized"));
BX_INFO(("Sound lowlevel module 'win' initialized"));
}
bx_sound_windows_c::~bx_sound_windows_c()