1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-24 10:50:29 -05:00

DSD demod plugin: DMR refactoring: allow stereo split of TDMA channels. Works with mbelib support only

This commit is contained in:
f4exb 2016-09-07 00:16:08 +02:00
parent 87bb930a13
commit 6dfa20db20
6 changed files with 54 additions and 10 deletions

View File

@ -47,6 +47,7 @@ public:
const unsigned char *getMbeDVFrame2() const { return m_decoder.getMbeDVFrame2(); }
bool getVoice1On() const { return m_decoder.getVoice1On(); }
bool getVoice2On() const { return m_decoder.getVoice2On(); }
void setTDMAStereo(bool tdmaStereo) { m_decoder.setTDMAStereo(tdmaStereo); }
int getMbeRateIndex() const { return (int) m_decoder.getMbeRate(); }

View File

@ -90,7 +90,8 @@ void DSDDemod::configure(MessageQueue* messageQueue,
bool enableCosineFiltering,
bool syncOrConstellation,
bool slot1On,
bool slot2On)
bool slot2On,
bool tdmaStereo)
{
Message* cmd = MsgConfigureDSDDemod::create(rfBandwidth,
demodGain,
@ -103,7 +104,8 @@ void DSDDemod::configure(MessageQueue* messageQueue,
enableCosineFiltering,
syncOrConstellation,
slot1On,
slot2On);
slot2On,
tdmaStereo);
messageQueue->push(cmd);
}
@ -329,6 +331,7 @@ bool DSDDemod::handleMessage(const Message& cmd)
m_config.m_syncOrConstellation = cfg.getSyncOrConstellation();
m_config.m_slot1On = cfg.getSlot1On();
m_config.m_slot2On = cfg.getSlot2On();
m_config.m_tdmaStereo = cfg.getTDMAStereo();
apply();
@ -343,7 +346,8 @@ bool DSDDemod::handleMessage(const Message& cmd)
<< " m_enableCosineFiltering: " << m_config.m_enableCosineFiltering
<< " m_syncOrConstellation: " << m_config.m_syncOrConstellation
<< " m_slot1On: " << m_config.m_slot1On
<< " m_slot2On: " << m_config.m_slot2On;
<< " m_slot2On: " << m_config.m_slot2On
<< " m_tdmaStereo: " << m_config.m_tdmaStereo;
return true;
}
@ -405,6 +409,11 @@ void DSDDemod::apply()
m_dsdDecoder.enableCosineFiltering(m_config.m_enableCosineFiltering);
}
if (m_config.m_tdmaStereo != m_running.m_tdmaStereo)
{
m_dsdDecoder.setTDMAStereo(m_config.m_tdmaStereo);
}
m_running.m_inputSampleRate = m_config.m_inputSampleRate;
m_running.m_inputFrequencyOffset = m_config.m_inputFrequencyOffset;
m_running.m_rfBandwidth = m_config.m_rfBandwidth;
@ -420,4 +429,5 @@ void DSDDemod::apply()
m_running.m_syncOrConstellation = m_config.m_syncOrConstellation;
m_running.m_slot1On = m_config.m_slot1On;
m_running.m_slot2On = m_config.m_slot2On;
m_running.m_tdmaStereo = m_config.m_tdmaStereo;
}

View File

@ -52,7 +52,8 @@ public:
bool enableCosineFiltering,
bool syncOrConstellation,
bool slot1On,
bool slot2On);
bool slot2On,
bool tdmaStereo);
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
@ -85,6 +86,7 @@ private:
bool getSyncOrConstellation() const { return m_syncOrConstellation; }
bool getSlot1On() const { return m_slot1On; }
bool getSlot2On() const { return m_slot2On; }
bool getTDMAStereo() const { return m_tdmaStereo; }
static MsgConfigureDSDDemod* create(int rfBandwidth,
int demodGain,
@ -97,7 +99,8 @@ private:
bool enableCosineFiltering,
bool syncOrConstellation,
bool slot1On,
bool slot2On)
bool slot2On,
bool tdmaStereo)
{
return new MsgConfigureDSDDemod(rfBandwidth,
demodGain,
@ -110,7 +113,8 @@ private:
enableCosineFiltering,
syncOrConstellation,
slot1On,
slot2On);
slot2On,
tdmaStereo);
}
private:
@ -126,6 +130,7 @@ private:
bool m_syncOrConstellation;
bool m_slot1On;
bool m_slot2On;
bool m_tdmaStereo;
MsgConfigureDSDDemod(int rfBandwidth,
int demodGain,
@ -138,7 +143,8 @@ private:
bool enableCosineFiltering,
bool syncOrConstellation,
bool slot1On,
bool slot2On) :
bool slot2On,
bool tdmaStereo) :
Message(),
m_rfBandwidth(rfBandwidth),
m_demodGain(demodGain),
@ -151,7 +157,8 @@ private:
m_enableCosineFiltering(enableCosineFiltering),
m_syncOrConstellation(syncOrConstellation),
m_slot1On(slot1On),
m_slot2On(slot2On)
m_slot2On(slot2On),
m_tdmaStereo(tdmaStereo)
{ }
};
@ -182,6 +189,7 @@ private:
bool m_syncOrConstellation;
bool m_slot1On;
bool m_slot2On;
bool m_tdmaStereo;
Config() :
m_inputSampleRate(-1),
@ -198,7 +206,8 @@ private:
m_enableCosineFiltering(false),
m_syncOrConstellation(false),
m_slot1On(false),
m_slot2On(false)
m_slot2On(false),
m_tdmaStereo(false)
{ }
};

View File

@ -267,6 +267,12 @@ void DSDDemodGUI::on_slot2On_toggled(bool checked)
applySettings();
}
void DSDDemodGUI::on_tdmaStereoSplit_toggled(bool checked)
{
m_tdmaStereo = checked;
applySettings();
}
void DSDDemodGUI::on_squelchGate_valueChanged(int value)
{
applySettings();
@ -315,6 +321,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa
m_syncOrConstellation(false),
m_slot1On(false),
m_slot2On(false),
m_tdmaStereo(false),
m_squelchOpen(false),
m_channelPowerDbAvg(20,0),
m_tickCount(0)
@ -406,7 +413,8 @@ void DSDDemodGUI::applySettings()
m_enableCosineFiltering,
m_syncOrConstellation,
m_slot1On,
m_slot2On);
m_slot2On,
m_tdmaStereo);
}
}

View File

@ -69,6 +69,7 @@ private slots:
void on_syncOrConstellation_toggled(bool checked);
void on_slot1On_toggled(bool checked);
void on_slot2On_toggled(bool checked);
void on_tdmaStereoSplit_toggled(bool checked);
void on_fmDeviation_valueChanged(int value);
void on_squelchGate_valueChanged(int value);
void on_squelch_valueChanged(int value);
@ -104,6 +105,7 @@ private:
bool m_syncOrConstellation;
bool m_slot1On;
bool m_slot2On;
bool m_tdmaStereo;
bool m_audioMute;
bool m_squelchOpen;
MovingAverage<Real> m_channelPowerDbAvg;

View File

@ -638,6 +638,20 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="tdmaStereoSplit">
<property name="toolTip">
<string>Split TDMA channels on left (slot 1) and right (slot 2) audio channels</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/stereo.png</normaloff>:/stereo.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="squelchLabel">
<property name="text">