Porównaj commity

...

3 Commity

Autor SHA1 Wiadomość Data
AlexandreRouma da1417b5ab made recorder crash fix more robust 2024-04-22 21:54:01 +02:00
AlexandreRouma e60eca5d6d fix crash when attempting to record from disabled radio 2024-04-22 21:51:49 +02:00
AlexandreRouma ccb10bfb9a fix missing virtual destructors as reported in #1386 2024-04-22 18:54:12 +02:00
6 zmienionych plików z 14 dodań i 9 usunięć

Wyświetl plik

@ -9,6 +9,7 @@
namespace dsp {
class generic_block {
public:
virtual ~generic_block() {}
virtual void start() {}
virtual void stop() {}
virtual int run() { return -1; }
@ -16,8 +17,6 @@ namespace dsp {
class block : public generic_block {
public:
virtual void init() {}
virtual ~block() {
if (!_block_init) { return; }
stop();

Wyświetl plik

@ -10,6 +10,8 @@ namespace dsp {
Operator(stream<A>* a, stream<B>* b) { init(a, b); }
virtual ~Operator() {}
virtual void init(stream<A>* a, stream<B>* b) {
_a = a;
_b = b;

Wyświetl plik

@ -11,6 +11,7 @@
namespace dsp {
class untyped_stream {
public:
virtual ~untyped_stream() {}
virtual bool swap(int size) { return false; }
virtual int read() { return -1; }
virtual void flush() {}

Wyświetl plik

@ -42,6 +42,7 @@ public:
class Instance {
public:
virtual ~Instance() {}
virtual void postInit() = 0;
virtual void enable() = 0;
virtual void disable() = 0;

Wyświetl plik

@ -597,14 +597,16 @@ private:
static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) {
RadioModule* _this = (RadioModule*)ctx;
if (!_this->enabled || !_this->selectedDemod) { return; }
// If no demod is selected, reject the command
if (!_this->selectedDemod) { return; }
// Execute commands
if (code == RADIO_IFACE_CMD_GET_MODE && out) {
int* _out = (int*)out;
*_out = _this->selectedDemodID;
}
else if (code == RADIO_IFACE_CMD_SET_MODE && in) {
else if (code == RADIO_IFACE_CMD_SET_MODE && in && _this->enabled) {
int* _in = (int*)in;
_this->selectDemodByID((DemodID)*_in);
}
@ -612,7 +614,7 @@ private:
float* _out = (float*)out;
*_out = _this->bandwidth;
}
else if (code == RADIO_IFACE_CMD_SET_BANDWIDTH && in) {
else if (code == RADIO_IFACE_CMD_SET_BANDWIDTH && in && _this->enabled) {
float* _in = (float*)in;
if (_this->bandwidthLocked) { return; }
_this->setBandwidth(*_in);
@ -621,7 +623,7 @@ private:
bool* _out = (bool*)out;
*_out = _this->squelchEnabled;
}
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_ENABLED && in) {
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_ENABLED && in && _this->enabled) {
bool* _in = (bool*)in;
_this->setSquelchEnabled(*_in);
}
@ -629,7 +631,7 @@ private:
float* _out = (float*)out;
*_out = _this->squelchLevel;
}
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_LEVEL && in) {
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_LEVEL && in && _this->enabled) {
float* _in = (float*)in;
_this->setSquelchLevel(*_in);
}

Wyświetl plik

@ -476,9 +476,9 @@ private:
sprintf(monStr, "%02d", ltm->tm_mon + 1);
sprintf(yearStr, "%02d", ltm->tm_year + 1900);
if (core::modComManager.getModuleName(name) == "radio") {
int mode;
int mode = -1;
core::modComManager.callInterface(name, RADIO_IFACE_CMD_GET_MODE, NULL, &mode);
modeStr = radioModeToString[mode];
if (mode >= 0) { modeStr = radioModeToString[mode]; };
}
// Replace in template