Moved audio input to the audio thread.

Change source URLs in teh CMake scripts for the kvasd binaries.



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3563 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2013-08-17 19:21:14 +00:00
parent 1d4921caa8
commit 0cd7046a2a
6 changed files with 79 additions and 66 deletions
+5 -5
View File
@@ -38,7 +38,7 @@ bool SoundInput::audioError () const
return result;
}
bool SoundInput::start(QAudioDeviceInfo const& device, unsigned channels, int framesPerBuffer, QIODevice * sink)
void SoundInput::start(QAudioDeviceInfo const& device, unsigned channels, int framesPerBuffer, QIODevice * sink)
{
Q_ASSERT (0 < channels && channels < 3);
Q_ASSERT (sink);
@@ -55,26 +55,26 @@ bool SoundInput::start(QAudioDeviceInfo const& device, unsigned channels, int fr
if (!format.isValid ())
{
Q_EMIT error (tr ("Requested input audio format is not valid."));
return false;
return;
}
// this function lies!
// if (!device.isFormatSupported (format))
// {
// Q_EMIT error (tr ("Requested input audio format is not supported on device."));
// return false;
// return;
// }
m_stream.reset (new QAudioInput (device, format, this));
if (audioError ())
{
return false;
return;
}
connect (m_stream.data(), &QAudioInput::stateChanged, this, &SoundInput::handleStateChanged);
m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer));
m_stream->start (sink);
return audioError () ? false : true;
audioError ();
}
void SoundInput::handleStateChanged (QAudio::State newState) const