@@ -38,12 +38,16 @@ class AirspySourceModule : public ModuleManager::Instance {
38
38
handler.stream = &stream;
39
39
40
40
refresh ();
41
+ if (sampleRateList.size () > 0 ) {
42
+ sampleRate = sampleRateList[0 ];
43
+ }
41
44
42
45
// Select device from config
43
46
config.aquire ();
44
47
std::string devSerial = config.conf [" device" ];
45
48
config.release ();
46
49
selectByString (devSerial);
50
+ core::setInputSampleRate (sampleRate);
47
51
48
52
sigpath::sourceManager.registerSource (" Airspy" , &handler);
49
53
}
@@ -145,11 +149,13 @@ class AirspySourceModule : public ModuleManager::Instance {
145
149
146
150
// Load sample rate
147
151
srId = 0 ;
152
+ sampleRate = sampleRateList[0 ];
148
153
if (config.conf [" devices" ][selectedSerStr].contains (" sampleRate" )) {
149
154
int selectedSr = config.conf [" devices" ][selectedSerStr][" sampleRate" ];
150
155
for (int i = 0 ; i < sampleRateList.size (); i++) {
151
156
if (sampleRateList[i] == selectedSr) {
152
157
srId = i;
158
+ sampleRate = selectedSr;
153
159
break ;
154
160
}
155
161
}
@@ -304,6 +310,7 @@ class AirspySourceModule : public ModuleManager::Instance {
304
310
ImGui::SetNextItemWidth (menuWidth);
305
311
if (ImGui::Combo (CONCAT (" ##_airspy_dev_sel_" , _this->name ), &_this->devId , _this->devListTxt .c_str ())) {
306
312
_this->selectBySerial (_this->devList [_this->devId ]);
313
+ core::setInputSampleRate (_this->sampleRate );
307
314
if (_this->selectedSerStr != " " ) {
308
315
config.aquire ();
309
316
config.conf [" device" ] = _this->selectedSerStr ;
@@ -329,6 +336,7 @@ class AirspySourceModule : public ModuleManager::Instance {
329
336
std::string devSerial = config.conf [" device" ];
330
337
config.release ();
331
338
_this->selectByString (devSerial);
339
+ core::setInputSampleRate (_this->sampleRate );
332
340
}
333
341
334
342
if (_this->running ) { style::endDisabled (); }
0 commit comments