kopia lustrzana https://gitlab.com/eliggett/wfview
Restart audio device if stopped/suspended
rodzic
acaed4601e
commit
f9ca8e7e84
|
@ -105,17 +105,20 @@ void cwSidetone::init()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
output->setVolume((qreal)volume/100.0);
|
output->setVolume((qreal)volume/100.0);
|
||||||
|
outputDevice = output->start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cwSidetone::send(QString text)
|
void cwSidetone::send(QString text)
|
||||||
{
|
{
|
||||||
if (output != Q_NULLPTR) {
|
if (output != Q_NULLPTR && outputDevice != Q_NULLPTR) {
|
||||||
text=text.simplified();
|
text=text.simplified();
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
QString currentChar;
|
QString currentChar;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
outputDevice = output->start();
|
if (output->state() == QAudio::StoppedState || output->state() == QAudio::SuspendedState) {
|
||||||
|
output->resume();
|
||||||
|
}
|
||||||
while (pos < text.size())
|
while (pos < text.size())
|
||||||
{
|
{
|
||||||
QChar ch = text.at(pos).toUpper();
|
QChar ch = text.at(pos).toUpper();
|
||||||
|
@ -145,7 +148,6 @@ void cwSidetone::send(QString text)
|
||||||
}
|
}
|
||||||
//qInfo(logCW()) << "Sending" << this->currentChar;
|
//qInfo(logCW()) << "Sending" << this->currentChar;
|
||||||
emit finished();
|
emit finished();
|
||||||
output->stop();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue