1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

SSB Modulator: interim state (8) removed non working play loop

This commit is contained in:
f4exb 2016-12-14 02:09:04 +01:00
parent 3e0077c803
commit 3f20b31cc0
5 changed files with 21 additions and 55 deletions

View File

@ -126,8 +126,7 @@ void SSBMod::configure(MessageQueue* messageQueue,
bool audioBinaural, bool audioBinaural,
bool audioFlipChannels, bool audioFlipChannels,
bool dsb, bool dsb,
bool audioMute, bool audioMute)
bool playLoop)
{ {
Message* cmd = MsgConfigureSSBMod::create(bandwidth, Message* cmd = MsgConfigureSSBMod::create(bandwidth,
lowCutoff, lowCutoff,
@ -137,8 +136,7 @@ void SSBMod::configure(MessageQueue* messageQueue,
audioBinaural, audioBinaural,
audioFlipChannels, audioFlipChannels,
dsb, dsb,
audioMute, audioMute);
playLoop);
messageQueue->push(cmd); messageQueue->push(cmd);
} }
@ -220,15 +218,6 @@ void SSBMod::pullAF(Complex& sample)
// ffplay -f f32le -ar 48k -ac 1 f4exb_call.raw // ffplay -f f32le -ar 48k -ac 1 f4exb_call.raw
if (m_ifstream.is_open()) if (m_ifstream.is_open())
{ {
if (m_ifstream.eof())
{
if (m_running.m_playLoop)
{
m_ifstream.clear();
m_ifstream.seekg(0, std::ios::beg);
}
}
if (m_ifstream.eof()) if (m_ifstream.eof())
{ {
ci.real(0.0f); ci.real(0.0f);
@ -493,7 +482,6 @@ bool SSBMod::handleMessage(const Message& cmd)
m_config.m_audioFlipChannels = cfg.getAudioFlipChannels(); m_config.m_audioFlipChannels = cfg.getAudioFlipChannels();
m_config.m_dsb = cfg.getDSB(); m_config.m_dsb = cfg.getDSB();
m_config.m_audioMute = cfg.getAudioMute(); m_config.m_audioMute = cfg.getAudioMute();
m_config.m_playLoop = cfg.getPlayLoop();
apply(); apply();
@ -508,8 +496,7 @@ bool SSBMod::handleMessage(const Message& cmd)
<< " m_audioBinaural: " << m_config.m_audioBinaural << " m_audioBinaural: " << m_config.m_audioBinaural
<< " m_audioFlipChannels: " << m_config.m_audioFlipChannels << " m_audioFlipChannels: " << m_config.m_audioFlipChannels
<< " m_dsb: " << m_config.m_dsb << " m_dsb: " << m_config.m_dsb
<< " m_audioMute: " << m_config.m_audioMute << " m_audioMute: " << m_config.m_audioMute;
<< " m_playLoop: " << m_config.m_playLoop;
return true; return true;
} }
@ -632,7 +619,6 @@ void SSBMod::apply()
m_running.m_audioFlipChannels = m_config.m_audioFlipChannels; m_running.m_audioFlipChannels = m_config.m_audioFlipChannels;
m_running.m_dsb = m_config.m_dsb; m_running.m_dsb = m_config.m_dsb;
m_running.m_audioMute = m_config.m_audioMute; m_running.m_audioMute = m_config.m_audioMute;
m_running.m_playLoop = m_config.m_playLoop;
} }
void SSBMod::openFileStream() void SSBMod::openFileStream()

View File

@ -186,8 +186,7 @@ public:
bool audioBinaural, bool audioBinaural,
bool audioFlipChannels, bool audioFlipChannels,
bool dsb, bool dsb,
bool audioMute, bool audioMute);
bool playLoop);
virtual void pull(Sample& sample); virtual void pull(Sample& sample);
virtual void start(); virtual void start();
@ -223,7 +222,6 @@ private:
bool getAudioFlipChannels() const { return m_audioFlipChannels; } bool getAudioFlipChannels() const { return m_audioFlipChannels; }
bool getDSB() const { return m_dsb; } bool getDSB() const { return m_dsb; }
bool getAudioMute() const { return m_audioMute; } bool getAudioMute() const { return m_audioMute; }
bool getPlayLoop() const { return m_playLoop; }
static MsgConfigureSSBMod* create(Real bandwidth, static MsgConfigureSSBMod* create(Real bandwidth,
Real lowCutoff, Real lowCutoff,
@ -233,8 +231,7 @@ private:
bool audioBinaural, bool audioBinaural,
bool audioFlipChannels, bool audioFlipChannels,
bool dsb, bool dsb,
bool audioMute, bool audioMute)
bool playLoop)
{ {
return new MsgConfigureSSBMod(bandwidth, return new MsgConfigureSSBMod(bandwidth,
lowCutoff, lowCutoff,
@ -244,8 +241,7 @@ private:
audioBinaural, audioBinaural,
audioFlipChannels, audioFlipChannels,
dsb, dsb,
audioMute, audioMute);
playLoop);
} }
private: private:
@ -258,7 +254,6 @@ private:
bool m_audioFlipChannels; bool m_audioFlipChannels;
bool m_dsb; bool m_dsb;
bool m_audioMute; bool m_audioMute;
bool m_playLoop;
MsgConfigureSSBMod(Real bandwidth, MsgConfigureSSBMod(Real bandwidth,
Real lowCutoff, Real lowCutoff,
@ -268,8 +263,7 @@ private:
bool audioBinaural, bool audioBinaural,
bool audioFlipChannels, bool audioFlipChannels,
bool dsb, bool dsb,
bool audioMute, bool audioMute) :
bool playLoop) :
Message(), Message(),
m_bandwidth(bandwidth), m_bandwidth(bandwidth),
m_lowCutoff(lowCutoff), m_lowCutoff(lowCutoff),
@ -279,8 +273,7 @@ private:
m_audioBinaural(audioBinaural), m_audioBinaural(audioBinaural),
m_audioFlipChannels(audioFlipChannels), m_audioFlipChannels(audioFlipChannels),
m_dsb(dsb), m_dsb(dsb),
m_audioMute(audioMute), m_audioMute(audioMute)
m_playLoop(playLoop)
{ } { }
}; };
@ -311,7 +304,6 @@ private:
bool m_audioFlipChannels; bool m_audioFlipChannels;
bool m_dsb; bool m_dsb;
bool m_audioMute; bool m_audioMute;
bool m_playLoop;
Config() : Config() :
m_outputSampleRate(0), m_outputSampleRate(0),
@ -326,8 +318,7 @@ private:
m_audioBinaural(false), m_audioBinaural(false),
m_audioFlipChannels(false), m_audioFlipChannels(false),
m_dsb(false), m_dsb(false),
m_audioMute(false), m_audioMute(false)
m_playLoop(false)
{ } { }
}; };

View File

@ -263,10 +263,19 @@ void SSBModGUI::on_dsb_toggled(bool checked)
setNewRate(m_spanLog2); setNewRate(m_spanLog2);
} }
void SSBModGUI::on_spanLog2_valueChanged(int value)
{
if (setNewRate(value))
{
applySettings();
}
}
void SSBModGUI::on_BW_valueChanged(int value) void SSBModGUI::on_BW_valueChanged(int value)
{ {
ui->BWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1)); ui->BWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
m_channelMarker.setBandwidth(value * 100); m_channelMarker.setBandwidth(value * 200);
applySettings(); applySettings();
} }
@ -329,11 +338,6 @@ void SSBModGUI::on_audioMute_toggled(bool checked)
applySettings(); applySettings();
} }
void SSBModGUI::on_playLoop_toggled(bool checked)
{
applySettings();
}
void SSBModGUI::on_play_toggled(bool checked) void SSBModGUI::on_play_toggled(bool checked)
{ {
ui->tone->setEnabled(!checked); // release other source inputs ui->tone->setEnabled(!checked); // release other source inputs
@ -594,8 +598,7 @@ void SSBModGUI::applySettings()
ui->audioBinaural->isChecked(), ui->audioBinaural->isChecked(),
ui->audioFlipChannels->isChecked(), ui->audioFlipChannels->isChecked(),
ui->dsb->isChecked(), ui->dsb->isChecked(),
ui->audioMute->isChecked(), ui->audioMute->isChecked());
ui->playLoop->isChecked());
} }
} }

View File

@ -62,6 +62,7 @@ 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_dsb_toggled(bool checked); void on_dsb_toggled(bool checked);
void on_spanLog2_valueChanged(int value);
void on_BW_valueChanged(int value); void on_BW_valueChanged(int value);
void on_lowCut_valueChanged(int value); void on_lowCut_valueChanged(int value);
void on_volume_valueChanged(int value); void on_volume_valueChanged(int value);
@ -72,7 +73,6 @@ private slots:
void on_play_toggled(bool checked); void on_play_toggled(bool checked);
void on_morseKeyer_toggled(bool checked); void on_morseKeyer_toggled(bool checked);
void on_playLoop_toggled(bool checked);
void on_navTimeSlider_valueChanged(int value); void on_navTimeSlider_valueChanged(int value);
void on_showFileDialog_clicked(bool checked); void on_showFileDialog_clicked(bool checked);

View File

@ -614,20 +614,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="ButtonSwitch" name="playLoop">
<property name="toolTip">
<string>Play record file in a loop</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/playloop.png</normaloff>:/playloop.png</iconset>
</property>
</widget>
</item>
<item> <item>
<widget class="ButtonSwitch" name="play"> <widget class="ButtonSwitch" name="play">
<property name="toolTip"> <property name="toolTip">