UDPSink plugin: implemented forced configuration

pull/60/head
f4exb 2017-08-16 09:53:23 +02:00
rodzic edcf3a9d63
commit 2cff745cda
4 zmienionych plików z 23 dodań i 13 usunięć

Wyświetl plik

@ -150,7 +150,7 @@ bool UDPSink::handleMessage(const Message& cmd)
m_config.m_udpPort = cfg.getUDPPort();
m_config.m_channelMute = cfg.getChannelMute();
apply(false);
apply(cfg.getForce());
m_settingsMutex.unlock();
@ -183,7 +183,8 @@ void UDPSink::configure(MessageQueue* messageQueue,
int fmDeviation,
QString& udpAddress,
int udpPort,
bool channelMute)
bool channelMute,
bool force)
{
Message* cmd = MsgUDPSinkConfigure::create(sampleFormat,
outputSampleRate,
@ -191,7 +192,8 @@ void UDPSink::configure(MessageQueue* messageQueue,
fmDeviation,
udpAddress,
udpPort,
channelMute);
channelMute,
force);
messageQueue->push(cmd);
}

Wyświetl plik

@ -64,7 +64,8 @@ public:
int fmDeviation,
QString& udpAddress,
int udpPort,
bool channelMute);
bool channelMute,
bool force = false);
void setSpectrum(MessageQueue* messageQueue, bool enabled);
private:
@ -79,6 +80,7 @@ private:
const QString& getUDPAddress() const { return m_udpAddress; }
int getUDPPort() const { return m_udpPort; }
bool getChannelMute() const { return m_channelMute; }
bool getForce() const { return m_force; }
static MsgUDPSinkConfigure* create(SampleFormat
sampleFormat,
@ -87,7 +89,8 @@ private:
int fmDeviation,
QString& udpAddress,
int udpPort,
bool channelMute)
bool channelMute,
bool force)
{
return new MsgUDPSinkConfigure(sampleFormat,
inputSampleRate,
@ -95,7 +98,8 @@ private:
fmDeviation,
udpAddress,
udpPort,
channelMute);
channelMute,
force);
}
private:
@ -106,6 +110,7 @@ private:
QString m_udpAddress;
int m_udpPort;
bool m_channelMute;
bool m_force;
MsgUDPSinkConfigure(SampleFormat sampleFormat,
Real inputSampleRate,
@ -113,7 +118,8 @@ private:
int fmDeviation,
QString& udpAddress,
int udpPort,
bool channelMute) :
bool channelMute,
bool force) :
Message(),
m_sampleFormat(sampleFormat),
m_inputSampleRate(inputSampleRate),
@ -121,7 +127,8 @@ private:
m_fmDeviation(fmDeviation),
m_udpAddress(udpAddress),
m_udpPort(udpPort),
m_channelMute(channelMute)
m_channelMute(channelMute),
m_force(force)
{ }
};

Wyświetl plik

@ -178,7 +178,7 @@ bool UDPSinkGUI::deserialize(const QByteArray& data)
blockApplySettings(false);
m_channelMarker.blockSignals(false);
applySettings();
applySettings(true);
return true;
}
else
@ -257,7 +257,7 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget*
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
applySettings();
applySettings(true);
connect(m_udpSink->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
}
@ -278,7 +278,7 @@ void UDPSinkGUI::blockApplySettings(bool block)
m_doApplySettings = !block;
}
void UDPSinkGUI::applySettings()
void UDPSinkGUI::applySettings(bool force)
{
if (m_doApplySettings)
{
@ -385,7 +385,8 @@ void UDPSinkGUI::applySettings()
fmDeviation,
m_udpAddress,
udpPort,
ui->channelMute->isChecked());
ui->channelMute->isChecked(),
force);
ui->applyBtn->setEnabled(false);
}

Wyświetl plik

@ -97,7 +97,7 @@ private:
virtual ~UDPSinkGUI();
void blockApplySettings(bool block);
void applySettings();
void applySettings(bool force = false);
void leaveEvent(QEvent*);
void enterEvent(QEvent*);