mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Rename *OutputDevice(s) to *PlaybackDevice(s)
This commit is contained in:
@@ -78,7 +78,7 @@ bool Audio::setMixWithSystem(bool mix)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Audio::setOutputDevice(const char */*name*/)
|
||||
void Audio::setPlaybackDevice(const char */*name*/)
|
||||
{
|
||||
throw love::Exception("Re-setting output device is not supported.");
|
||||
}
|
||||
|
||||
@@ -298,19 +298,19 @@ public:
|
||||
virtual void resumeContext() = 0;
|
||||
|
||||
/**
|
||||
* Get current output device name.
|
||||
* Get current playback device name.
|
||||
*/
|
||||
virtual std::string getOutputDevice() = 0;
|
||||
virtual std::string getPlaybackDevice() = 0;
|
||||
|
||||
/**
|
||||
* Retrieve list of available output devices.
|
||||
* Retrieve list of available playback devices.
|
||||
*/
|
||||
virtual void getOutputDevices(std::vector<std::string> &list) = 0;
|
||||
virtual void getPlaybackDevices(std::vector<std::string> &list) = 0;
|
||||
|
||||
/**
|
||||
* Set the output device to specified device name.
|
||||
* Set the current playback device to specified device name.
|
||||
*/
|
||||
virtual void setOutputDevice(const char *name);
|
||||
virtual void setPlaybackDevice(const char *name);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -211,12 +211,12 @@ void Audio::resumeContext()
|
||||
{
|
||||
}
|
||||
|
||||
std::string Audio::getOutputDevice()
|
||||
std::string Audio::getPlaybackDevice()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void Audio::getOutputDevices(std::vector<std::string> &/*list*/)
|
||||
void Audio::getPlaybackDevices(std::vector<std::string> &/*list*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -89,8 +89,8 @@ public:
|
||||
void pauseContext();
|
||||
void resumeContext();
|
||||
|
||||
std::string getOutputDevice();
|
||||
void getOutputDevices(std::vector<std::string> &list);
|
||||
std::string getPlaybackDevice();
|
||||
void getPlaybackDevices(std::vector<std::string> &list);
|
||||
|
||||
private:
|
||||
float volume;
|
||||
|
||||
@@ -328,7 +328,7 @@ void Audio::resumeContext()
|
||||
alcMakeContextCurrent(context);
|
||||
}
|
||||
|
||||
std::string Audio::getOutputDevice()
|
||||
std::string Audio::getPlaybackDevice()
|
||||
{
|
||||
const char *dev = getDeviceSpecifier(device);
|
||||
|
||||
@@ -338,7 +338,7 @@ std::string Audio::getOutputDevice()
|
||||
return dev;
|
||||
}
|
||||
|
||||
void Audio::getOutputDevices(std::vector<std::string> &list)
|
||||
void Audio::getPlaybackDevices(std::vector<std::string> &list)
|
||||
{
|
||||
const char *devices = getDeviceSpecifier(nullptr);
|
||||
|
||||
@@ -352,7 +352,7 @@ void Audio::getOutputDevices(std::vector<std::string> &list)
|
||||
}
|
||||
}
|
||||
|
||||
void Audio::setOutputDevice(const char* name)
|
||||
void Audio::setPlaybackDevice(const char* name)
|
||||
{
|
||||
#ifndef ALC_SOFT_reopen_device
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCREOPENDEVICESOFT)(ALCdevice *device,
|
||||
@@ -366,7 +366,7 @@ void Audio::setOutputDevice(const char* name)
|
||||
{
|
||||
// Default implementation throws exception. To make
|
||||
// error message consistent, call the base class.
|
||||
love::audio::Audio::setOutputDevice(name);
|
||||
love::audio::Audio::setPlaybackDevice(name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,9 +127,9 @@ public:
|
||||
|
||||
bool getEffectID(const char *name, ALuint &id);
|
||||
|
||||
std::string getOutputDevice();
|
||||
void getOutputDevices(std::vector<std::string> &list);
|
||||
void setOutputDevice(const char *name);
|
||||
std::string getPlaybackDevice();
|
||||
void getPlaybackDevices(std::vector<std::string> &list);
|
||||
void setPlaybackDevice(const char *name);
|
||||
|
||||
private:
|
||||
void initializeEFX();
|
||||
|
||||
@@ -543,20 +543,20 @@ int w_setMixWithSystem(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_getOutputDevice(lua_State* L)
|
||||
int w_getPlaybackDevice(lua_State* L)
|
||||
{
|
||||
std::string device;
|
||||
|
||||
luax_catchexcept(L, [&]() { device = instance()->getOutputDevice(); });
|
||||
luax_catchexcept(L, [&]() { device = instance()->getPlaybackDevice(); });
|
||||
luax_pushstring(L, device);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_getOutputDevices(lua_State* L)
|
||||
int w_getPlaybackDevices(lua_State* L)
|
||||
{
|
||||
std::vector<std::string> list;
|
||||
|
||||
luax_catchexcept(L, [&]() { instance()->getOutputDevices(list); });
|
||||
luax_catchexcept(L, [&]() { instance()->getPlaybackDevices(list); });
|
||||
lua_createtable(L, 0, (int) list.size());
|
||||
for (int i = 0; i < (int) list.size(); i++)
|
||||
{
|
||||
@@ -568,13 +568,13 @@ int w_getOutputDevices(lua_State* L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_setOutputDevice(lua_State* L)
|
||||
int w_setPlaybackDevice(lua_State* L)
|
||||
{
|
||||
const char *device = luaL_optstring(L, 1, nullptr);
|
||||
|
||||
try
|
||||
{
|
||||
instance()->setOutputDevice(device);
|
||||
instance()->setPlaybackDevice(device);
|
||||
luax_pushboolean(L, true);
|
||||
return 1;
|
||||
}
|
||||
@@ -620,9 +620,9 @@ static const luaL_Reg functions[] =
|
||||
{ "getMaxSourceEffects", w_getMaxSourceEffects },
|
||||
{ "isEffectsSupported", w_isEffectsSupported },
|
||||
{ "setMixWithSystem", w_setMixWithSystem },
|
||||
{ "getOutputDevice", w_getOutputDevice },
|
||||
{ "getOutputDevices", w_getOutputDevices },
|
||||
{ "setOutputDevice", w_setOutputDevice },
|
||||
{ "getPlaybackDevice", w_getPlaybackDevice },
|
||||
{ "getPlaybackDevices", w_getPlaybackDevices },
|
||||
{ "setPlaybackDevice", w_setPlaybackDevice },
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@@ -131,7 +131,7 @@ function love.createhandlers()
|
||||
end,
|
||||
audiodisconnected = function (sources)
|
||||
if not love.audiodisconnected or not love.audiodisconnected(sources) then
|
||||
love.audio.setOutputDevice()
|
||||
love.audio.setPlaybackDevice()
|
||||
end
|
||||
end,
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user