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