feat: install only not wait

dev
Barry 4 years ago
parent c2a3aa106b
commit 0af13110eb

@ -59,10 +59,10 @@ void AudioOutput::stop()
void AudioOutput::installonly(const QString &serial, int port)
{
runSndcpyProcess(serial, port);
runSndcpyProcess(serial, port, false);
}
bool AudioOutput::runSndcpyProcess(const QString &serial, int port)
bool AudioOutput::runSndcpyProcess(const QString &serial, int port, bool wait)
{
if (QProcess::NotRunning != m_sndcpy.state()) {
m_sndcpy.kill();
@ -81,6 +81,10 @@ bool AudioOutput::runSndcpyProcess(const QString &serial, int port)
m_sndcpy.start("bash", params);
#endif
if (!wait) {
return true;
}
if (!m_sndcpy.waitForStarted()) {
qWarning() << "AudioOutput::start sndcpy.bat failed";
return false;

@ -20,7 +20,7 @@ public:
void installonly(const QString& serial, int port);
private:
bool runSndcpyProcess(const QString& serial, int port);
bool runSndcpyProcess(const QString& serial, int port, bool wait = true);
void startAudioOutput();
void stopAudioOutput();
void startRecvData(int port);

Loading…
Cancel
Save