void soapy_protocol_set_mic_sample_rate(int rate) {
mic_sample_divisor=rate/48000;
-g_print("soapy_protocol_set_mic_sample_rate: rate=%d mic_sample_divisor=%d\n",rate,mic_sample_divisor);
}
void soapy_protocol_change_sample_rate(RECEIVER *rx) {
// rx->mutex already locked
-g_print("soapy_protocol_change_sample_rate: %d\n",rx->sample_rate);
if(rx->sample_rate==radio_sample_rate) {
if(rx->resample_buffer!=NULL) {
g_free(rx->resample_buffer);
rx->resample_buffer=g_new(double,rx->resample_buffer_size);
rx->resampler=create_resample (1,max_samples,rx->buffer,rx->resample_buffer,radio_sample_rate,rx->sample_rate,0.0,0,1.0);
-g_print("soapy_protocol_change_sample_rate: buffer=%p buffer_size=%d resampler=%p\n",rx->resample_buffer,rx->resample_buffer_size,rx->resampler);
}
}
if(soapy_device!=NULL) {
double f=(double)(vfo[v].frequency-vfo[v].lo);
-//g_print("soapy_protocol_set_rx_frequency: %f (%f %f)\n",f,(double)vfo[v].frequency,(double)vfo[v].lo);
rc=SoapySDRDevice_setFrequency(soapy_device,SOAPY_SDR_RX,rx->adc,f,NULL);
if(rc!=0) {
fprintf(stderr,"soapy_protocol: SoapySDRDevice_setFrequency(RX) failed: %s\n",SoapySDR_errToStr(rc));
#include "filter.h"
#include "bandstack.h"
#include "band.h"
-#include "new_protocol.h"
#include "property.h"
#include "radio.h"
#include "receiver.h"
+#include "transmitter.h"
+#include "new_protocol.h"
+#ifdef SOAPYSDR
+#include "soapy_protocol.h"
+#endif
#include "vfo.h"
#include "channel.h"
#include "toolbar.h"
// turn off ctun
vfo[id].ctun=0;
+ vfo[id].ctun_frequency=0LL;
vfo[id].offset=0;
// tell WDSP about the offset
set_offset(active_receiver, vfo[id].offset);
//
calcDriveLevel(); // sends HighPrio packet if in new protocol
}
- if (protocol == NEW_PROTOCOL) {
- schedule_general();
+
+ switch(protocol) {
+ case NEW_PROTOCOL:
+ schedule_general();
+ break;
+#ifdef SOAPYSDR
+ case SOAPYSDR_PROTOCOL:
+ soapy_protocol_set_rx_frequency(active_receiver,id);
+ break;
+#endif
}
g_idle_add(ext_vfo_update,NULL);
}