1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

further cleanup

This commit is contained in:
Nils Fenner 2015-10-18 21:20:39 +02:00
parent 8530acf079
commit c8e003decb
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C
2 changed files with 6 additions and 11 deletions

View File

@ -147,8 +147,7 @@ void Audio::SetInputVolume(qreal volume)
void Audio::suscribeInput()
{
Audio& inst = Audio::getInstance();
inst.SubscribeInput();
getInstance().SubscribeInput();
}
/**
@ -178,14 +177,13 @@ void Audio::SubscribeInput()
void Audio::unsuscribeInput()
{
Audio& inst = Audio::getInstance();
inst.UnSubscribeInput();
getInstance().UnsubscribeInput();
}
/**
Call once you don't need to capture on the open input device anymore.
*/
void Audio::UnSubscribeInput()
void Audio::UnsubscribeInput()
{
qDebug() << "unsubscribing input" << inputSubscriptions;
if (inputSubscriptions > 0)
@ -400,8 +398,7 @@ void Audio::PlayMono16Sound(const QByteArray& data)
ALint frequency;
alGetBufferi(buffer, AL_FREQUENCY, &frequency);
float duration = (lengthInSamples / static_cast<float>(frequency)) * 1000;
qreal duration = (lengthInSamples / static_cast<qreal>(frequency)) * 1000;
int remaining = timer->interval();
if (duration > remaining)
@ -526,7 +523,7 @@ Returns true if the output device is open
bool Audio::IsOutputClosed()
{
QMutexLocker locker(&audioOutLock);
return (alOutDev);
return alOutDev;
}
bool Audio::tryCaptureSamples(uint8_t* buf, int framesize)
@ -575,8 +572,6 @@ void Audio::pauseOutput()
void Audio::PauseOutput()
{
QMutexLocker lock(&audioOutLock);
qDebug() << "Pause";
if (!inputSubscriptions)
closeOutput();

View File

@ -63,7 +63,7 @@ public:
static void suscribeInput();
void SubscribeInput();
static void unsuscribeInput();
void UnSubscribeInput();
void UnsubscribeInput();
static void openInput(const QString& inDevDescr);
void OpenInput(const QString& inDevDescr);