mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Rename RecordingDevice:startRecording and RecordingDevice:stopRecording to RecordingDevice:start and RecordingDevice:stop.
--HG-- branch : minor
This commit is contained in:
@@ -41,7 +41,7 @@ public:
|
||||
* Begins audio input recording process. using default (previous) parameters.
|
||||
* @return True if recording started successfully.
|
||||
**/
|
||||
virtual bool startRecording() = 0;
|
||||
virtual bool start() = 0;
|
||||
|
||||
/**
|
||||
* Begins audio input recording process.
|
||||
@@ -51,12 +51,12 @@ public:
|
||||
* @param channels Desired number of channels.
|
||||
* @return True if recording started successfully.
|
||||
**/
|
||||
virtual bool startRecording(int samples, int sampleRate, int bitDepth, int channels) = 0;
|
||||
virtual bool start(int samples, int sampleRate, int bitDepth, int channels) = 0;
|
||||
|
||||
/**
|
||||
* Stops audio input recording.
|
||||
**/
|
||||
virtual void stopRecording() = 0;
|
||||
virtual void stop() = 0;
|
||||
|
||||
/**
|
||||
* Retreives recorded data.
|
||||
|
||||
@@ -38,17 +38,17 @@ RecordingDevice::~RecordingDevice()
|
||||
{
|
||||
}
|
||||
|
||||
bool RecordingDevice::startRecording()
|
||||
bool RecordingDevice::start()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RecordingDevice::startRecording(int, int, int, int)
|
||||
bool RecordingDevice::start(int, int, int, int)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void RecordingDevice::stopRecording()
|
||||
void RecordingDevice::stop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ class RecordingDevice : public love::audio::RecordingDevice
|
||||
public:
|
||||
RecordingDevice(const char *name);
|
||||
virtual ~RecordingDevice();
|
||||
virtual bool startRecording();
|
||||
virtual bool startRecording(int samples, int sampleRate, int bitDepth, int channels);
|
||||
virtual void stopRecording();
|
||||
virtual bool start();
|
||||
virtual bool start(int samples, int sampleRate, int bitDepth, int channels);
|
||||
virtual void stop();
|
||||
virtual love::sound::SoundData *getData();
|
||||
virtual const char *getName() const;
|
||||
virtual int getSampleCount() const;
|
||||
|
||||
@@ -56,12 +56,12 @@ RecordingDevice::~RecordingDevice()
|
||||
alcCaptureCloseDevice(device);
|
||||
}
|
||||
|
||||
bool RecordingDevice::startRecording()
|
||||
bool RecordingDevice::start()
|
||||
{
|
||||
return startRecording(samples, sampleRate, bitDepth, channels);
|
||||
return start(samples, sampleRate, bitDepth, channels);
|
||||
}
|
||||
|
||||
bool RecordingDevice::startRecording(int samples, int sampleRate, int bitDepth, int channels)
|
||||
bool RecordingDevice::start(int samples, int sampleRate, int bitDepth, int channels)
|
||||
{
|
||||
if (isRecording())
|
||||
{
|
||||
@@ -91,7 +91,7 @@ bool RecordingDevice::startRecording(int samples, int sampleRate, int bitDepth,
|
||||
return true;
|
||||
}
|
||||
|
||||
void RecordingDevice::stopRecording()
|
||||
void RecordingDevice::stop()
|
||||
{
|
||||
if (!isRecording())
|
||||
return;
|
||||
|
||||
@@ -49,9 +49,9 @@ class RecordingDevice : public love::audio::RecordingDevice
|
||||
public:
|
||||
RecordingDevice(const char *name);
|
||||
virtual ~RecordingDevice();
|
||||
virtual bool startRecording();
|
||||
virtual bool startRecording(int samples, int sampleRate, int bitDepth, int channels);
|
||||
virtual void stopRecording();
|
||||
virtual bool start();
|
||||
virtual bool start(int samples, int sampleRate, int bitDepth, int channels);
|
||||
virtual void stop();
|
||||
virtual love::sound::SoundData *getData();
|
||||
virtual const char *getName() const;
|
||||
virtual int getSampleCount() const;
|
||||
|
||||
@@ -32,7 +32,7 @@ RecordingDevice *luax_checkrecordingdevice(lua_State *L, int idx)
|
||||
return luax_checktype<RecordingDevice>(L, idx, AUDIO_RECORDING_DEVICE_ID);
|
||||
}
|
||||
|
||||
int w_RecordingDevice_startRecording(lua_State *L)
|
||||
int w_RecordingDevice_start(lua_State *L)
|
||||
{
|
||||
RecordingDevice *d = luax_checkrecordingdevice(L, 1);
|
||||
if (lua_gettop(L) > 1)
|
||||
@@ -42,23 +42,23 @@ int w_RecordingDevice_startRecording(lua_State *L)
|
||||
int bitDepth = (int) luaL_checkinteger(L, 4);
|
||||
int channels = (int) luaL_checkinteger(L, 5);
|
||||
luax_catchexcept(L, [&](){
|
||||
lua_pushboolean(L, d->startRecording(samples, sampleRate, bitDepth, channels));
|
||||
lua_pushboolean(L, d->start(samples, sampleRate, bitDepth, channels));
|
||||
});
|
||||
}
|
||||
else
|
||||
luax_catchexcept(L, [&](){ lua_pushboolean(L, d->startRecording()); });
|
||||
luax_catchexcept(L, [&](){ lua_pushboolean(L, d->start()); });
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_RecordingDevice_stopRecording(lua_State *L)
|
||||
int w_RecordingDevice_stop(lua_State *L)
|
||||
{
|
||||
RecordingDevice *d = luax_checkrecordingdevice(L, 1);
|
||||
love::sound::SoundData *s = nullptr;
|
||||
|
||||
luax_catchexcept(L, [&](){ s = d->getData(); });
|
||||
|
||||
d->stopRecording();
|
||||
d->stop();
|
||||
|
||||
if (s != nullptr)
|
||||
{
|
||||
@@ -133,8 +133,8 @@ int w_RecordingDevice_isRecording(lua_State *L)
|
||||
|
||||
static const luaL_Reg w_RecordingDevice_functions[] =
|
||||
{
|
||||
{ "startRecording", w_RecordingDevice_startRecording },
|
||||
{ "stopRecording", w_RecordingDevice_stopRecording },
|
||||
{ "start", w_RecordingDevice_start },
|
||||
{ "stop", w_RecordingDevice_stop },
|
||||
{ "getData", w_RecordingDevice_getData },
|
||||
{ "getSampleCount", w_RecordingDevice_getSampleCount },
|
||||
{ "getSampleRate", w_RecordingDevice_getSampleRate },
|
||||
|
||||
Reference in New Issue
Block a user