Added global lua function for fetching the list of available sound drivers. Moved WaveOut to the front of the list to make it the first driver to try on Windows.

This commit is contained in:
Kyzentun Keeslala
2016-03-05 18:11:59 -07:00
parent 5f4cd214d9
commit bd19b1b29a
6 changed files with 29 additions and 2 deletions
+1
View File
@@ -222,6 +222,7 @@
<Function name='getfenv'/>
<Function name='getmetatable'/>
<Function name='get_music_file_length'/>
<Function name='get_sound_driver_list'/>
<Function name='ipairs'/>
<Function name='ivalues'/>
<Function name='join'/>
+3
View File
@@ -215,6 +215,9 @@ save yourself some time, copy this for undocumented things:
Returns the length of the music file found at path.<br />
If you are loading the sound into an ActorSound, ActorSound:get to get its RageSound then use RageSound's get_length function instead to avoid loading the file twice.
</Function>
<Function name='get_sound_driver_list' return='table' arguments=''>
Returns a table of the names of the sound drivers available. If the SoundDriver preference is set to something that is not in this list, StepMania WILL NOT START UP. Changes to the SoundDriver preference do not take effect until the next time StepMania starts up.
</Function>
<Function name='GetOSName' return='string' arguments=''>
Returns a string representing the name of the operating system being used. (e.g. "Windows", "Linux", "Mac, "Unknown")
</Function>
+18 -1
View File
@@ -18,6 +18,8 @@
#include "SongUtil.h"
#include "LuaManager.h"
#include "arch/Sound/RageSoundDriver.h"
GameSoundManager *SOUND = NULL;
/*
@@ -869,7 +871,22 @@ public:
}
};
LUA_REGISTER_CLASS( GameSoundManager )
LUA_REGISTER_CLASS(GameSoundManager);
int LuaFunc_get_sound_driver_list(lua_State* L);
int LuaFunc_get_sound_driver_list(lua_State* L)
{
vector<RString> driver_names;
split(RageSoundDriver::GetDefaultSoundDriverList(), ",", driver_names, true);
lua_createtable(L, driver_names.size(), 0);
for(size_t n= 0; n < driver_names.size(); ++n)
{
lua_pushstring(L, driver_names[n].c_str());
lua_rawseti(L, -2, n+1);
}
return 1;
}
LUAFUNC_REGISTER_COMMON(get_sound_driver_list);
/*
+5
View File
@@ -36,6 +36,11 @@ RageSoundDriver *RageSoundDriver::Create( const RString& sDrivers )
return NULL;
}
RString RageSoundDriver::GetDefaultSoundDriverList()
{
return DEFAULT_SOUND_DRIVER_LIST;
}
/*
* (c) 2002-2006 Glenn Maynard, Steve Checkoway
* All rights reserved.
+1
View File
@@ -18,6 +18,7 @@ public:
/* Pass an empty string to get the default sound driver list. */
static RageSoundDriver *Create( const RString &sDrivers );
static DriverList m_pDriverList;
static RString GetDefaultSoundDriverList();
friend class RageSoundManager;
+1 -1
View File
@@ -9,7 +9,7 @@
#include "MemoryCard/MemoryCardDriverThreaded_Windows.h"
#define DEFAULT_INPUT_DRIVER_LIST "DirectInput,Pump,Para"
#define DEFAULT_MOVIE_DRIVER_LIST "FFMpeg,DShow,Null"
#define DEFAULT_SOUND_DRIVER_LIST "DirectSound-sw,WDMKS,WaveOut,Null"
#define DEFAULT_SOUND_DRIVER_LIST "WaveOut,DirectSound-sw,WDMKS,Null"
#elif defined(MACOSX)