mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 08:24:43 -04:00
Gain settings.
This commit is contained in:
@@ -23,16 +23,19 @@
|
||||
#include "util/simpleserializer.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(V4LInput::MsgConfigureV4L, Message)
|
||||
MESSAGE_CLASS_DEFINITION(V4LInput::MsgReportV4L, Message)
|
||||
|
||||
V4LInput::Settings::Settings() :
|
||||
m_gain(6)
|
||||
m_gain(1),
|
||||
m_lna(0),
|
||||
m_mix(0)
|
||||
{
|
||||
}
|
||||
|
||||
void V4LInput::Settings::resetToDefaults()
|
||||
{
|
||||
m_gain = 6;
|
||||
m_gain = 1;
|
||||
m_lna = 0;
|
||||
m_mix = 0;
|
||||
}
|
||||
|
||||
QByteArray V4LInput::Settings::serialize() const
|
||||
@@ -53,7 +56,7 @@ bool V4LInput::Settings::deserialize(const QByteArray& data)
|
||||
}
|
||||
|
||||
if(d.getVersion() == 1) {
|
||||
d.readS32(1, &m_gain, 6);
|
||||
d.readS32(1, &m_gain, 1);
|
||||
//d.readS32(2, &m_samplerate, 0);
|
||||
return true;
|
||||
} else {
|
||||
@@ -155,13 +158,19 @@ void V4LInput::applySettings(const GeneralSettings& generalSettings, const Setti
|
||||
|
||||
if((m_generalSettings.m_centerFrequency != generalSettings.m_centerFrequency) || force) {
|
||||
m_V4LThread->set_center_freq( (double)generalSettings.m_centerFrequency );
|
||||
m_generalSettings.m_centerFrequency = generalSettings.m_centerFrequency;
|
||||
}
|
||||
m_generalSettings.m_centerFrequency = generalSettings.m_centerFrequency;
|
||||
#if 0
|
||||
|
||||
if((m_settings.m_gain != settings.m_gain) || force) {
|
||||
m_settings.m_gain = settings.m_gain;
|
||||
m_V4LThread->set_tuner_gain((double)m_settings.m_gain);
|
||||
}
|
||||
#endif
|
||||
|
||||
if((m_settings.m_lna != settings.m_lna) || (m_settings.m_mix != settings.m_mix) || force) {
|
||||
m_settings.m_lna = settings.m_lna;
|
||||
m_settings.m_mix = settings.m_mix;
|
||||
m_V4LThread->set_amps(1, m_settings.m_lna);
|
||||
m_V4LThread->set_amps(0, m_settings.m_mix);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user