mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 02:16:04 +08:00
Ref T737, stop output device
This commit is contained in:
committed by
Mat Sutcliffe
parent
7d04ca6435
commit
905c487451
@@ -111,11 +111,11 @@ namespace BlackCore
|
|||||||
CLogMessage(this).warning(w);
|
CLogMessage(this).warning(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_audioOutputCom1.reset(new QAudioOutput(outputDevice, outputFormat));
|
m_audioOutputCom.reset(new QAudioOutput(outputDevice, outputFormat));
|
||||||
// m_audioOutput->setBufferSize(bufferSize);
|
// m_audioOutput->setBufferSize(bufferSize);
|
||||||
m_audioOutputBuffer->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
|
m_audioOutputBuffer->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
|
||||||
m_audioOutputBuffer->setAudioFormat(outputFormat);
|
m_audioOutputBuffer->setAudioFormat(outputFormat);
|
||||||
m_audioOutputCom1->start(m_audioOutputBuffer);
|
m_audioOutputCom->start(m_audioOutputBuffer);
|
||||||
|
|
||||||
m_started = true;
|
m_started = true;
|
||||||
}
|
}
|
||||||
@@ -124,6 +124,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
if (!m_started) { return; }
|
if (!m_started) { return; }
|
||||||
m_started = false;
|
m_started = false;
|
||||||
|
m_audioOutputCom->stop();
|
||||||
m_audioOutputBuffer->deleteLater();
|
m_audioOutputBuffer->deleteLater();
|
||||||
m_audioOutputBuffer = nullptr;
|
m_audioOutputBuffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace BlackCore
|
|||||||
bool m_started = false;
|
bool m_started = false;
|
||||||
|
|
||||||
QAudioDeviceInfo m_device;
|
QAudioDeviceInfo m_device;
|
||||||
QScopedPointer<QAudioOutput> m_audioOutputCom1;
|
QScopedPointer<QAudioOutput> m_audioOutputCom;
|
||||||
CAudioOutputBuffer *m_audioOutputBuffer = nullptr;
|
CAudioOutputBuffer *m_audioOutputBuffer = nullptr;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user