1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-08-04 06:52:26 -04:00

ATV Modulator: implemented channel mute

This commit is contained in:
f4exb 2017-03-14 18:59:49 +01:00
parent 7f125828bc
commit ab588684bb
3 changed files with 27 additions and 8 deletions

View File

@ -100,7 +100,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
atvModulation, atvModulation,
videoPlayLoop, videoPlayLoop,
videoPlay, videoPlay,
cameraPlay); cameraPlay,
channelMute);
messageQueue->push(cmd); messageQueue->push(cmd);
} }
@ -110,6 +111,13 @@ void ATVMod::pullAudio(int nbSamples)
void ATVMod::pull(Sample& sample) void ATVMod::pull(Sample& sample)
{ {
if (m_running.m_channelMute)
{
sample.m_real = 0.0f;
sample.m_imag = 0.0f;
return;
}
Complex ci; Complex ci;
m_settingsMutex.lock(); m_settingsMutex.lock();
@ -446,6 +454,7 @@ bool ATVMod::handleMessage(const Message& cmd)
m_config.m_videoPlayLoop = cfg.getVideoPlayLoop(); m_config.m_videoPlayLoop = cfg.getVideoPlayLoop();
m_config.m_videoPlay = cfg.getVideoPlay(); m_config.m_videoPlay = cfg.getVideoPlay();
m_config.m_cameraPlay = cfg.getCameraPlay(); m_config.m_cameraPlay = cfg.getCameraPlay();
m_config.m_channelMute = cfg.getChannelMute();
apply(); apply();
@ -457,7 +466,8 @@ bool ATVMod::handleMessage(const Message& cmd)
<< " m_atvModulation: " << (int) m_config.m_atvModulation << " m_atvModulation: " << (int) m_config.m_atvModulation
<< " m_videoPlayLoop: " << m_config.m_videoPlayLoop << " m_videoPlayLoop: " << m_config.m_videoPlayLoop
<< " m_videoPlay: " << m_config.m_videoPlay << " m_videoPlay: " << m_config.m_videoPlay
<< " m_cameraPlay: " << m_config.m_cameraPlay; << " m_cameraPlay: " << m_config.m_cameraPlay
<< " m_channelMute: " << m_config.m_channelMute;
return true; return true;
} }
@ -595,6 +605,7 @@ void ATVMod::apply(bool force)
m_running.m_videoPlayLoop = m_config.m_videoPlayLoop; m_running.m_videoPlayLoop = m_config.m_videoPlayLoop;
m_running.m_videoPlay = m_config.m_videoPlay; m_running.m_videoPlay = m_config.m_videoPlay;
m_running.m_cameraPlay = m_config.m_cameraPlay; m_running.m_cameraPlay = m_config.m_cameraPlay;
m_running.m_channelMute = m_config.m_channelMute;
} }
int ATVMod::getSampleRateUnits(ATVStd std) int ATVMod::getSampleRateUnits(ATVStd std)

View File

@ -347,6 +347,7 @@ private:
bool getVideoPlayLoop() const { return m_videoPlayLoop; } bool getVideoPlayLoop() const { return m_videoPlayLoop; }
bool getVideoPlay() const { return m_videoPlay; } bool getVideoPlay() const { return m_videoPlay; }
bool getCameraPlay() const { return m_cameraPlay; } bool getCameraPlay() const { return m_cameraPlay; }
bool getChannelMute() const { return m_channelMute; }
static MsgConfigureATVMod* create( static MsgConfigureATVMod* create(
Real rfBandwidth, Real rfBandwidth,
@ -356,7 +357,8 @@ private:
ATVModulation atvModulation, ATVModulation atvModulation,
bool videoPlayLoop, bool videoPlayLoop,
bool videoPlay, bool videoPlay,
bool cameraPlay) bool cameraPlay,
bool channelMute)
{ {
return new MsgConfigureATVMod( return new MsgConfigureATVMod(
rfBandwidth, rfBandwidth,
@ -366,7 +368,8 @@ private:
atvModulation, atvModulation,
videoPlayLoop, videoPlayLoop,
videoPlay, videoPlay,
cameraPlay); cameraPlay,
channelMute);
} }
private: private:
@ -378,6 +381,7 @@ private:
bool m_videoPlayLoop; bool m_videoPlayLoop;
bool m_videoPlay; bool m_videoPlay;
bool m_cameraPlay; bool m_cameraPlay;
bool m_channelMute;
MsgConfigureATVMod( MsgConfigureATVMod(
Real rfBandwidth, Real rfBandwidth,
@ -387,7 +391,8 @@ private:
ATVModulation atvModulation, ATVModulation atvModulation,
bool videoPlayLoop, bool videoPlayLoop,
bool videoPlay, bool videoPlay,
bool cameraPlay) : bool cameraPlay,
bool channelMute) :
Message(), Message(),
m_rfBandwidth(rfBandwidth), m_rfBandwidth(rfBandwidth),
m_atvStd(atvStd), m_atvStd(atvStd),
@ -396,7 +401,8 @@ private:
m_atvModulation(atvModulation), m_atvModulation(atvModulation),
m_videoPlayLoop(videoPlayLoop), m_videoPlayLoop(videoPlayLoop),
m_videoPlay(videoPlay), m_videoPlay(videoPlay),
m_cameraPlay(cameraPlay) m_cameraPlay(cameraPlay),
m_channelMute(channelMute)
{ } { }
}; };
@ -440,6 +446,7 @@ private:
bool m_videoPlayLoop; //!< Play video in a loop bool m_videoPlayLoop; //!< Play video in a loop
bool m_videoPlay; //!< True to play video and false to pause bool m_videoPlay; //!< True to play video and false to pause
bool m_cameraPlay; //!< True to play camera video and false to pause bool m_cameraPlay; //!< True to play camera video and false to pause
bool m_channelMute; //!< Mute channel baseband output
Config() : Config() :
m_outputSampleRate(-1), m_outputSampleRate(-1),
@ -451,7 +458,8 @@ private:
m_atvModulation(ATVModulationAM), m_atvModulation(ATVModulationAM),
m_videoPlayLoop(false), m_videoPlayLoop(false),
m_videoPlay(false), m_videoPlay(false),
m_cameraPlay(false) m_cameraPlay(false),
m_channelMute(false)
{ } { }
}; };

View File

@ -62,12 +62,12 @@ private slots:
void on_deltaFrequency_changed(quint64 value); void on_deltaFrequency_changed(quint64 value);
void on_deltaMinus_toggled(bool minus); void on_deltaMinus_toggled(bool minus);
void on_channelMute_toggled(bool checked);
void on_modulation_currentIndexChanged(int index); void on_modulation_currentIndexChanged(int index);
void on_rfBW_valueChanged(int value); void on_rfBW_valueChanged(int value);
void on_standard_currentIndexChanged(int index); void on_standard_currentIndexChanged(int index);
void on_uniformLevel_valueChanged(int value); void on_uniformLevel_valueChanged(int value);
void on_inputSelect_currentIndexChanged(int index); void on_inputSelect_currentIndexChanged(int index);
void on_channelMute_toggled(bool checked);
void on_imageFileDialog_clicked(bool checked); void on_imageFileDialog_clicked(bool checked);
void on_videoFileDialog_clicked(bool checked); void on_videoFileDialog_clicked(bool checked);