kopia lustrzana https://gitlab.com/eliggett/wfview
Tidy some connections
rodzic
43f423f1ad
commit
fb99a57272
|
@ -184,7 +184,7 @@ bool audioHandler::init(audioSetup setupIn)
|
|||
|
||||
underTimer = new QTimer();
|
||||
underTimer->setSingleShot(true);
|
||||
connect(underTimer, &QTimer::timeout, this, &audioHandler::clearUnderrun);
|
||||
connect(underTimer, SIGNAL(timeout()), this, SLOT(clearUnderrun()));
|
||||
|
||||
this->start();
|
||||
|
||||
|
@ -197,8 +197,8 @@ void audioHandler::start()
|
|||
|
||||
if (setup.isinput) {
|
||||
audioDevice = audioInput->start();
|
||||
connect(audioInput, &QAudioInput::destroyed, audioDevice, &QIODevice::deleteLater, Qt::UniqueConnection);
|
||||
connect(audioDevice, &QIODevice::readyRead, this, &audioHandler::getNextAudioChunk);
|
||||
connect(audioInput, SIGNAL(destroyed()), audioDevice, SLOT(deleteLater()), Qt::UniqueConnection);
|
||||
connect(audioDevice, SIGNAL(readyRead()), this, SLOT(getNextAudioChunk), Qt::UniqueConnection);
|
||||
}
|
||||
else {
|
||||
// Buffer size must be set before audio is started.
|
||||
|
@ -208,7 +208,7 @@ void audioHandler::start()
|
|||
audioOutput->setBufferSize(format.bytesForDuration(setup.latency * 1000));
|
||||
#endif
|
||||
audioDevice = audioOutput->start();
|
||||
connect(audioOutput, &QAudioOutput::destroyed, audioDevice, &QIODevice::deleteLater, Qt::UniqueConnection);
|
||||
connect(audioOutput, SIGNAL(destroyed()), audioDevice, SLOT(deleteLater()), Qt::UniqueConnection);
|
||||
}
|
||||
if (!audioDevice) {
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Audio device failed to start()";
|
||||
|
@ -445,7 +445,6 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
|
||||
void audioHandler::getNextAudioChunk()
|
||||
{
|
||||
|
||||
tempBuf.data.append(audioDevice->readAll());
|
||||
|
||||
while (tempBuf.data.length() >= format.bytesForDuration(setup.blockSize * 1000)) {
|
||||
|
@ -616,7 +615,7 @@ void audioHandler::getNextAudioChunk()
|
|||
if (lastReceived.msecsTo(QTime::currentTime()) > 100) {
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Time since last audio packet" << lastReceived.msecsTo(QTime::currentTime()) << "Expected around" << setup.blockSize << "Processing time" << startProcessing.msecsTo(QTime::currentTime());
|
||||
}
|
||||
|
||||
lastReceived = QTime::currentTime();
|
||||
//ret = livePacket.data;
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue