mirror of
				https://github.com/cjcliffe/CubicSDR.git
				synced 2025-11-04 05:30:23 -05:00 
			
		
		
		
	Cleanup: appframe, bookmarks, sessions, core app
This commit is contained in:
		
							parent
							
								
									7aa7daa55f
								
							
						
					
					
						commit
						f97f368a6a
					
				@ -6,35 +6,35 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <wx/msgdlg.h>
 | 
					#include <wx/msgdlg.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DeviceConfig::DeviceConfig() : deviceId("") {
 | 
					DeviceConfig::DeviceConfig() {
 | 
				
			||||||
	ppm.store(0);
 | 
						ppm.store(0);
 | 
				
			||||||
	offset.store(0);
 | 
						offset.store(0);
 | 
				
			||||||
    agcMode.store(true);
 | 
					    agcMode.store(true);
 | 
				
			||||||
    sampleRate.store(0);
 | 
					    sampleRate.store(0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DeviceConfig::DeviceConfig(std::string deviceId) : DeviceConfig() {
 | 
					DeviceConfig::DeviceConfig(std::string deviceId_in) : DeviceConfig() {
 | 
				
			||||||
    this->deviceId = deviceId;
 | 
					    deviceId = deviceId_in;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setPPM(int ppm) {
 | 
					void DeviceConfig::setPPM(int ppm_in) {
 | 
				
			||||||
    this->ppm.store(ppm);
 | 
					    ppm.store(ppm_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int DeviceConfig::getPPM() {
 | 
					int DeviceConfig::getPPM() {
 | 
				
			||||||
    return ppm.load();
 | 
					    return ppm.load();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setOffset(long long offset) {
 | 
					void DeviceConfig::setOffset(long long offset_in) {
 | 
				
			||||||
    this->offset.store(offset);
 | 
					    offset.store(offset_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
long long DeviceConfig::getOffset() {
 | 
					long long DeviceConfig::getOffset() {
 | 
				
			||||||
    return offset.load();
 | 
					    return offset.load();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setSampleRate(long srate) {
 | 
					void DeviceConfig::setSampleRate(long sampleRate_in) {
 | 
				
			||||||
    sampleRate.store(srate);
 | 
					    sampleRate.store(sampleRate_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
long DeviceConfig::getSampleRate() {
 | 
					long DeviceConfig::getSampleRate() {
 | 
				
			||||||
@ -49,8 +49,8 @@ const std::string& DeviceConfig::getAntennaName() {
 | 
				
			|||||||
    return antennaName;
 | 
					    return antennaName;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setAGCMode(bool agcMode) {
 | 
					void DeviceConfig::setAGCMode(bool agcMode_in) {
 | 
				
			||||||
    this->agcMode.store(agcMode);
 | 
					    agcMode.store(agcMode_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool DeviceConfig::getAGCMode() {
 | 
					bool DeviceConfig::getAGCMode() {
 | 
				
			||||||
@ -58,9 +58,9 @@ bool DeviceConfig::getAGCMode() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setDeviceId(std::string deviceId) {
 | 
					void DeviceConfig::setDeviceId(std::string deviceId_in) {
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::mutex > lock(busy_lock);
 | 
				
			||||||
    this->deviceId = deviceId;
 | 
					    deviceId = deviceId_in;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -74,18 +74,16 @@ std::string DeviceConfig::getDeviceId() {
 | 
				
			|||||||
    return tmp;
 | 
					    return tmp;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setDeviceName(std::string deviceName) {
 | 
					void DeviceConfig::setDeviceName(std::string deviceName_in) {
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::mutex > lock(busy_lock);
 | 
				
			||||||
    this->deviceName = deviceName;
 | 
					    deviceName = deviceName_in;
 | 
				
			||||||
   
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::string DeviceConfig::getDeviceName() {
 | 
					std::string DeviceConfig::getDeviceName() {
 | 
				
			||||||
    std::string tmp;
 | 
					    std::string tmp;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::mutex > lock(busy_lock);
 | 
				
			||||||
    tmp = (deviceName=="")?deviceId:deviceName;
 | 
					    tmp = deviceName.empty()?deviceId:deviceName;
 | 
				
			||||||
   
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    return tmp;
 | 
					    return tmp;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -105,19 +103,19 @@ void DeviceConfig::save(DataNode *node) {
 | 
				
			|||||||
        *node->newChild("antenna") = antennaName;
 | 
					        *node->newChild("antenna") = antennaName;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (streamOpts.size()) {
 | 
					    if (!streamOpts.empty()) {
 | 
				
			||||||
        DataNode *streamOptsNode = node->newChild("streamOpts");
 | 
					        DataNode *streamOptsNode = node->newChild("streamOpts");
 | 
				
			||||||
        for (ConfigSettings::const_iterator opt_i = streamOpts.begin(); opt_i != streamOpts.end(); opt_i++) {
 | 
					        for (ConfigSettings::const_iterator opt_i = streamOpts.begin(); opt_i != streamOpts.end(); opt_i++) {
 | 
				
			||||||
            *streamOptsNode->newChild(opt_i->first.c_str()) = opt_i->second;
 | 
					            *streamOptsNode->newChild(opt_i->first.c_str()) = opt_i->second;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (settings.size()) {
 | 
					    if (!settings.empty()) {
 | 
				
			||||||
        DataNode *settingsNode = node->newChild("settings");
 | 
					        DataNode *settingsNode = node->newChild("settings");
 | 
				
			||||||
        for (ConfigSettings::const_iterator set_i = settings.begin(); set_i != settings.end(); set_i++) {
 | 
					        for (ConfigSettings::const_iterator set_i = settings.begin(); set_i != settings.end(); set_i++) {
 | 
				
			||||||
            *settingsNode->newChild(set_i->first.c_str()) = set_i->second;
 | 
					            *settingsNode->newChild(set_i->first.c_str()) = set_i->second;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (rigIF.size()) {
 | 
					    if (!rigIF.empty()) {
 | 
				
			||||||
        DataNode *rigIFs = node->newChild("rig_ifs");
 | 
					        DataNode *rigIFs = node->newChild("rig_ifs");
 | 
				
			||||||
        for (std::map<int, long long>::const_iterator rigIF_i = rigIF.begin(); rigIF_i != rigIF.end(); rigIF_i++) {
 | 
					        for (std::map<int, long long>::const_iterator rigIF_i = rigIF.begin(); rigIF_i != rigIF.end(); rigIF_i++) {
 | 
				
			||||||
            DataNode *ifNode = rigIFs->newChild("rig_if");
 | 
					            DataNode *ifNode = rigIFs->newChild("rig_if");
 | 
				
			||||||
@ -125,7 +123,7 @@ void DeviceConfig::save(DataNode *node) {
 | 
				
			|||||||
            *ifNode->newChild("sdr_if") = rigIF_i->second;
 | 
					            *ifNode->newChild("sdr_if") = rigIF_i->second;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (gains.size()) {
 | 
					    if (!gains.empty()) {
 | 
				
			||||||
        DataNode *gainsNode = node->newChild("gains");
 | 
					        DataNode *gainsNode = node->newChild("gains");
 | 
				
			||||||
        for (ConfigGains::const_iterator gain_i = gains.begin(); gain_i != gains.end(); gain_i++) {
 | 
					        for (ConfigGains::const_iterator gain_i = gains.begin(); gain_i != gains.end(); gain_i++) {
 | 
				
			||||||
            DataNode *gainNode = gainsNode->newChild("gain");
 | 
					            DataNode *gainNode = gainsNode->newChild("gain");
 | 
				
			||||||
@ -157,7 +155,7 @@ void DeviceConfig::load(DataNode *node) {
 | 
				
			|||||||
        DataNode *agc_node = node->getNext("agc_mode");
 | 
					        DataNode *agc_node = node->getNext("agc_mode");
 | 
				
			||||||
        int agcModeValue = 0;
 | 
					        int agcModeValue = 0;
 | 
				
			||||||
        agc_node->element()->get(agcModeValue);
 | 
					        agc_node->element()->get(agcModeValue);
 | 
				
			||||||
        setAGCMode(agcModeValue?true:false);
 | 
					        setAGCMode(agcModeValue != 0);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (node->hasAnother("sample_rate")) {
 | 
					    if (node->hasAnother("sample_rate")) {
 | 
				
			||||||
        DataNode *sample_rate_node = node->getNext("sample_rate");
 | 
					        DataNode *sample_rate_node = node->getNext("sample_rate");
 | 
				
			||||||
@ -178,7 +176,7 @@ void DeviceConfig::load(DataNode *node) {
 | 
				
			|||||||
            std::string keyName = streamOptNode->getName();
 | 
					            std::string keyName = streamOptNode->getName();
 | 
				
			||||||
            std::string strSettingValue = streamOptNode->element()->toString();
 | 
					            std::string strSettingValue = streamOptNode->element()->toString();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            if (keyName != "") {
 | 
					            if (!keyName.empty()) {
 | 
				
			||||||
                setStreamOpt(keyName, strSettingValue);
 | 
					                setStreamOpt(keyName, strSettingValue);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -190,7 +188,7 @@ void DeviceConfig::load(DataNode *node) {
 | 
				
			|||||||
            std::string keyName = settingNode->getName();
 | 
					            std::string keyName = settingNode->getName();
 | 
				
			||||||
            std::string strSettingValue = settingNode->element()->toString();
 | 
					            std::string strSettingValue = settingNode->element()->toString();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            if (keyName != "") {
 | 
					            if (!keyName.empty()) {
 | 
				
			||||||
                setSetting(keyName, strSettingValue);
 | 
					                setSetting(keyName, strSettingValue);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -201,7 +199,7 @@ void DeviceConfig::load(DataNode *node) {
 | 
				
			|||||||
            DataNode *rigIFNode = rigIFNodes->getNext("rig_if");
 | 
					            DataNode *rigIFNode = rigIFNodes->getNext("rig_if");
 | 
				
			||||||
            if (rigIFNode->hasAnother("model") && rigIFNode->hasAnother("sdr_if")) {
 | 
					            if (rigIFNode->hasAnother("model") && rigIFNode->hasAnother("sdr_if")) {
 | 
				
			||||||
                int load_model;
 | 
					                int load_model;
 | 
				
			||||||
                long long load_freq;
 | 
					                long long load_freq = 0;
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                rigIFNode->getNext("model")->element()->get(load_model);
 | 
					                rigIFNode->getNext("model")->element()->get(load_model);
 | 
				
			||||||
                rigIFNode->getNext("sdr_if")->element()->get(load_freq);
 | 
					                rigIFNode->getNext("sdr_if")->element()->get(load_freq);
 | 
				
			||||||
@ -215,12 +213,12 @@ void DeviceConfig::load(DataNode *node) {
 | 
				
			|||||||
        while (gainsNode->hasAnother("gain")) {
 | 
					        while (gainsNode->hasAnother("gain")) {
 | 
				
			||||||
            DataNode *gainNode = gainsNode->getNext("gain");
 | 
					            DataNode *gainNode = gainsNode->getNext("gain");
 | 
				
			||||||
            std::string keyName;
 | 
					            std::string keyName;
 | 
				
			||||||
            float fltSettingValue;
 | 
					            float fltSettingValue = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            gainNode->getNext("id")->element()->get(keyName);
 | 
					            gainNode->getNext("id")->element()->get(keyName);
 | 
				
			||||||
            gainNode->getNext("value")->element()->get(fltSettingValue);
 | 
					            gainNode->getNext("value")->element()->get(fltSettingValue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (keyName != "" && !(fltSettingValue!=fltSettingValue)) {
 | 
					            if (!keyName.empty() && !(fltSettingValue!=fltSettingValue)) {
 | 
				
			||||||
                setGain(keyName, fltSettingValue);
 | 
					                setGain(keyName, fltSettingValue);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -236,11 +234,11 @@ ConfigSettings DeviceConfig::getStreamOpts() {
 | 
				
			|||||||
    return streamOpts;
 | 
					    return streamOpts;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setStreamOpt(std::string key, std::string value) {
 | 
					void DeviceConfig::setStreamOpt(const std::string& key, std::string value) {
 | 
				
			||||||
    streamOpts[key] = value;
 | 
					    streamOpts[key] = value;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::string DeviceConfig::getStreamOpt(std::string key, std::string defaultValue) {
 | 
					std::string DeviceConfig::getStreamOpt(const std::string& key, std::string defaultValue) {
 | 
				
			||||||
    if (streamOpts.find(key) == streamOpts.end()) {
 | 
					    if (streamOpts.find(key) == streamOpts.end()) {
 | 
				
			||||||
        return defaultValue;
 | 
					        return defaultValue;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -248,15 +246,15 @@ std::string DeviceConfig::getStreamOpt(std::string key, std::string defaultValue
 | 
				
			|||||||
    return streamOpts[key];
 | 
					    return streamOpts[key];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setSettings(ConfigSettings settings) {
 | 
					void DeviceConfig::setSettings(ConfigSettings settings_in) {
 | 
				
			||||||
    this->settings = settings;
 | 
					    settings = settings_in;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setSetting(std::string key, std::string value) {
 | 
					void DeviceConfig::setSetting(const std::string& key, std::string value) {
 | 
				
			||||||
    this->settings[key] = value;
 | 
					    settings[key] = value;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::string DeviceConfig::getSetting(std::string key, std::string defaultValue) {
 | 
					std::string DeviceConfig::getSetting(const std::string& key, std::string defaultValue) {
 | 
				
			||||||
    if (settings.find(key) == settings.end()) {
 | 
					    if (settings.find(key) == settings.end()) {
 | 
				
			||||||
        return defaultValue;
 | 
					        return defaultValue;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -268,19 +266,19 @@ ConfigSettings DeviceConfig::getSettings() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setGains(ConfigGains gains) {
 | 
					void DeviceConfig::setGains(ConfigGains gains_in) {
 | 
				
			||||||
    this->gains = gains;
 | 
					    gains = gains_in;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ConfigGains DeviceConfig::getGains() {
 | 
					ConfigGains DeviceConfig::getGains() {
 | 
				
			||||||
    return gains;
 | 
					    return gains;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeviceConfig::setGain(std::string key, float value) {
 | 
					void DeviceConfig::setGain(const std::string& key, float value) {
 | 
				
			||||||
    gains[key] = value;
 | 
					    gains[key] = value;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
float DeviceConfig::getGain(std::string key, float defaultValue) {
 | 
					float DeviceConfig::getGain(const std::string& key, float defaultValue) {
 | 
				
			||||||
    if (gains.find(key) != gains.end()) {
 | 
					    if (gains.find(key) != gains.end()) {
 | 
				
			||||||
        return gains[key];
 | 
					        return gains[key];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -299,7 +297,7 @@ long long DeviceConfig::getRigIF(int rigType) {
 | 
				
			|||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AppConfig::AppConfig() : configName("") {
 | 
					AppConfig::AppConfig() {
 | 
				
			||||||
    winX.store(0);
 | 
					    winX.store(0);
 | 
				
			||||||
    winY.store(0);
 | 
					    winY.store(0);
 | 
				
			||||||
    winW.store(0);
 | 
					    winW.store(0);
 | 
				
			||||||
@ -334,7 +332,7 @@ AppConfig::AppConfig() : configName("") {
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DeviceConfig *AppConfig::getDevice(std::string deviceId) {
 | 
					DeviceConfig *AppConfig::getDevice(const std::string& deviceId) {
 | 
				
			||||||
	if (deviceConfig.find(deviceId) == deviceConfig.end()) {
 | 
						if (deviceConfig.find(deviceId) == deviceConfig.end()) {
 | 
				
			||||||
		deviceConfig[deviceId] = new DeviceConfig();
 | 
							deviceConfig[deviceId] = new DeviceConfig();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -402,23 +400,23 @@ AppConfig::PerfModeEnum AppConfig::getPerfMode() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRect *AppConfig::getWindow() {
 | 
					wxRect *AppConfig::getWindow() {
 | 
				
			||||||
    wxRect *r = NULL;
 | 
					    wxRect *r = nullptr;
 | 
				
			||||||
    if (winH.load() && winW.load()) {
 | 
					    if (winH.load() && winW.load()) {
 | 
				
			||||||
        r = new wxRect(winX.load(),winY.load(),winW.load(),winH.load());
 | 
					        r = new wxRect(winX.load(),winY.load(),winW.load(),winH.load());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return r;
 | 
					    return r;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setTheme(int themeId) {
 | 
					void AppConfig::setTheme(int themeId_in) {
 | 
				
			||||||
    this->themeId.store(themeId);
 | 
					    themeId.store(themeId_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int AppConfig::getTheme() {
 | 
					int AppConfig::getTheme() {
 | 
				
			||||||
    return themeId.load();
 | 
					    return themeId.load();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setFontScale(int fontScale) {
 | 
					void AppConfig::setFontScale(int fontScale_in) {
 | 
				
			||||||
    this->fontScale.store(fontScale);
 | 
					    fontScale.store(fontScale_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int AppConfig::getFontScale() {
 | 
					int AppConfig::getFontScale() {
 | 
				
			||||||
@ -540,7 +538,7 @@ void  AppConfig::setRecordingSquelchOption(int enumChoice) {
 | 
				
			|||||||
	recordingSquelchOption = enumChoice;
 | 
						recordingSquelchOption = enumChoice;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int  AppConfig::getRecordingSquelchOption() {
 | 
					int  AppConfig::getRecordingSquelchOption() const {
 | 
				
			||||||
	return recordingSquelchOption;
 | 
						return recordingSquelchOption;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -548,13 +546,13 @@ void  AppConfig::setRecordingFileTimeLimit(int nbSeconds) {
 | 
				
			|||||||
	recordingFileTimeLimitSeconds = nbSeconds;
 | 
						recordingFileTimeLimitSeconds = nbSeconds;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int  AppConfig::getRecordingFileTimeLimit() {
 | 
					int  AppConfig::getRecordingFileTimeLimit() const {
 | 
				
			||||||
	return recordingFileTimeLimitSeconds;
 | 
						return recordingFileTimeLimitSeconds;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setConfigName(std::string configName) {
 | 
					void AppConfig::setConfigName(std::string configName_in) {
 | 
				
			||||||
    this->configName = configName;
 | 
					    configName = configName_in;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::string AppConfig::getConfigFileName(bool ignoreName) {
 | 
					std::string AppConfig::getConfigFileName(bool ignoreName) {
 | 
				
			||||||
@ -597,7 +595,7 @@ bool AppConfig::save() {
 | 
				
			|||||||
        *window_node->newChild("center_freq") = centerFreq.load();
 | 
					        *window_node->newChild("center_freq") = centerFreq.load();
 | 
				
			||||||
        *window_node->newChild("waterfall_lps") = waterfallLinesPerSec.load();
 | 
					        *window_node->newChild("waterfall_lps") = waterfallLinesPerSec.load();
 | 
				
			||||||
        *window_node->newChild("spectrum_avg") = spectrumAvgSpeed.load();
 | 
					        *window_node->newChild("spectrum_avg") = spectrumAvgSpeed.load();
 | 
				
			||||||
        *window_node->newChild("modemprops_collapsed") = modemPropsCollapsed.load();;
 | 
					        *window_node->newChild("modemprops_collapsed") = modemPropsCollapsed.load();
 | 
				
			||||||
        *window_node->newChild("db_offset") = dbOffset.load();
 | 
					        *window_node->newChild("db_offset") = dbOffset.load();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        *window_node->newChild("main_split") = mainSplit.load();
 | 
					        *window_node->newChild("main_split") = mainSplit.load();
 | 
				
			||||||
@ -620,12 +618,12 @@ bool AppConfig::save() {
 | 
				
			|||||||
        device_config_i->second->save(device_node);
 | 
					        device_config_i->second->save(device_node);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (manualDevices.size()) {
 | 
					    if (!manualDevices.empty()) {
 | 
				
			||||||
        DataNode *manual_node = cfg.rootNode()->newChild("manual_devices");
 | 
					        DataNode *manual_node = cfg.rootNode()->newChild("manual_devices");
 | 
				
			||||||
        for (std::vector<SDRManualDef>::const_iterator i = manualDevices.begin(); i != manualDevices.end(); i++) {
 | 
					        for (const auto & manualDevice : manualDevices) {
 | 
				
			||||||
            DataNode *rig_node = manual_node->newChild("device");
 | 
					            DataNode *rig_node = manual_node->newChild("device");
 | 
				
			||||||
            *rig_node->newChild("factory") = i->factory;
 | 
					            *rig_node->newChild("factory") = manualDevice.factory;
 | 
				
			||||||
            *rig_node->newChild("params") = i->params;
 | 
					            *rig_node->newChild("params") = manualDevice.params;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -708,12 +706,12 @@ bool AppConfig::load() {
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
        if (win_node->hasAnother("max")) {
 | 
					        if (win_node->hasAnother("max")) {
 | 
				
			||||||
            win_node->getNext("max")->element()->get(max);
 | 
					            win_node->getNext("max")->element()->get(max);
 | 
				
			||||||
            winMax.store(max?true:false);
 | 
					            winMax.store(max != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (win_node->hasAnother("tips")) {
 | 
					        if (win_node->hasAnother("tips")) {
 | 
				
			||||||
            win_node->getNext("tips")->element()->get(tips);
 | 
					            win_node->getNext("tips")->element()->get(tips);
 | 
				
			||||||
            showTips.store(tips?true:false);
 | 
					            showTips.store(tips != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // default:
 | 
					        // default:
 | 
				
			||||||
@ -730,31 +728,31 @@ bool AppConfig::load() {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
       
 | 
					       
 | 
				
			||||||
        if (win_node->hasAnother("theme")) {
 | 
					        if (win_node->hasAnother("theme")) {
 | 
				
			||||||
            int theme;
 | 
					            int theme = 0;
 | 
				
			||||||
            win_node->getNext("theme")->element()->get(theme);
 | 
					            win_node->getNext("theme")->element()->get(theme);
 | 
				
			||||||
            themeId.store(theme);
 | 
					            themeId.store(theme);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (win_node->hasAnother("font_scale")) {
 | 
					        if (win_node->hasAnother("font_scale")) {
 | 
				
			||||||
            int fscale;
 | 
					            int fscale = 0;
 | 
				
			||||||
            win_node->getNext("font_scale")->element()->get(fscale);
 | 
					            win_node->getNext("font_scale")->element()->get(fscale);
 | 
				
			||||||
            fontScale.store(fscale);
 | 
					            fontScale.store(fscale);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (win_node->hasAnother("snap")) {
 | 
					        if (win_node->hasAnother("snap")) {
 | 
				
			||||||
			long long snapVal;
 | 
								long long snapVal = 0;
 | 
				
			||||||
			win_node->getNext("snap")->element()->get(snapVal);
 | 
								win_node->getNext("snap")->element()->get(snapVal);
 | 
				
			||||||
			snap.store(snapVal);
 | 
								snap.store(snapVal);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (win_node->hasAnother("center_freq")) {
 | 
					        if (win_node->hasAnother("center_freq")) {
 | 
				
			||||||
            long long freqVal;
 | 
					            long long freqVal = 0;
 | 
				
			||||||
            win_node->getNext("center_freq")->element()->get(freqVal);
 | 
					            win_node->getNext("center_freq")->element()->get(freqVal);
 | 
				
			||||||
            centerFreq.store(freqVal);
 | 
					            centerFreq.store(freqVal);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (win_node->hasAnother("waterfall_lps")) {
 | 
					        if (win_node->hasAnother("waterfall_lps")) {
 | 
				
			||||||
            int lpsVal;
 | 
					            int lpsVal = 30;
 | 
				
			||||||
            win_node->getNext("waterfall_lps")->element()->get(lpsVal);
 | 
					            win_node->getNext("waterfall_lps")->element()->get(lpsVal);
 | 
				
			||||||
            waterfallLinesPerSec.store(lpsVal);
 | 
					            waterfallLinesPerSec.store(lpsVal);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -767,7 +765,7 @@ bool AppConfig::load() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (win_node->hasAnother("modemprops_collapsed")) {
 | 
					        if (win_node->hasAnother("modemprops_collapsed")) {
 | 
				
			||||||
            win_node->getNext("modemprops_collapsed")->element()->get(mpc);
 | 
					            win_node->getNext("modemprops_collapsed")->element()->get(mpc);
 | 
				
			||||||
            modemPropsCollapsed.store(mpc?true:false);
 | 
					            modemPropsCollapsed.store(mpc != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if (win_node->hasAnother("db_offset")) {
 | 
					        if (win_node->hasAnother("db_offset")) {
 | 
				
			||||||
@ -858,7 +856,7 @@ bool AppConfig::load() {
 | 
				
			|||||||
        if (rig_node->hasAnother("enabled")) {
 | 
					        if (rig_node->hasAnother("enabled")) {
 | 
				
			||||||
            int loadEnabled;
 | 
					            int loadEnabled;
 | 
				
			||||||
            rig_node->getNext("enabled")->element()->get(loadEnabled);
 | 
					            rig_node->getNext("enabled")->element()->get(loadEnabled);
 | 
				
			||||||
            rigEnabled.store(loadEnabled?true:false);
 | 
					            rigEnabled.store(loadEnabled != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (rig_node->hasAnother("model")) {
 | 
					        if (rig_node->hasAnother("model")) {
 | 
				
			||||||
            int loadModel;
 | 
					            int loadModel;
 | 
				
			||||||
@ -876,22 +874,22 @@ bool AppConfig::load() {
 | 
				
			|||||||
        if (rig_node->hasAnother("control")) {
 | 
					        if (rig_node->hasAnother("control")) {
 | 
				
			||||||
            int loadControl;
 | 
					            int loadControl;
 | 
				
			||||||
            rig_node->getNext("control")->element()->get(loadControl);
 | 
					            rig_node->getNext("control")->element()->get(loadControl);
 | 
				
			||||||
            rigControlMode.store(loadControl?true:false);
 | 
					            rigControlMode.store(loadControl != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (rig_node->hasAnother("follow")) {
 | 
					        if (rig_node->hasAnother("follow")) {
 | 
				
			||||||
            int loadFollow;
 | 
					            int loadFollow;
 | 
				
			||||||
            rig_node->getNext("follow")->element()->get(loadFollow);
 | 
					            rig_node->getNext("follow")->element()->get(loadFollow);
 | 
				
			||||||
            rigFollowMode.store(loadFollow?true:false);
 | 
					            rigFollowMode.store(loadFollow != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (rig_node->hasAnother("center_lock")) {
 | 
					        if (rig_node->hasAnother("center_lock")) {
 | 
				
			||||||
            int loadCenterLock;
 | 
					            int loadCenterLock;
 | 
				
			||||||
            rig_node->getNext("center_lock")->element()->get(loadCenterLock);
 | 
					            rig_node->getNext("center_lock")->element()->get(loadCenterLock);
 | 
				
			||||||
            rigCenterLock.store(loadCenterLock?true:false);
 | 
					            rigCenterLock.store(loadCenterLock != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (rig_node->hasAnother("follow_modem")) {
 | 
					        if (rig_node->hasAnother("follow_modem")) {
 | 
				
			||||||
            int loadFollow;
 | 
					            int loadFollow;
 | 
				
			||||||
            rig_node->getNext("follow_modem")->element()->get(loadFollow);
 | 
					            rig_node->getNext("follow_modem")->element()->get(loadFollow);
 | 
				
			||||||
            rigFollowModem.store(loadFollow?true:false);
 | 
					            rigFollowModem.store(loadFollow != 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -912,24 +910,24 @@ int AppConfig::getRigModel() {
 | 
				
			|||||||
    return rigModel.load();
 | 
					    return rigModel.load();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setRigModel(int rigModel) {
 | 
					void AppConfig::setRigModel(int rigModel_in) {
 | 
				
			||||||
    this->rigModel.store(rigModel);
 | 
					    rigModel.store(rigModel_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int AppConfig::getRigRate() {
 | 
					int AppConfig::getRigRate() {
 | 
				
			||||||
    return rigRate.load();
 | 
					    return rigRate.load();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setRigRate(int rigRate) {
 | 
					void AppConfig::setRigRate(int rigRate_in) {
 | 
				
			||||||
    this->rigRate.store(rigRate);
 | 
					    rigRate.store(rigRate_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::string AppConfig::getRigPort() {
 | 
					std::string AppConfig::getRigPort() {
 | 
				
			||||||
    return rigPort;
 | 
					    return rigPort;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setRigPort(std::string rigPort) {
 | 
					void AppConfig::setRigPort(std::string rigPort_in) {
 | 
				
			||||||
    this->rigPort = rigPort;
 | 
					    rigPort = rigPort_in;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppConfig::setRigControlMode(bool cMode) {
 | 
					void AppConfig::setRigControlMode(bool cMode) {
 | 
				
			||||||
 | 
				
			|||||||
@ -20,43 +20,43 @@ typedef std::map<std::string, float> ConfigGains;
 | 
				
			|||||||
class DeviceConfig {
 | 
					class DeviceConfig {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    DeviceConfig();
 | 
					    DeviceConfig();
 | 
				
			||||||
    DeviceConfig(std::string deviceId);
 | 
					    explicit DeviceConfig(std::string deviceId_in);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setPPM(int ppm);
 | 
					    void setPPM(int ppm_in);
 | 
				
			||||||
    int getPPM();
 | 
					    int getPPM();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setOffset(long long offset);
 | 
					    void setOffset(long long offset_in);
 | 
				
			||||||
    long long getOffset();
 | 
					    long long getOffset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setSampleRate(long srate);
 | 
					    void setSampleRate(long sampleRate_in);
 | 
				
			||||||
    long getSampleRate();
 | 
					    long getSampleRate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setAntennaName(const std::string& name);
 | 
					    void setAntennaName(const std::string& name);
 | 
				
			||||||
    const std::string& getAntennaName();
 | 
					    const std::string& getAntennaName();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setAGCMode(bool agcMode);
 | 
					    void setAGCMode(bool agcMode_in);
 | 
				
			||||||
    bool getAGCMode();
 | 
					    bool getAGCMode();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setDeviceId(std::string deviceId);
 | 
					    void setDeviceId(std::string deviceId_in);
 | 
				
			||||||
    std::string getDeviceId();
 | 
					    std::string getDeviceId();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setDeviceName(std::string deviceName);
 | 
					    void setDeviceName(std::string deviceName_in);
 | 
				
			||||||
    std::string getDeviceName();
 | 
					    std::string getDeviceName();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setStreamOpts(ConfigSettings opts);
 | 
					    void setStreamOpts(ConfigSettings opts);
 | 
				
			||||||
    ConfigSettings getStreamOpts();
 | 
					    ConfigSettings getStreamOpts();
 | 
				
			||||||
    void setStreamOpt(std::string key, std::string value);
 | 
					    void setStreamOpt(const std::string& key, std::string value);
 | 
				
			||||||
    std::string getStreamOpt(std::string key, std::string defaultValue);
 | 
					    std::string getStreamOpt(const std::string& key, std::string defaultValue);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setSettings(ConfigSettings settings);
 | 
					    void setSettings(ConfigSettings settings_in);
 | 
				
			||||||
    ConfigSettings getSettings();
 | 
					    ConfigSettings getSettings();
 | 
				
			||||||
    void setSetting(std::string key, std::string value);
 | 
					    void setSetting(const std::string& key, std::string value);
 | 
				
			||||||
    std::string getSetting(std::string key, std::string defaultValue);
 | 
					    std::string getSetting(const std::string& key, std::string defaultValue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setGains(ConfigGains gains);
 | 
					    void setGains(ConfigGains gains_in);
 | 
				
			||||||
    ConfigGains getGains();
 | 
					    ConfigGains getGains();
 | 
				
			||||||
    void setGain(std::string key, float value);
 | 
					    void setGain(const std::string& key, float value);
 | 
				
			||||||
    float getGain(std::string key, float defaultValue);
 | 
					    float getGain(const std::string& key, float defaultValue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setRigIF(int rigType, long long freq);
 | 
					    void setRigIF(int rigType, long long freq);
 | 
				
			||||||
    long long getRigIF(int rigType);
 | 
					    long long getRigIF(int rigType);
 | 
				
			||||||
@ -70,10 +70,10 @@ private:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    std::mutex busy_lock;
 | 
					    std::mutex busy_lock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::atomic_int ppm;
 | 
					    std::atomic_int ppm{};
 | 
				
			||||||
    std::atomic_llong offset;
 | 
					    std::atomic_llong offset{};
 | 
				
			||||||
    std::atomic_bool agcMode;
 | 
					    std::atomic_bool agcMode{};
 | 
				
			||||||
    std::atomic_long sampleRate;
 | 
					    std::atomic_long sampleRate{};
 | 
				
			||||||
    std::string antennaName;
 | 
					    std::string antennaName;
 | 
				
			||||||
    ConfigSettings streamOpts;
 | 
					    ConfigSettings streamOpts;
 | 
				
			||||||
    ConfigGains gains;
 | 
					    ConfigGains gains;
 | 
				
			||||||
@ -93,7 +93,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    AppConfig();
 | 
					    AppConfig();
 | 
				
			||||||
    std::string getConfigDir();
 | 
					    std::string getConfigDir();
 | 
				
			||||||
    DeviceConfig *getDevice(std::string deviceId);
 | 
					    DeviceConfig *getDevice(const std::string& deviceId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setWindow(wxPoint winXY, wxSize winWH);
 | 
					    void setWindow(wxPoint winXY, wxSize winWH);
 | 
				
			||||||
    wxRect *getWindow();
 | 
					    wxRect *getWindow();
 | 
				
			||||||
@ -110,10 +110,10 @@ public:
 | 
				
			|||||||
    void setPerfMode(PerfModeEnum mode);
 | 
					    void setPerfMode(PerfModeEnum mode);
 | 
				
			||||||
    PerfModeEnum getPerfMode();
 | 
					    PerfModeEnum getPerfMode();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setTheme(int themeId);
 | 
					    void setTheme(int themeId_in);
 | 
				
			||||||
    int getTheme();
 | 
					    int getTheme();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setFontScale(int scaleValue);
 | 
					    void setFontScale(int fontScale_in);
 | 
				
			||||||
    int getFontScale();
 | 
					    int getFontScale();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setSnap(long long snapVal);
 | 
					    void setSnap(long long snapVal);
 | 
				
			||||||
@ -152,20 +152,20 @@ public:
 | 
				
			|||||||
	bool verifyRecordingPath();
 | 
						bool verifyRecordingPath();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void setRecordingSquelchOption(int enumChoice);
 | 
						void setRecordingSquelchOption(int enumChoice);
 | 
				
			||||||
	int getRecordingSquelchOption();
 | 
						int getRecordingSquelchOption() const;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	void setRecordingFileTimeLimit(int nbSeconds);
 | 
						void setRecordingFileTimeLimit(int nbSeconds);
 | 
				
			||||||
	int getRecordingFileTimeLimit();
 | 
						int getRecordingFileTimeLimit() const;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
#if USE_HAMLIB
 | 
					#if USE_HAMLIB
 | 
				
			||||||
    int getRigModel();
 | 
					    int getRigModel();
 | 
				
			||||||
    void setRigModel(int rigModel);
 | 
					    void setRigModel(int rigModel_in);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int getRigRate();
 | 
					    int getRigRate();
 | 
				
			||||||
    void setRigRate(int rigRate);
 | 
					    void setRigRate(int rigRate_in);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    std::string getRigPort();
 | 
					    std::string getRigPort();
 | 
				
			||||||
    void setRigPort(std::string rigPort);
 | 
					    void setRigPort(std::string rigPort_in);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setRigControlMode(bool cMode);
 | 
					    void setRigControlMode(bool cMode);
 | 
				
			||||||
    bool getRigControlMode();
 | 
					    bool getRigControlMode();
 | 
				
			||||||
@ -183,7 +183,7 @@ public:
 | 
				
			|||||||
    bool getRigEnabled();
 | 
					    bool getRigEnabled();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setConfigName(std::string configName);
 | 
					    void setConfigName(std::string configName_in);
 | 
				
			||||||
    std::string getConfigFileName(bool ignoreName=false);
 | 
					    std::string getConfigFileName(bool ignoreName=false);
 | 
				
			||||||
    bool save();
 | 
					    bool save();
 | 
				
			||||||
    bool load();
 | 
					    bool load();
 | 
				
			||||||
@ -192,26 +192,26 @@ public:
 | 
				
			|||||||
private:
 | 
					private:
 | 
				
			||||||
    std::string configName;
 | 
					    std::string configName;
 | 
				
			||||||
    std::map<std::string, DeviceConfig *> deviceConfig;
 | 
					    std::map<std::string, DeviceConfig *> deviceConfig;
 | 
				
			||||||
    std::atomic_int winX,winY,winW,winH;
 | 
					    std::atomic_int winX{},winY{},winW{},winH{};
 | 
				
			||||||
    std::atomic_bool winMax, showTips, modemPropsCollapsed;
 | 
					    std::atomic_bool winMax{}, showTips{}, modemPropsCollapsed{};
 | 
				
			||||||
    std::atomic_int themeId;
 | 
					    std::atomic_int themeId{};
 | 
				
			||||||
    std::atomic_int fontScale;
 | 
					    std::atomic_int fontScale{};
 | 
				
			||||||
    std::atomic_llong snap;
 | 
					    std::atomic_llong snap{};
 | 
				
			||||||
    std::atomic_llong centerFreq;
 | 
					    std::atomic_llong centerFreq{};
 | 
				
			||||||
    std::atomic_int waterfallLinesPerSec;
 | 
					    std::atomic_int waterfallLinesPerSec{};
 | 
				
			||||||
    std::atomic<float> spectrumAvgSpeed, mainSplit, visSplit, bookmarkSplit;
 | 
					    std::atomic<float> spectrumAvgSpeed{}, mainSplit{}, visSplit{}, bookmarkSplit{};
 | 
				
			||||||
    std::atomic_int dbOffset;
 | 
					    std::atomic_int dbOffset{};
 | 
				
			||||||
    std::vector<SDRManualDef> manualDevices;
 | 
					    std::vector<SDRManualDef> manualDevices;
 | 
				
			||||||
    std::atomic_bool bookmarksVisible;
 | 
					    std::atomic_bool bookmarksVisible{};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::atomic<PerfModeEnum> perfMode;
 | 
					    std::atomic<PerfModeEnum> perfMode{};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::string recordingPath = "";
 | 
					    std::string recordingPath;
 | 
				
			||||||
	int recordingSquelchOption = 0;
 | 
						int recordingSquelchOption = 0;
 | 
				
			||||||
	int recordingFileTimeLimitSeconds = 0;
 | 
						int recordingFileTimeLimitSeconds = 0;
 | 
				
			||||||
#if USE_HAMLIB
 | 
					#if USE_HAMLIB
 | 
				
			||||||
    std::atomic_int rigModel, rigRate;
 | 
					    std::atomic_int rigModel{}, rigRate{};
 | 
				
			||||||
    std::string rigPort;
 | 
					    std::string rigPort;
 | 
				
			||||||
    std::atomic_bool rigEnabled, rigFollowMode, rigControlMode, rigCenterLock, rigFollowModem;
 | 
					    std::atomic_bool rigEnabled{}, rigFollowMode{}, rigControlMode{}, rigCenterLock{}, rigFollowModem{};
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										207
									
								
								src/AppFrame.cpp
									
									
									
									
									
								
							
							
						
						
									
										207
									
								
								src/AppFrame.cpp
									
									
									
									
									
								
							@ -32,7 +32,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <wx/panel.h>
 | 
					#include <wx/panel.h>
 | 
				
			||||||
#include <wx/numformatter.h>
 | 
					#include <wx/numformatter.h>
 | 
				
			||||||
#include <stddef.h>
 | 
					#include <cstddef>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__linux__) || defined(__FreeBSD__)
 | 
					#if defined(__linux__) || defined(__FreeBSD__)
 | 
				
			||||||
#include "CubicSDR.xpm"
 | 
					#include "CubicSDR.xpm"
 | 
				
			||||||
@ -61,7 +61,7 @@ public:
 | 
				
			|||||||
        m_questionText->SetLabelText(wxT("Resetting bookmarks will erase all current bookmarks; are you sure?"));
 | 
					        m_questionText->SetLabelText(wxT("Resetting bookmarks will erase all current bookmarks; are you sure?"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void doClickOK() {
 | 
					    void doClickOK() override {
 | 
				
			||||||
        wxGetApp().getBookmarkMgr().resetBookmarks();
 | 
					        wxGetApp().getBookmarkMgr().resetBookmarks();
 | 
				
			||||||
        wxGetApp().getBookmarkMgr().updateBookmarks();
 | 
					        wxGetApp().getBookmarkMgr().updateBookmarks();
 | 
				
			||||||
        wxGetApp().getBookmarkMgr().updateActiveList();
 | 
					        wxGetApp().getBookmarkMgr().updateActiveList();
 | 
				
			||||||
@ -73,7 +73,7 @@ public:
 | 
				
			|||||||
#define APPFRAME_MODEMPROPS_MAXSIZE 240
 | 
					#define APPFRAME_MODEMPROPS_MAXSIZE 240
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AppFrame::AppFrame() :
 | 
					AppFrame::AppFrame() :
 | 
				
			||||||
        wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(nullptr) {
 | 
					        wxFrame(nullptr, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(nullptr) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    initIcon();
 | 
					    initIcon();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -81,8 +81,8 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    modemPropertiesUpdated.store(false);
 | 
					    modemPropertiesUpdated.store(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    demodTray = new wxBoxSizer(wxHORIZONTAL);
 | 
					    demodTray = new wxBoxSizer(wxHORIZONTAL);
 | 
				
			||||||
    wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
 | 
					    auto *demodScopeTray = new wxBoxSizer(wxVERTICAL);
 | 
				
			||||||
    wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
 | 
					    auto *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // OpenGL settings:
 | 
					    // OpenGL settings:
 | 
				
			||||||
    //deprecated format: std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
 | 
					    //deprecated format: std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
 | 
				
			||||||
@ -93,7 +93,7 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    mainSplitter->SetSashGravity(10.0f / 37.0f);
 | 
					    mainSplitter->SetSashGravity(10.0f / 37.0f);
 | 
				
			||||||
    mainSplitter->SetMinimumPaneSize(1);
 | 
					    mainSplitter->SetMinimumPaneSize(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxPanel *demodPanel = new wxPanel(mainSplitter, wxID_ANY);
 | 
					    auto *demodPanel = new wxPanel(mainSplitter, wxID_ANY);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CUBICSDR_HEADER_IMAGE
 | 
					#ifdef CUBICSDR_HEADER_IMAGE
 | 
				
			||||||
    wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
 | 
					    wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
 | 
				
			||||||
@ -143,7 +143,7 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
      
 | 
					      
 | 
				
			||||||
#if CUBICSDR_ENABLE_VIEW_DEMOD
 | 
					#if CUBICSDR_ENABLE_VIEW_DEMOD
 | 
				
			||||||
    // Demodulator View
 | 
					    // Demodulator View
 | 
				
			||||||
    wxBoxSizer *demodVisuals = new wxBoxSizer(wxVERTICAL);
 | 
					    auto *demodVisuals = new wxBoxSizer(wxVERTICAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Demod Spectrum
 | 
					    // Demod Spectrum
 | 
				
			||||||
    demodSpectrumCanvas = makeDemodSpectrumCanvas(demodPanel, attribList);
 | 
					    demodSpectrumCanvas = makeDemodSpectrumCanvas(demodPanel, attribList);
 | 
				
			||||||
@ -203,7 +203,7 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    demodTray->Add(demodScopeTray, 30, wxEXPAND | wxALL, 0);
 | 
					    demodTray->Add(demodScopeTray, 30, wxEXPAND | wxALL, 0);
 | 
				
			||||||
    demodTray->AddSpacer(1);
 | 
					    demodTray->AddSpacer(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxBoxSizer *demodGainTray = new wxBoxSizer(wxVERTICAL);
 | 
					    auto *demodGainTray = new wxBoxSizer(wxVERTICAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Demod Gain Meter
 | 
					    // Demod Gain Meter
 | 
				
			||||||
    demodGainMeter = makeModemGainMeter(demodPanel, attribList);
 | 
					    demodGainMeter = makeModemGainMeter(demodPanel, attribList);
 | 
				
			||||||
@ -231,8 +231,8 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    mainVisSplitter->SetMinimumPaneSize(1);
 | 
					    mainVisSplitter->SetMinimumPaneSize(1);
 | 
				
			||||||
    mainVisSplitter->SetSashGravity(6.0f / 25.0f);
 | 
					    mainVisSplitter->SetSashGravity(6.0f / 25.0f);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
    wxPanel *spectrumPanel = new wxPanel(mainVisSplitter, wxID_ANY);
 | 
					    auto *spectrumPanel = new wxPanel(mainVisSplitter, wxID_ANY);
 | 
				
			||||||
    wxBoxSizer *spectrumSizer = new wxBoxSizer(wxHORIZONTAL);
 | 
					    auto *spectrumSizer = new wxBoxSizer(wxHORIZONTAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Spectrum Canvas
 | 
					    // Spectrum Canvas
 | 
				
			||||||
    spectrumCanvas = makeSpectrumCanvas(spectrumPanel, attribList);
 | 
					    spectrumCanvas = makeSpectrumCanvas(spectrumPanel, attribList);
 | 
				
			||||||
@ -243,7 +243,7 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    spectrumSizer->Add(spectrumCanvas, 63, wxEXPAND | wxALL, 0);
 | 
					    spectrumSizer->Add(spectrumCanvas, 63, wxEXPAND | wxALL, 0);
 | 
				
			||||||
    spectrumSizer->AddSpacer(1);
 | 
					    spectrumSizer->AddSpacer(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxBoxSizer *spectrumCtlTray = new wxBoxSizer(wxVERTICAL);
 | 
					    auto *spectrumCtlTray = new wxBoxSizer(wxVERTICAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Peak Hold
 | 
					    // Peak Hold
 | 
				
			||||||
    peakHoldButton = makePeakHoldButton(spectrumPanel, attribList);
 | 
					    peakHoldButton = makePeakHoldButton(spectrumPanel, attribList);
 | 
				
			||||||
@ -256,8 +256,8 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    spectrumSizer->Add(spectrumCtlTray, 1, wxEXPAND | wxALL, 0);
 | 
					    spectrumSizer->Add(spectrumCtlTray, 1, wxEXPAND | wxALL, 0);
 | 
				
			||||||
    spectrumPanel->SetSizer(spectrumSizer);
 | 
					    spectrumPanel->SetSizer(spectrumSizer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxPanel *waterfallPanel = new wxPanel(mainVisSplitter, wxID_ANY);
 | 
					    auto *waterfallPanel = new wxPanel(mainVisSplitter, wxID_ANY);
 | 
				
			||||||
    wxBoxSizer *waterfallSizer = new wxBoxSizer(wxHORIZONTAL);
 | 
					    auto *waterfallSizer = new wxBoxSizer(wxHORIZONTAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Waterfall
 | 
					    // Waterfall
 | 
				
			||||||
    waterfallCanvas = makeWaterfall(waterfallPanel, attribList);
 | 
					    waterfallCanvas = makeWaterfall(waterfallPanel, attribList);
 | 
				
			||||||
@ -291,7 +291,7 @@ AppFrame::AppFrame() :
 | 
				
			|||||||
    spectrumCanvas->attachWaterfallCanvas(waterfallCanvas);
 | 
					    spectrumCanvas->attachWaterfallCanvas(waterfallCanvas);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Primary sizer for the window
 | 
					    // Primary sizer for the window
 | 
				
			||||||
    wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
 | 
					    auto *vbox = new wxBoxSizer(wxVERTICAL);
 | 
				
			||||||
    vbox->Add(mainSplitter, 1, wxEXPAND | wxALL, 0);
 | 
					    vbox->Add(mainSplitter, 1, wxEXPAND | wxALL, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* * /
 | 
					/* * /
 | 
				
			||||||
@ -451,7 +451,7 @@ void AppFrame::initConfigurationSettings() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModemProperties *AppFrame::makeModemProperties(wxPanel *parent) {
 | 
					ModemProperties *AppFrame::makeModemProperties(wxPanel *parent) {
 | 
				
			||||||
    ModemProperties *pProperties = new ModemProperties(parent, wxID_ANY);
 | 
					    auto *pProperties = new ModemProperties(parent, wxID_ANY);
 | 
				
			||||||
    pProperties->SetMinSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE, -1));
 | 
					    pProperties->SetMinSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE, -1));
 | 
				
			||||||
    pProperties->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE, -1));
 | 
					    pProperties->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE, -1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -462,7 +462,7 @@ ModemProperties *AppFrame::makeModemProperties(wxPanel *parent) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModeSelectorCanvas *AppFrame::makeModemAdvSelectorPanel(wxPanel *parent, const wxGLAttributes &attribList) {
 | 
					ModeSelectorCanvas *AppFrame::makeModemAdvSelectorPanel(wxPanel *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    ModeSelectorCanvas *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->addChoice("ASK");
 | 
					    pCanvas->addChoice("ASK");
 | 
				
			||||||
    pCanvas->addChoice("APSK");
 | 
					    pCanvas->addChoice("APSK");
 | 
				
			||||||
    pCanvas->addChoice("BPSK");
 | 
					    pCanvas->addChoice("BPSK");
 | 
				
			||||||
@ -578,7 +578,7 @@ wxMenu *AppFrame::makeRigMenu() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ScopeCanvas *AppFrame::makeScopeCanvas(wxPanel *parent, const wxGLAttributes &attribList) {
 | 
					ScopeCanvas *AppFrame::makeScopeCanvas(wxPanel *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    ScopeCanvas *pCanvas = new ScopeCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ScopeCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setHelpTip("Audio Visuals, drag left/right to toggle Scope or Spectrum, 'B' to toggle decibels display.");
 | 
					    pCanvas->setHelpTip("Audio Visuals, drag left/right to toggle Scope or Spectrum, 'B' to toggle decibels display.");
 | 
				
			||||||
    pCanvas->SetMinSize(wxSize(128, -1));
 | 
					    pCanvas->SetMinSize(wxSize(128, -1));
 | 
				
			||||||
    return pCanvas;
 | 
					    return pCanvas;
 | 
				
			||||||
@ -587,8 +587,8 @@ ScopeCanvas *AppFrame::makeScopeCanvas(wxPanel *parent, const wxGLAttributes &at
 | 
				
			|||||||
wxMenu *AppFrame::makeDisplayMenu() {
 | 
					wxMenu *AppFrame::makeDisplayMenu() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //Add Display menu
 | 
					    //Add Display menu
 | 
				
			||||||
    wxMenu *dispMenu = new wxMenu;
 | 
					    auto *dispMenu = new wxMenu;
 | 
				
			||||||
    wxMenu *fontMenu = new wxMenu;
 | 
					    auto *fontMenu = new wxMenu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int fontScale = wxGetApp().getConfig()->getFontScale();
 | 
					    int fontScale = wxGetApp().getConfig()->getFontScale();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -598,7 +598,7 @@ wxMenu *AppFrame::makeDisplayMenu() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    dispMenu->AppendSubMenu(fontMenu, "&Text Size");
 | 
					    dispMenu->AppendSubMenu(fontMenu, "&Text Size");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxMenu *themeMenu = new wxMenu;
 | 
					    auto *themeMenu = new wxMenu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int themeId = wxGetApp().getConfig()->getTheme();
 | 
					    int themeId = wxGetApp().getConfig()->getTheme();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -621,48 +621,47 @@ wxMenu *AppFrame::makeDisplayMenu() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
wxMenu *AppFrame::makeAudioSampleRateMenu() {
 | 
					wxMenu *AppFrame::makeAudioSampleRateMenu() {
 | 
				
			||||||
    // Audio Sample Rates
 | 
					    // Audio Sample Rates
 | 
				
			||||||
    wxMenu *pMenu = new wxMenu;
 | 
					    auto *pMenu = new wxMenu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto outputDevices = wxGetApp().getDemodMgr().getOutputDevices();
 | 
					    auto outputDevices = wxGetApp().getDemodMgr().getOutputDevices();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define NUM_RATES_DEFAULT 4
 | 
					#define NUM_RATES_DEFAULT 4
 | 
				
			||||||
    unsigned int desired_rates[NUM_RATES_DEFAULT] = { 48000, 44100, 96000, 192000 };
 | 
					    unsigned int desired_rates[NUM_RATES_DEFAULT] = { 48000, 44100, 96000, 192000 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
 | 
					    for (auto & outputDevice : outputDevices) {
 | 
				
			||||||
        unsigned int desired_rate = 0;
 | 
					        unsigned int desired_rate = 0;
 | 
				
			||||||
        unsigned int desired_rank = NUM_RATES_DEFAULT + 1;
 | 
					        unsigned int desired_rank = NUM_RATES_DEFAULT + 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (auto srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
 | 
					        for (unsigned int & sampleRate : outputDevice.second.sampleRates) {
 | 
				
			||||||
             srate++) {
 | 
					 | 
				
			||||||
            for (unsigned int i = 0; i < NUM_RATES_DEFAULT; i++) {
 | 
					            for (unsigned int i = 0; i < NUM_RATES_DEFAULT; i++) {
 | 
				
			||||||
                if (desired_rates[i] == (*srate)) {
 | 
					                if (desired_rates[i] == sampleRate) {
 | 
				
			||||||
                    if (desired_rank > i) {
 | 
					                    if (desired_rank > i) {
 | 
				
			||||||
                        desired_rank = i;
 | 
					                        desired_rank = i;
 | 
				
			||||||
                        desired_rate = (*srate);
 | 
					                        desired_rate = sampleRate;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (desired_rank > NUM_RATES_DEFAULT) {
 | 
					        if (desired_rank > NUM_RATES_DEFAULT) {
 | 
				
			||||||
            desired_rate = mdevices_i->second.sampleRates.back();
 | 
					            desired_rate = outputDevice.second.sampleRates.back();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        AudioThread::deviceSampleRate[mdevices_i->first] = desired_rate;
 | 
					        AudioThread::deviceSampleRate[outputDevice.first] = desired_rate;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
 | 
					    for (auto & outputDevice : outputDevices) {
 | 
				
			||||||
        int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * mdevices_i->first;
 | 
					        int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * outputDevice.first;
 | 
				
			||||||
        wxMenu *subMenu = new wxMenu;
 | 
					        auto *subMenu = new wxMenu;
 | 
				
			||||||
        pMenu->AppendSubMenu(subMenu, mdevices_i->second.name, wxT("Description?"));
 | 
					        pMenu->AppendSubMenu(subMenu, outputDevice.second.name, wxT("Description?"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int j = 0;
 | 
					        int j = 0;
 | 
				
			||||||
        for (auto srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
 | 
					        for (auto srate = outputDevice.second.sampleRates.begin(); srate != outputDevice.second.sampleRates.end();
 | 
				
			||||||
             srate++) {
 | 
					             srate++) {
 | 
				
			||||||
            stringstream srateName;
 | 
					            stringstream srateName;
 | 
				
			||||||
            srateName << ((float) (*srate) / 1000.0f) << "kHz";
 | 
					            srateName << ((float) (*srate) / 1000.0f) << "kHz";
 | 
				
			||||||
            wxMenuItem *itm = subMenu->AppendRadioItem(menu_id + j, srateName.str(), wxT("Description?"));
 | 
					            wxMenuItem *itm = subMenu->AppendRadioItem(menu_id + j, srateName.str(), wxT("Description?"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ((int)(*srate) == AudioThread::deviceSampleRate[mdevices_i->first]) {
 | 
					            if ((int)(*srate) == AudioThread::deviceSampleRate[outputDevice.first]) {
 | 
				
			||||||
                itm->Check(true);
 | 
					                itm->Check(true);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            audioSampleRateMenuItems[menu_id + j] = itm;
 | 
					            audioSampleRateMenuItems[menu_id + j] = itm;
 | 
				
			||||||
@ -674,7 +673,7 @@ wxMenu *AppFrame::makeAudioSampleRateMenu() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MeterCanvas *AppFrame::makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					MeterCanvas *AppFrame::makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    MeterCanvas *pCanvas = new MeterCanvas(parent, attribList);
 | 
					    auto *pCanvas = new MeterCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setHelpTip("Waterfall speed, click or drag to adjust (max 1024 lines per second)");
 | 
					    pCanvas->setHelpTip("Waterfall speed, click or drag to adjust (max 1024 lines per second)");
 | 
				
			||||||
    pCanvas->setMax(sqrt(1024));
 | 
					    pCanvas->setMax(sqrt(1024));
 | 
				
			||||||
    pCanvas->setLevel(sqrt(DEFAULT_WATERFALL_LPS));
 | 
					    pCanvas->setLevel(sqrt(DEFAULT_WATERFALL_LPS));
 | 
				
			||||||
@ -684,13 +683,13 @@ MeterCanvas *AppFrame::makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttri
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WaterfallCanvas *AppFrame::makeWaterfall(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					WaterfallCanvas *AppFrame::makeWaterfall(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    WaterfallCanvas *pCanvas = new WaterfallCanvas(parent, attribList);
 | 
					    auto *pCanvas = new WaterfallCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setup(DEFAULT_FFT_SIZE, DEFAULT_MAIN_WATERFALL_LINES_NB);
 | 
					    pCanvas->setup(DEFAULT_FFT_SIZE, DEFAULT_MAIN_WATERFALL_LINES_NB);
 | 
				
			||||||
    return pCanvas;
 | 
					    return pCanvas;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MeterCanvas * AppFrame::makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					MeterCanvas * AppFrame::makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    MeterCanvas *pCanvas = new MeterCanvas(parent, attribList);
 | 
					    auto *pCanvas = new MeterCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setHelpTip("Spectrum averaging speed, click or drag to adjust.");
 | 
					    pCanvas->setHelpTip("Spectrum averaging speed, click or drag to adjust.");
 | 
				
			||||||
    pCanvas->setMax(1.0);
 | 
					    pCanvas->setMax(1.0);
 | 
				
			||||||
    pCanvas->setLevel(0.65f);
 | 
					    pCanvas->setLevel(0.65f);
 | 
				
			||||||
@ -700,7 +699,7 @@ MeterCanvas * AppFrame::makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttribu
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SpectrumCanvas *AppFrame::makeSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					SpectrumCanvas *AppFrame::makeSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    SpectrumCanvas *pCanvas = new SpectrumCanvas(parent, attribList);
 | 
					    auto *pCanvas = new SpectrumCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setShowDb(true);
 | 
					    pCanvas->setShowDb(true);
 | 
				
			||||||
    pCanvas->setUseDBOfs(true);
 | 
					    pCanvas->setUseDBOfs(true);
 | 
				
			||||||
    pCanvas->setScaleFactorEnabled(true);
 | 
					    pCanvas->setScaleFactorEnabled(true);
 | 
				
			||||||
@ -708,7 +707,7 @@ SpectrumCanvas *AppFrame::makeSpectrumCanvas(wxWindow *parent, const wxGLAttribu
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModeSelectorCanvas *AppFrame::makePeakHoldButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					ModeSelectorCanvas *AppFrame::makePeakHoldButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    ModeSelectorCanvas *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->addChoice(1, "P");
 | 
					    pCanvas->addChoice(1, "P");
 | 
				
			||||||
    pCanvas->setPadding(-1, -1);
 | 
					    pCanvas->setPadding(-1, -1);
 | 
				
			||||||
    pCanvas->setHighlightColor(RGBA4f(0.2f, 0.8f, 0.2f));
 | 
					    pCanvas->setHighlightColor(RGBA4f(0.2f, 0.8f, 0.2f));
 | 
				
			||||||
@ -720,7 +719,7 @@ ModeSelectorCanvas *AppFrame::makePeakHoldButton(wxWindow *parent, const wxGLAtt
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModeSelectorCanvas *AppFrame::makeModemMuteButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					ModeSelectorCanvas *AppFrame::makeModemMuteButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    ModeSelectorCanvas *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->addChoice(1, "M");
 | 
					    pCanvas->addChoice(1, "M");
 | 
				
			||||||
    pCanvas->setPadding(-1, -1);
 | 
					    pCanvas->setPadding(-1, -1);
 | 
				
			||||||
    pCanvas->setHighlightColor(RGBA4f(0.8f, 0.2f, 0.2f));
 | 
					    pCanvas->setHighlightColor(RGBA4f(0.8f, 0.2f, 0.2f));
 | 
				
			||||||
@ -732,7 +731,7 @@ ModeSelectorCanvas *AppFrame::makeModemMuteButton(wxWindow *parent, const wxGLAt
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModeSelectorCanvas *AppFrame::makeSoloModeButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					ModeSelectorCanvas *AppFrame::makeSoloModeButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    ModeSelectorCanvas *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->addChoice(1, "S");
 | 
					    pCanvas->addChoice(1, "S");
 | 
				
			||||||
    pCanvas->setPadding(-1, -1);
 | 
					    pCanvas->setPadding(-1, -1);
 | 
				
			||||||
    pCanvas->setHighlightColor(RGBA4f(0.8f, 0.8f, 0.2f));
 | 
					    pCanvas->setHighlightColor(RGBA4f(0.8f, 0.8f, 0.2f));
 | 
				
			||||||
@ -744,7 +743,7 @@ ModeSelectorCanvas *AppFrame::makeSoloModeButton(wxWindow *parent, const wxGLAtt
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MeterCanvas *AppFrame::makeModemGainMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					MeterCanvas *AppFrame::makeModemGainMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    MeterCanvas *pCanvas = new MeterCanvas(parent, attribList);
 | 
					    auto *pCanvas = new MeterCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setMax(2.0);
 | 
					    pCanvas->setMax(2.0);
 | 
				
			||||||
    pCanvas->setHelpTip("Current Demodulator Gain Level.  Click / Drag to set Gain level.");
 | 
					    pCanvas->setHelpTip("Current Demodulator Gain Level.  Click / Drag to set Gain level.");
 | 
				
			||||||
    pCanvas->setShowUserInput(false);
 | 
					    pCanvas->setShowUserInput(false);
 | 
				
			||||||
@ -753,13 +752,13 @@ MeterCanvas *AppFrame::makeModemGainMeter(wxWindow *parent, const wxGLAttributes
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TuningCanvas *AppFrame::makeModemTuner(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					TuningCanvas *AppFrame::makeModemTuner(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    TuningCanvas *pCanvas = new TuningCanvas(parent, attribList);
 | 
					    auto *pCanvas = new TuningCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->SetMinClientSize(wxSize(200, 28));
 | 
					    pCanvas->SetMinClientSize(wxSize(200, 28));
 | 
				
			||||||
    return pCanvas;
 | 
					    return pCanvas;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModeSelectorCanvas * AppFrame::makeDeltaLockButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					ModeSelectorCanvas * AppFrame::makeDeltaLockButton(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    ModeSelectorCanvas *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->addChoice(1, "V");
 | 
					    pCanvas->addChoice(1, "V");
 | 
				
			||||||
    pCanvas->setPadding(-1, -1);
 | 
					    pCanvas->setPadding(-1, -1);
 | 
				
			||||||
    pCanvas->setHighlightColor(RGBA4f(0.8f, 0.8f, 0.2f));
 | 
					    pCanvas->setHighlightColor(RGBA4f(0.8f, 0.8f, 0.2f));
 | 
				
			||||||
@ -771,7 +770,7 @@ ModeSelectorCanvas * AppFrame::makeDeltaLockButton(wxWindow *parent, const wxGLA
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MeterCanvas *AppFrame::makeSignalMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					MeterCanvas *AppFrame::makeSignalMeter(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    MeterCanvas *pCanvas = new MeterCanvas(parent, attribList);
 | 
					    auto *pCanvas = new MeterCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setMax(DEMOD_SIGNAL_MAX);
 | 
					    pCanvas->setMax(DEMOD_SIGNAL_MAX);
 | 
				
			||||||
    pCanvas->setMin(DEMOD_SIGNAL_MIN);
 | 
					    pCanvas->setMin(DEMOD_SIGNAL_MIN);
 | 
				
			||||||
    pCanvas->setLevel(DEMOD_SIGNAL_MIN);
 | 
					    pCanvas->setLevel(DEMOD_SIGNAL_MIN);
 | 
				
			||||||
@ -782,13 +781,13 @@ MeterCanvas *AppFrame::makeSignalMeter(wxWindow *parent, const wxGLAttributes &a
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SpectrumCanvas *AppFrame::makeDemodSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					SpectrumCanvas *AppFrame::makeDemodSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    SpectrumCanvas *pCanvas = new SpectrumCanvas(parent, attribList);
 | 
					    auto *pCanvas = new SpectrumCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
 | 
					    pCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
 | 
				
			||||||
    return pCanvas;
 | 
					    return pCanvas;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WaterfallCanvas *AppFrame::makeWaterfallCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
					WaterfallCanvas *AppFrame::makeWaterfallCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
 | 
				
			||||||
    WaterfallCanvas *pCanvas = new WaterfallCanvas(parent, attribList);
 | 
					    auto *pCanvas = new WaterfallCanvas(parent, attribList);
 | 
				
			||||||
    pCanvas->setup(DEFAULT_DMOD_FFT_SIZE, DEFAULT_DEMOD_WATERFALL_LINES_NB);
 | 
					    pCanvas->setup(DEFAULT_DMOD_FFT_SIZE, DEFAULT_DEMOD_WATERFALL_LINES_NB);
 | 
				
			||||||
    pCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
 | 
					    pCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
 | 
				
			||||||
    pCanvas->setMinBandwidth(8000);
 | 
					    pCanvas->setMinBandwidth(8000);
 | 
				
			||||||
@ -811,9 +810,9 @@ ModeSelectorCanvas *AppFrame::makeModemSelectorPanel(wxWindow *parent, const wxG
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ModeSelectorCanvas *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
					    auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto mt_i : modemList) {
 | 
					    for (const auto& mt_i : modemList) {
 | 
				
			||||||
        pCanvas->addChoice(mt_i);
 | 
					        pCanvas->addChoice(mt_i);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -837,7 +836,7 @@ AppFrame::~AppFrame() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
wxMenu *AppFrame::makeFileMenu() {
 | 
					wxMenu *AppFrame::makeFileMenu() {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    wxMenu *menu = new wxMenu;
 | 
					    auto *menu = new wxMenu;
 | 
				
			||||||
#ifndef __APPLE__ 
 | 
					#ifndef __APPLE__ 
 | 
				
			||||||
#ifdef CUBICSDR_ENABLE_ABOUT_DIALOG
 | 
					#ifdef CUBICSDR_ENABLE_ABOUT_DIALOG
 | 
				
			||||||
    menu->Append(wxID_ABOUT_CUBICSDR, "About " CUBICSDR_INSTALL_NAME);
 | 
					    menu->Append(wxID_ABOUT_CUBICSDR, "About " CUBICSDR_INSTALL_NAME);
 | 
				
			||||||
@ -848,7 +847,7 @@ wxMenu *AppFrame::makeFileMenu() {
 | 
				
			|||||||
    menu->Append(wxID_SDR_START_STOP, "Stop / Start Device");
 | 
					    menu->Append(wxID_SDR_START_STOP, "Stop / Start Device");
 | 
				
			||||||
    menu->AppendSeparator();
 | 
					    menu->AppendSeparator();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxMenu *sessionMenu = new wxMenu;
 | 
					    auto *sessionMenu = new wxMenu;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    sessionMenu->Append(wxID_OPEN, "&Open Session");
 | 
					    sessionMenu->Append(wxID_OPEN, "&Open Session");
 | 
				
			||||||
    sessionMenu->Append(wxID_SAVE, "&Save Session");
 | 
					    sessionMenu->Append(wxID_SAVE, "&Save Session");
 | 
				
			||||||
@ -860,7 +859,7 @@ wxMenu *AppFrame::makeFileMenu() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    menu->AppendSeparator();
 | 
					    menu->AppendSeparator();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxMenu *bookmarkMenu = new wxMenu;
 | 
					    auto *bookmarkMenu = new wxMenu;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    bookmarkMenu->Append(wxID_OPEN_BOOKMARKS, "Open Bookmarks");
 | 
					    bookmarkMenu->Append(wxID_OPEN_BOOKMARKS, "Open Bookmarks");
 | 
				
			||||||
	bookmarkMenu->Append(wxID_SAVE_BOOKMARKS, "Save Bookmarks");
 | 
						bookmarkMenu->Append(wxID_SAVE_BOOKMARKS, "Save Bookmarks");
 | 
				
			||||||
@ -890,14 +889,14 @@ wxMenu *AppFrame::makeRecordingMenu() {
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	recordingMenuItems.clear();
 | 
						recordingMenuItems.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wxMenu *menu = new wxMenu;
 | 
						auto *menu = new wxMenu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	recordingMenuItems[wxID_RECORDING_PATH] = menu->Append(wxID_RECORDING_PATH, getSettingsLabel("Set Recording Path", "<Not Set>"));
 | 
						recordingMenuItems[wxID_RECORDING_PATH] = menu->Append(wxID_RECORDING_PATH, getSettingsLabel("Set Recording Path", "<Not Set>"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	menu->AppendSeparator();
 | 
						menu->AppendSeparator();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//Squelch options as sub-menu:
 | 
						//Squelch options as sub-menu:
 | 
				
			||||||
	wxMenu *subMenu = new wxMenu;
 | 
						auto *subMenu = new wxMenu;
 | 
				
			||||||
	recordingMenuItems[wxID_RECORDING_SQUELCH_BASE] = menu->AppendSubMenu(subMenu, "Squelch");
 | 
						recordingMenuItems[wxID_RECORDING_SQUELCH_BASE] = menu->AppendSubMenu(subMenu, "Squelch");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	recordingMenuItems[wxID_RECORDING_SQUELCH_SILENCE] = subMenu->AppendRadioItem(wxID_RECORDING_SQUELCH_SILENCE, "Record Silence", 
 | 
						recordingMenuItems[wxID_RECORDING_SQUELCH_SILENCE] = subMenu->AppendRadioItem(wxID_RECORDING_SQUELCH_SILENCE, "Record Silence", 
 | 
				
			||||||
@ -962,8 +961,8 @@ void AppFrame::updateRecordingMenu() {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppFrame::initDeviceParams(SDRDeviceInfo *devInfo) {
 | 
					void AppFrame::initDeviceParams(SDRDeviceInfo *devInfo_in) {
 | 
				
			||||||
    this->devInfo = devInfo;
 | 
					    devInfo = devInfo_in;
 | 
				
			||||||
    deviceChanged.store(true);
 | 
					    deviceChanged.store(true);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -981,14 +980,14 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
    SoapySDR::Device *soapyDev = devInfo->getSoapyDevice();
 | 
					    SoapySDR::Device *soapyDev = devInfo->getSoapyDevice();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // Build settings menu
 | 
					    // Build settings menu
 | 
				
			||||||
    wxMenu *newSettingsMenu = new wxMenu;
 | 
					    auto *newSettingsMenu = new wxMenu;
 | 
				
			||||||
    showTipMenuItem = newSettingsMenu->AppendCheckItem(wxID_SET_TIPS, "Show Hover Tips");
 | 
					    showTipMenuItem = newSettingsMenu->AppendCheckItem(wxID_SET_TIPS, "Show Hover Tips");
 | 
				
			||||||
    showTipMenuItem->Check(wxGetApp().getConfig()->getShowTips());
 | 
					    showTipMenuItem->Check(wxGetApp().getConfig()->getShowTips());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // CPU usage menu:
 | 
					    // CPU usage menu:
 | 
				
			||||||
    performanceMenuItems.clear();
 | 
					    performanceMenuItems.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxMenu *subMenu = new wxMenu;
 | 
					    auto *subMenu = new wxMenu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    performanceMenuItems[wxID_PERF_BASE + (int)AppConfig::PERF_HIGH] = subMenu->AppendRadioItem(wxID_PERF_BASE + (int)AppConfig::PERF_HIGH, "High (+enhanced DSP)");
 | 
					    performanceMenuItems[wxID_PERF_BASE + (int)AppConfig::PERF_HIGH] = subMenu->AppendRadioItem(wxID_PERF_BASE + (int)AppConfig::PERF_HIGH, "High (+enhanced DSP)");
 | 
				
			||||||
    performanceMenuItems[wxID_PERF_BASE + (int)AppConfig::PERF_NORMAL] = subMenu->AppendRadioItem(wxID_PERF_BASE + (int)AppConfig::PERF_NORMAL, "Normal");
 | 
					    performanceMenuItems[wxID_PERF_BASE + (int)AppConfig::PERF_NORMAL] = subMenu->AppendRadioItem(wxID_PERF_BASE + (int)AppConfig::PERF_NORMAL, "Normal");
 | 
				
			||||||
@ -1026,7 +1025,7 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    agcMenuItem = nullptr;
 | 
					    agcMenuItem = nullptr;
 | 
				
			||||||
    if (soapyDev->listGains(SOAPY_SDR_RX, 0).size()) {
 | 
					    if (!soapyDev->listGains(SOAPY_SDR_RX, 0).empty()) {
 | 
				
			||||||
        agcMenuItem = newSettingsMenu->AppendCheckItem(wxID_AGC_CONTROL, "Automatic Gain");
 | 
					        agcMenuItem = newSettingsMenu->AppendCheckItem(wxID_AGC_CONTROL, "Automatic Gain");
 | 
				
			||||||
        agcMenuItem->Check(wxGetApp().getAGCMode());
 | 
					        agcMenuItem->Check(wxGetApp().getAGCMode());
 | 
				
			||||||
    } else if (!wxGetApp().getAGCMode()) {
 | 
					    } else if (!wxGetApp().getAGCMode()) {
 | 
				
			||||||
@ -1044,11 +1043,11 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        antennaNames = availableAntennas;
 | 
					        antennaNames = availableAntennas;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        wxMenu *subMenu = new wxMenu;
 | 
					        auto *subMenu = new wxMenu;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        int i = 0;
 | 
					        int i = 0;
 | 
				
			||||||
        std::string antennaChecked;
 | 
					        std::string antennaChecked;
 | 
				
			||||||
        for (std::string currentAntenna : availableAntennas) {
 | 
					        for (const std::string& currentAntenna : availableAntennas) {
 | 
				
			||||||
           
 | 
					           
 | 
				
			||||||
            antennaMenuItems[wxID_ANTENNAS_BASE + i] = subMenu->AppendRadioItem(wxID_ANTENNAS_BASE + i, currentAntenna);
 | 
					            antennaMenuItems[wxID_ANTENNAS_BASE + i] = subMenu->AppendRadioItem(wxID_ANTENNAS_BASE + i, currentAntenna);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1083,7 +1082,7 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
    SoapySDR::ArgInfoList::const_iterator args_i;
 | 
					    SoapySDR::ArgInfoList::const_iterator args_i;
 | 
				
			||||||
    settingArgs = soapyDev->getSettingInfo();
 | 
					    settingArgs = soapyDev->getSettingInfo();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (settingArgs.size()) {
 | 
					    if (!settingArgs.empty()) {
 | 
				
			||||||
        newSettingsMenu->AppendSeparator();
 | 
					        newSettingsMenu->AppendSeparator();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //for each Runtime option of index i:
 | 
					    //for each Runtime option of index i:
 | 
				
			||||||
@ -1105,16 +1104,16 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
            settingsMenuItems[wxID_SETTINGS_BASE + i] = newSettingsMenu->Append(wxID_SETTINGS_BASE + i, getSettingsLabel(arg.name, currentVal, arg.units), arg.description);
 | 
					            settingsMenuItems[wxID_SETTINGS_BASE + i] = newSettingsMenu->Append(wxID_SETTINGS_BASE + i, getSettingsLabel(arg.name, currentVal, arg.units), arg.description);
 | 
				
			||||||
            i++;
 | 
					            i++;
 | 
				
			||||||
        } else if (arg.type == SoapySDR::ArgInfo::STRING) {
 | 
					        } else if (arg.type == SoapySDR::ArgInfo::STRING) {
 | 
				
			||||||
            if (arg.options.size()) {
 | 
					            if (!arg.options.empty()) {
 | 
				
			||||||
                wxMenu *subMenu = new wxMenu;
 | 
					                auto *subMenu = new wxMenu;
 | 
				
			||||||
                int j = 0;
 | 
					                int j = 0;
 | 
				
			||||||
                std::vector<int> subItemsIds;
 | 
					                std::vector<int> subItemsIds;
 | 
				
			||||||
				//for each of this options
 | 
									//for each of this options
 | 
				
			||||||
                for (std::string optName : arg.options) {
 | 
					                for (const std::string& optName : arg.options) {
 | 
				
			||||||
					//by default the option name is the same as the displayed name.
 | 
										//by default the option name is the same as the displayed name.
 | 
				
			||||||
                    std::string displayName = optName;
 | 
					                    std::string displayName = optName;
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
					if (arg.optionNames.size()) {
 | 
										if (!arg.optionNames.empty()) {
 | 
				
			||||||
                        displayName = arg.optionNames[j];
 | 
					                        displayName = arg.optionNames[j];
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    wxMenuItem *item = subMenu->AppendRadioItem(wxID_SETTINGS_BASE+i, displayName);
 | 
					                    wxMenuItem *item = subMenu->AppendRadioItem(wxID_SETTINGS_BASE+i, displayName);
 | 
				
			||||||
@ -1146,7 +1145,7 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
    sampleRates = devInfo->getSampleRates(SOAPY_SDR_RX, 0);
 | 
					    sampleRates = devInfo->getSampleRates(SOAPY_SDR_RX, 0);
 | 
				
			||||||
    sampleRateMenuItems.clear();
 | 
					    sampleRateMenuItems.clear();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    wxMenu *newSampleRateMenu = new wxMenu;
 | 
					    auto *newSampleRateMenu = new wxMenu;
 | 
				
			||||||
    int ofs = 0;
 | 
					    int ofs = 0;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    //Current sample rate, try to keep it as is.
 | 
					    //Current sample rate, try to keep it as is.
 | 
				
			||||||
@ -1167,11 +1166,11 @@ void AppFrame::handleUpdateDeviceParams() {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool checked = false;
 | 
					    bool checked = false;
 | 
				
			||||||
    for (vector<long>::iterator i = sampleRates.begin(); i != sampleRates.end(); i++) {
 | 
					    for (long & i : sampleRates) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        sampleRateMenuItems[wxID_BANDWIDTH_BASE+ofs] = newSampleRateMenu->AppendRadioItem(wxID_BANDWIDTH_BASE+ofs, frequencyToStr(*i));
 | 
					        sampleRateMenuItems[wxID_BANDWIDTH_BASE+ofs] = newSampleRateMenu->AppendRadioItem(wxID_BANDWIDTH_BASE+ofs, frequencyToStr(i));
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if (sampleRate == (*i)) {
 | 
					        if (sampleRate == i) {
 | 
				
			||||||
            sampleRateMenuItems[wxID_BANDWIDTH_BASE+ofs]->Check(true);
 | 
					            sampleRateMenuItems[wxID_BANDWIDTH_BASE+ofs]->Check(true);
 | 
				
			||||||
            checked = true;
 | 
					            checked = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -1262,11 +1261,11 @@ void AppFrame::disableRig() {
 | 
				
			|||||||
    wxGetApp().getConfig()->setRigEnabled(false);
 | 
					    wxGetApp().getConfig()->setRigEnabled(false);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppFrame::setRigControlPort(std::string portName) {
 | 
					void AppFrame::setRigControlPort(const std::string& portName) {
 | 
				
			||||||
    if (rigPortDialog == nullptr) {
 | 
					    if (rigPortDialog == nullptr) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (portName != "") {
 | 
					    if (!portName.empty()) {
 | 
				
			||||||
        rigPort = portName;
 | 
					        rigPort = portName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        wxGetApp().stopRig();
 | 
					        wxGetApp().stopRig();
 | 
				
			||||||
@ -1437,8 +1436,8 @@ bool AppFrame::actionOnMenuAbout(wxCommandEvent& event) {
 | 
				
			|||||||
            aboutDlg->SetFocus();
 | 
					            aboutDlg->SetFocus();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            aboutDlg = new AboutDialog(NULL);
 | 
					            aboutDlg = new AboutDialog(nullptr);
 | 
				
			||||||
            aboutDlg->Connect(wxEVT_CLOSE_WINDOW, wxCommandEventHandler(AppFrame::OnAboutDialogClose), NULL, this);
 | 
					            aboutDlg->Connect(wxEVT_CLOSE_WINDOW, wxCommandEventHandler(AppFrame::OnAboutDialogClose), nullptr, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            aboutDlg->Show();
 | 
					            aboutDlg->Show();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -1465,10 +1464,8 @@ bool AppFrame::actionOnMenuSettings(wxCommandEvent& event) {
 | 
				
			|||||||
        int setIdx = event.GetId() - wxID_SETTINGS_BASE;
 | 
					        int setIdx = event.GetId() - wxID_SETTINGS_BASE;
 | 
				
			||||||
        int menuIdx = 0;
 | 
					        int menuIdx = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (std::vector<SoapySDR::ArgInfo>::iterator arg_i = settingArgs.begin(); arg_i != settingArgs.end(); arg_i++) {
 | 
					        for (auto & arg : settingArgs) {
 | 
				
			||||||
            SoapySDR::ArgInfo &arg = (*arg_i);
 | 
					            if (arg.type == SoapySDR::ArgInfo::STRING && !arg.options.empty() && setIdx >= menuIdx && setIdx < menuIdx + (int)arg.options.size()) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (arg.type == SoapySDR::ArgInfo::STRING && arg.options.size() && setIdx >= menuIdx && setIdx < menuIdx + (int)arg.options.size()) {
 | 
					 | 
				
			||||||
                int optIdx = setIdx - menuIdx;
 | 
					                int optIdx = setIdx - menuIdx;
 | 
				
			||||||
                wxGetApp().getSDRThread()->writeSetting(arg.key, arg.options[optIdx]);
 | 
					                wxGetApp().getSDRThread()->writeSetting(arg.key, arg.options[optIdx]);
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
@ -1476,7 +1473,7 @@ bool AppFrame::actionOnMenuSettings(wxCommandEvent& event) {
 | 
				
			|||||||
                settingsMenuItems[menuIdx + wxID_SETTINGS_BASE]->SetItemLabel(getSettingsLabel(arg.name, arg.options[optIdx], arg.units));             
 | 
					                settingsMenuItems[menuIdx + wxID_SETTINGS_BASE]->SetItemLabel(getSettingsLabel(arg.name, arg.options[optIdx], arg.units));             
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (arg.type == SoapySDR::ArgInfo::STRING && arg.options.size()) {
 | 
					            else if (arg.type == SoapySDR::ArgInfo::STRING && !arg.options.empty()) {
 | 
				
			||||||
                menuIdx += arg.options.size();
 | 
					                menuIdx += arg.options.size();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (menuIdx == setIdx) {
 | 
					            else if (menuIdx == setIdx) {
 | 
				
			||||||
@ -1489,7 +1486,7 @@ bool AppFrame::actionOnMenuSettings(wxCommandEvent& event) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    settingsMenuItems[menuIdx + wxID_SETTINGS_BASE]->SetItemLabel(getSettingsLabel(arg.name, stringVal.ToStdString(), arg.units));
 | 
					                    settingsMenuItems[menuIdx + wxID_SETTINGS_BASE]->SetItemLabel(getSettingsLabel(arg.name, stringVal.ToStdString(), arg.units));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (stringVal.ToStdString() != "") {
 | 
					                    if (!stringVal.ToStdString().empty()) {
 | 
				
			||||||
                        wxGetApp().getSDRThread()->writeSetting(arg.key, stringVal.ToStdString());
 | 
					                        wxGetApp().getSDRThread()->writeSetting(arg.key, stringVal.ToStdString());
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
@ -1499,7 +1496,7 @@ bool AppFrame::actionOnMenuSettings(wxCommandEvent& event) {
 | 
				
			|||||||
                    try {
 | 
					                    try {
 | 
				
			||||||
                        currentVal = std::stoi(wxGetApp().getSDRThread()->readSetting(arg.key));
 | 
					                        currentVal = std::stoi(wxGetApp().getSDRThread()->readSetting(arg.key));
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    catch (std::invalid_argument e) {
 | 
					                    catch (const std::invalid_argument &e) {
 | 
				
			||||||
                        currentVal = 0;
 | 
					                        currentVal = 0;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    int intVal = wxGetNumberFromUser(arg.description, arg.units, arg.name, currentVal, arg.range.minimum(), arg.range.maximum(), this);
 | 
					                    int intVal = wxGetNumberFromUser(arg.description, arg.units, arg.name, currentVal, arg.range.minimum(), arg.range.maximum(), this);
 | 
				
			||||||
@ -1516,7 +1513,7 @@ bool AppFrame::actionOnMenuSettings(wxCommandEvent& event) {
 | 
				
			|||||||
                    try {
 | 
					                    try {
 | 
				
			||||||
                        wxGetApp().getSDRThread()->writeSetting(arg.key, floatVal.ToStdString());
 | 
					                        wxGetApp().getSDRThread()->writeSetting(arg.key, floatVal.ToStdString());
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    catch (std::invalid_argument e) {
 | 
					                    catch (const std::invalid_argument &e) {
 | 
				
			||||||
                        // ...
 | 
					                        // ...
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    settingsMenuItems[menuIdx + wxID_SETTINGS_BASE]->SetItemLabel(getSettingsLabel(arg.name, floatVal.ToStdString(), arg.units));
 | 
					                    settingsMenuItems[menuIdx + wxID_SETTINGS_BASE]->SetItemLabel(getSettingsLabel(arg.name, floatVal.ToStdString(), arg.units));
 | 
				
			||||||
@ -1541,7 +1538,7 @@ bool AppFrame::actionOnMenuAGC(wxCommandEvent& event) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (event.GetId() == wxID_AGC_CONTROL) {
 | 
					    if (event.GetId() == wxID_AGC_CONTROL) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (wxGetApp().getDevice() == NULL) {
 | 
					        if (wxGetApp().getDevice() == nullptr) {
 | 
				
			||||||
            agcMenuItem->Check(true);
 | 
					            agcMenuItem->Check(true);
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -1582,15 +1579,15 @@ bool AppFrame::actionOnMenuSampleRate(wxCommandEvent& event) {
 | 
				
			|||||||
        SDRDeviceInfo *dev = wxGetApp().getDevice();
 | 
					        SDRDeviceInfo *dev = wxGetApp().getDevice();
 | 
				
			||||||
        if (dev != nullptr) {
 | 
					        if (dev != nullptr) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            std::vector<long> sampleRates = dev->getSampleRates(SOAPY_SDR_RX, 0);
 | 
					            std::vector<long> sampleRateList = dev->getSampleRates(SOAPY_SDR_RX, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //default
 | 
					            //default
 | 
				
			||||||
            rateLow = MANUAL_SAMPLE_RATE_MIN;
 | 
					            rateLow = MANUAL_SAMPLE_RATE_MIN;
 | 
				
			||||||
            rateHigh = MANUAL_SAMPLE_RATE_MAX;
 | 
					            rateHigh = MANUAL_SAMPLE_RATE_MAX;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (sampleRates.size()) {
 | 
					            if (!sampleRateList.empty()) {
 | 
				
			||||||
                rateLow = sampleRates.front();
 | 
					                rateLow = sampleRateList.front();
 | 
				
			||||||
                rateHigh = sampleRates.back();
 | 
					                rateHigh = sampleRateList.back();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            long bw = wxGetNumberFromUser("\n" + dev->getName() + "\n\n  "
 | 
					            long bw = wxGetNumberFromUser("\n" + dev->getName() + "\n\n  "
 | 
				
			||||||
@ -1635,17 +1632,17 @@ bool AppFrame::actionOnMenuAudioSampleRate(wxCommandEvent& event) {
 | 
				
			|||||||
        auto outputDevices = wxGetApp().getDemodMgr().getOutputDevices();
 | 
					        auto outputDevices = wxGetApp().getDemodMgr().getOutputDevices();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int i = 0;
 | 
					        int i = 0;
 | 
				
			||||||
        for (auto mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
 | 
					        for (auto & outputDevice : outputDevices) {
 | 
				
			||||||
            int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * mdevices_i->first;
 | 
					            int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * outputDevice.first;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int j = 0;
 | 
					            int j = 0;
 | 
				
			||||||
            for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
 | 
					            for (auto srate = outputDevice.second.sampleRates.begin(); srate != outputDevice.second.sampleRates.end();
 | 
				
			||||||
                srate++) {
 | 
					                srate++) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (evId == menu_id + j) {
 | 
					                if (evId == menu_id + j) {
 | 
				
			||||||
                    //audioSampleRateMenuItems[menu_id+j];
 | 
					                    //audioSampleRateMenuItems[menu_id+j];
 | 
				
			||||||
                    //std::cout << "Would set audio sample rate on device " << mdevices_i->second.name << " (" << mdevices_i->first << ") to " << (*srate) << "Hz" << std::endl;
 | 
					                    //std::cout << "Would set audio sample rate on device " << mdevices_i->second.name << " (" << mdevices_i->first << ") to " << (*srate) << "Hz" << std::endl;
 | 
				
			||||||
                    AudioThread::setDeviceSampleRate(mdevices_i->first, *srate);
 | 
					                    AudioThread::setDeviceSampleRate(outputDevice.first, *srate);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
@ -2271,7 +2268,7 @@ void AppFrame::handleModemProperties() {
 | 
				
			|||||||
        modemProps->fitColumns();
 | 
					        modemProps->fitColumns();
 | 
				
			||||||
#if ENABLE_DIGITAL_LAB
 | 
					#if ENABLE_DIGITAL_LAB
 | 
				
			||||||
        if (demod->getModemType() == "digital") {
 | 
					        if (demod->getModemType() == "digital") {
 | 
				
			||||||
            ModemDigitalOutputConsole *outp = (ModemDigitalOutputConsole *) demod->getOutput();
 | 
					            auto *outp = (ModemDigitalOutputConsole *) demod->getOutput();
 | 
				
			||||||
            if (!outp->getDialog()) {
 | 
					            if (!outp->getDialog()) {
 | 
				
			||||||
                outp->setTitle(demod->getDemodulatorType() + ": " + frequencyToStr(demod->getFrequency()));
 | 
					                outp->setTitle(demod->getDemodulatorType() + ": " + frequencyToStr(demod->getFrequency()));
 | 
				
			||||||
                outp->setDialog(new DigitalConsole(this, outp));
 | 
					                outp->setDialog(new DigitalConsole(this, outp));
 | 
				
			||||||
@ -2404,14 +2401,14 @@ void AppFrame::handleModeSelector() {
 | 
				
			|||||||
    string dSelectionadv = demodModeSelectorAdv->getSelectionLabel();
 | 
					    string dSelectionadv = demodModeSelectorAdv->getSelectionLabel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // basic demodulators
 | 
					    // basic demodulators
 | 
				
			||||||
    if (dSelection != "" && dSelection != mgr->getLastDemodulatorType()) {
 | 
					    if (!dSelection.empty() && dSelection != mgr->getLastDemodulatorType()) {
 | 
				
			||||||
        mgr->setLastDemodulatorType(dSelection);
 | 
					        mgr->setLastDemodulatorType(dSelection);
 | 
				
			||||||
        mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelection));
 | 
					        mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelection));
 | 
				
			||||||
        demodTuner->setHalfBand(dSelection == "USB" || dSelection == "LSB");
 | 
					        demodTuner->setHalfBand(dSelection == "USB" || dSelection == "LSB");
 | 
				
			||||||
        demodModeSelectorAdv->setSelection(-1);
 | 
					        demodModeSelectorAdv->setSelection(-1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
        // advanced demodulators
 | 
					        // advanced demodulators
 | 
				
			||||||
    else if (dSelectionadv != "" && dSelectionadv != mgr->getLastDemodulatorType()) {
 | 
					    else if (!dSelectionadv.empty() && dSelectionadv != mgr->getLastDemodulatorType()) {
 | 
				
			||||||
        mgr->setLastDemodulatorType(dSelectionadv);
 | 
					        mgr->setLastDemodulatorType(dSelectionadv);
 | 
				
			||||||
        mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelectionadv));
 | 
					        mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelectionadv));
 | 
				
			||||||
        demodTuner->setHalfBand(false);
 | 
					        demodTuner->setHalfBand(false);
 | 
				
			||||||
@ -2507,13 +2504,13 @@ void AppFrame::handleCurrentModem() {
 | 
				
			|||||||
        string dSelectionadv = demodModeSelectorAdv->getSelectionLabel();
 | 
					        string dSelectionadv = demodModeSelectorAdv->getSelectionLabel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // basic demodulators
 | 
					        // basic demodulators
 | 
				
			||||||
        if (dSelection != "" && dSelection != demod->getDemodulatorType()) {
 | 
					        if (!dSelection.empty() && dSelection != demod->getDemodulatorType()) {
 | 
				
			||||||
            demod->setDemodulatorType(dSelection);
 | 
					            demod->setDemodulatorType(dSelection);
 | 
				
			||||||
            demodTuner->setHalfBand(dSelection == "USB" || dSelection == "LSB");
 | 
					            demodTuner->setHalfBand(dSelection == "USB" || dSelection == "LSB");
 | 
				
			||||||
            demodModeSelectorAdv->setSelection(-1);
 | 
					            demodModeSelectorAdv->setSelection(-1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
            // advanced demodulators
 | 
					            // advanced demodulators
 | 
				
			||||||
        else if (dSelectionadv != "" && dSelectionadv != demod->getDemodulatorType()) {
 | 
					        else if (!dSelectionadv.empty() && dSelectionadv != demod->getDemodulatorType()) {
 | 
				
			||||||
            demod->setDemodulatorType(dSelectionadv);
 | 
					            demod->setDemodulatorType(dSelectionadv);
 | 
				
			||||||
            demodTuner->setHalfBand(false);
 | 
					            demodTuner->setHalfBand(false);
 | 
				
			||||||
            demodModeSelector->setSelection(-1);
 | 
					            demodModeSelector->setSelection(-1);
 | 
				
			||||||
@ -2609,7 +2606,7 @@ void AppFrame::handleCurrentModem() {
 | 
				
			|||||||
void AppFrame::OnDoubleClickSash(wxSplitterEvent& event)
 | 
					void AppFrame::OnDoubleClickSash(wxSplitterEvent& event)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    wxWindow *a, *b;
 | 
					    wxWindow *a, *b;
 | 
				
			||||||
    wxSplitterWindow *w = NULL;
 | 
					    wxSplitterWindow *w = nullptr;
 | 
				
			||||||
    float g = 0.5;
 | 
					    float g = 0.5;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (event.GetId() == wxID_MAIN_SPLITTER) {
 | 
					    if (event.GetId() == wxID_MAIN_SPLITTER) {
 | 
				
			||||||
@ -2620,7 +2617,7 @@ void AppFrame::OnDoubleClickSash(wxSplitterEvent& event)
 | 
				
			|||||||
        g = 6.0f/25.0f;
 | 
					        g = 6.0f/25.0f;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (w != NULL) {
 | 
					    if (w != nullptr) {
 | 
				
			||||||
        a = w->GetWindow1();
 | 
					        a = w->GetWindow1();
 | 
				
			||||||
        b = w->GetWindow2();
 | 
					        b = w->GetWindow2();
 | 
				
			||||||
        w->Unsplit();
 | 
					        w->Unsplit();
 | 
				
			||||||
@ -2643,7 +2640,7 @@ void AppFrame::OnAboutDialogClose(wxCommandEvent& /* event */) {
 | 
				
			|||||||
    aboutDlg = nullptr;
 | 
					    aboutDlg = nullptr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppFrame::saveSession(std::string fileName) {
 | 
					void AppFrame::saveSession(const std::string& fileName) {
 | 
				
			||||||
    wxGetApp().getSessionMgr().saveSession(fileName);
 | 
					    wxGetApp().getSessionMgr().saveSession(fileName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    currentSessionFile = fileName;
 | 
					    currentSessionFile = fileName;
 | 
				
			||||||
@ -2659,7 +2656,7 @@ void AppFrame::saveSession(std::string fileName) {
 | 
				
			|||||||
    SetTitle(titleBar);
 | 
					    SetTitle(titleBar);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool AppFrame::loadSession(std::string fileName) {
 | 
					bool AppFrame::loadSession(const std::string& fileName) {
 | 
				
			||||||
    bool result = wxGetApp().getSessionMgr().loadSession(fileName);
 | 
					    bool result = wxGetApp().getSessionMgr().loadSession(fileName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int sample_rate = wxGetApp().getSampleRate();
 | 
					    int sample_rate = wxGetApp().getSampleRate();
 | 
				
			||||||
@ -2794,7 +2791,7 @@ FrequencyDialog::FrequencyDialogTarget AppFrame::getFrequencyDialogTarget() {
 | 
				
			|||||||
    return target;
 | 
					    return target;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppFrame::gkNudge(DemodulatorInstancePtr demod, int snap) {
 | 
					void AppFrame::gkNudge(const DemodulatorInstancePtr& demod, int snap) {
 | 
				
			||||||
    if (demod) {
 | 
					    if (demod) {
 | 
				
			||||||
        auto demodFreq = demod->getFrequency()+snap;
 | 
					        auto demodFreq = demod->getFrequency()+snap;
 | 
				
			||||||
        auto demodBw = demod->getBandwidth();
 | 
					        auto demodBw = demod->getBandwidth();
 | 
				
			||||||
@ -3114,14 +3111,14 @@ void AppFrame::toggleAllActiveDemodRecording() {
 | 
				
			|||||||
    //by default, do a false => true for all:
 | 
					    //by default, do a false => true for all:
 | 
				
			||||||
    bool stateToSet = true;
 | 
					    bool stateToSet = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto i : allDemods) {
 | 
					    for (const auto& i : allDemods) {
 | 
				
			||||||
        if (i->isRecording()) {
 | 
					        if (i->isRecording()) {
 | 
				
			||||||
            stateToSet = false;
 | 
					            stateToSet = false;
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto i : allDemods) {
 | 
					    for (const auto& i : allDemods) {
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
        i->setRecording(stateToSet);               
 | 
					        i->setRecording(stateToSet);               
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -3161,7 +3158,7 @@ int AppFrame::getViewBandwidth() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppFrame::setStatusText(wxWindow* window, std::string statusText) {
 | 
					void AppFrame::setStatusText(wxWindow* window, const std::string& statusText) {
 | 
				
			||||||
    GetStatusBar()->SetStatusText(statusText);
 | 
					    GetStatusBar()->SetStatusText(statusText);
 | 
				
			||||||
    if (wxGetApp().getConfig()->getShowTips()) {
 | 
					    if (wxGetApp().getConfig()->getShowTips()) {
 | 
				
			||||||
        if (statusText != lastToolTip) {
 | 
					        if (statusText != lastToolTip) {
 | 
				
			||||||
@ -3178,7 +3175,7 @@ void AppFrame::setStatusText(wxWindow* window, std::string statusText) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AppFrame::setStatusText(std::string statusText, int value) {
 | 
					void AppFrame::setStatusText(const std::string& statusText, int value) {
 | 
				
			||||||
    GetStatusBar()->SetStatusText(
 | 
					    GetStatusBar()->SetStatusText(
 | 
				
			||||||
        wxString::Format(statusText.c_str(), wxNumberFormatter::ToString((long)value, wxNumberFormatter::Style_WithThousandsSep)));
 | 
					        wxString::Format(statusText.c_str(), wxNumberFormatter::ToString((long)value, wxNumberFormatter::Style_WithThousandsSep)));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -40,9 +40,9 @@ class PortSelectorDialog;
 | 
				
			|||||||
class AppFrame: public wxFrame {
 | 
					class AppFrame: public wxFrame {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    AppFrame();
 | 
					    AppFrame();
 | 
				
			||||||
    ~AppFrame();
 | 
					    ~AppFrame() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void initDeviceParams(SDRDeviceInfo *devInfo);
 | 
					    void initDeviceParams(SDRDeviceInfo *devInfo_in);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FFTVisualDataThread *getWaterfallDataThread();
 | 
					    FFTVisualDataThread *getWaterfallDataThread();
 | 
				
			||||||
	WaterfallCanvas *getWaterfallCanvas();
 | 
						WaterfallCanvas *getWaterfallCanvas();
 | 
				
			||||||
@ -80,12 +80,12 @@ public:
 | 
				
			|||||||
	bool canFocus();
 | 
						bool canFocus();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    //set tooltip to window
 | 
					    //set tooltip to window
 | 
				
			||||||
    void setStatusText(wxWindow* window, std::string statusText);
 | 
					    void setStatusText(wxWindow* window, const std::string& statusText);
 | 
				
			||||||
    void setStatusText(std::string statusText, int value);
 | 
					    void setStatusText(const std::string& statusText, int value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef USE_HAMLIB
 | 
					#ifdef USE_HAMLIB
 | 
				
			||||||
	void setRigControlPort(std::string portName);
 | 
						void setRigControlPort(const std::string& portName);
 | 
				
			||||||
	void dismissRigControlPortDialog();
 | 
						void dismissRigControlPortDialog();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -192,13 +192,13 @@ private:
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Session Management
 | 
					     * Session Management
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    void saveSession(std::string fileName);
 | 
					    void saveSession(const std::string& fileName);
 | 
				
			||||||
    bool loadSession(std::string fileName);
 | 
					    bool loadSession(const std::string& fileName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Keyboard handlers
 | 
						 * Keyboard handlers
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	void gkNudge(DemodulatorInstancePtr demod, int snap);
 | 
						void gkNudge(const DemodulatorInstancePtr& demod, int snap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void toggleActiveDemodRecording();
 | 
						void toggleActiveDemodRecording();
 | 
				
			||||||
	void toggleAllActiveDemodRecording();
 | 
						void toggleAllActiveDemodRecording();
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,6 @@
 | 
				
			|||||||
#include "BookmarkMgr.h"
 | 
					#include "BookmarkMgr.h"
 | 
				
			||||||
#include "CubicSDR.h"
 | 
					#include "CubicSDR.h"
 | 
				
			||||||
#include "DataTree.h"
 | 
					#include "DataTree.h"
 | 
				
			||||||
#include <wx/string.h>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BOOKMARK_RECENTS_MAX 25
 | 
					#define BOOKMARK_RECENTS_MAX 25
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -16,7 +15,7 @@ BookmarkMgr::BookmarkMgr() {
 | 
				
			|||||||
    rangesSorted = false;
 | 
					    rangesSorted = false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpath) {
 | 
					void BookmarkMgr::saveToFile(const std::string& bookmarkFn, bool backup, bool useFullpath) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
						std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -33,7 +32,7 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpa
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    DataNode *view_ranges = s.rootNode()->newChild("ranges");
 | 
					    DataNode *view_ranges = s.rootNode()->newChild("ranges");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto re_i : ranges) {
 | 
					    for (const auto& re_i : ranges) {
 | 
				
			||||||
        DataNode *range = view_ranges->newChild("range");
 | 
					        DataNode *range = view_ranges->newChild("range");
 | 
				
			||||||
        *range->newChild("label") = re_i->label;
 | 
					        *range->newChild("label") = re_i->label;
 | 
				
			||||||
        *range->newChild("freq") = re_i->freq;
 | 
					        *range->newChild("freq") = re_i->freq;
 | 
				
			||||||
@ -69,7 +68,7 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpa
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    DataNode *recent_modems = s.rootNode()->newChild("recent_modems");
 | 
					    DataNode *recent_modems = s.rootNode()->newChild("recent_modems");
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    for (auto demod : wxGetApp().getDemodMgr().getDemodulators()) {
 | 
					    for (const auto& demod : wxGetApp().getDemodMgr().getDemodulators()) {
 | 
				
			||||||
        wxGetApp().getDemodMgr().saveInstance(recent_modems->newChild("modem"),demod);
 | 
					        wxGetApp().getDemodMgr().saveInstance(recent_modems->newChild("modem"),demod);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -98,7 +97,7 @@ void BookmarkMgr::saveToFile(std::string bookmarkFn, bool backup, bool useFullpa
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFullpath) {
 | 
					bool BookmarkMgr::loadFromFile(const std::string& bookmarkFn, bool backup, bool useFullpath) {
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
						std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -157,10 +156,10 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull
 | 
				
			|||||||
        if (branches->hasAnother("range")) branches->getNext("range")->element()->get(bRange);
 | 
					        if (branches->hasAnother("range")) branches->getNext("range")->element()->get(bRange);
 | 
				
			||||||
        if (branches->hasAnother("bookmark")) branches->getNext("bookmark")->element()->get(bBookmark);
 | 
					        if (branches->hasAnother("bookmark")) branches->getNext("bookmark")->element()->get(bBookmark);
 | 
				
			||||||
        if (branches->hasAnother("recent")) branches->getNext("recent")->element()->get(bRecent);
 | 
					        if (branches->hasAnother("recent")) branches->getNext("recent")->element()->get(bRecent);
 | 
				
			||||||
        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("active", bActive?true:false);
 | 
					        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("active", bActive != 0);
 | 
				
			||||||
        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("range", bRange?true:false);
 | 
					        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("range", bRange != 0);
 | 
				
			||||||
        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("bookmark", bBookmark?true:false);
 | 
					        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("bookmark", bBookmark != 0);
 | 
				
			||||||
        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("recent", bRecent?true:false);
 | 
					        wxGetApp().getAppFrame()->getBookmarkView()->setExpandState("recent", bRecent != 0);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (s.rootNode()->hasAnother("ranges")) {
 | 
					    if (s.rootNode()->hasAnother("ranges")) {
 | 
				
			||||||
@ -183,20 +182,20 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull
 | 
				
			|||||||
        DataNode *modems = s.rootNode()->getNext("modems");
 | 
					        DataNode *modems = s.rootNode()->getNext("modems");
 | 
				
			||||||
        while (modems->hasAnother("group")) {
 | 
					        while (modems->hasAnother("group")) {
 | 
				
			||||||
            DataNode *group = modems->getNext("group");
 | 
					            DataNode *group = modems->getNext("group");
 | 
				
			||||||
            std::string expandState = "true";
 | 
					            std::string groupExpandState = "true";
 | 
				
			||||||
            std::string groupName = "Unnamed";
 | 
					            std::string groupName = "Unnamed";
 | 
				
			||||||
            if (group->hasAnother("@name")) {
 | 
					            if (group->hasAnother("@name")) {
 | 
				
			||||||
                groupName = group->getNext("@name")->element()->toString();
 | 
					                groupName = group->getNext("@name")->element()->toString();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (group->hasAnother("@expanded")) {
 | 
					            if (group->hasAnother("@expanded")) {
 | 
				
			||||||
                expandState = group->getNext("@expanded")->element()->toString();
 | 
					                groupExpandState = group->getNext("@expanded")->element()->toString();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            setExpandState(groupName, (expandState == "true"));
 | 
					            setExpandState(groupName, (groupExpandState == "true"));
 | 
				
			||||||
            while (group->hasAnother("modem")) {
 | 
					            while (group->hasAnother("modem")) {
 | 
				
			||||||
                DataNode *modem = group->getNext("modem");
 | 
					                DataNode *modem = group->getNext("modem");
 | 
				
			||||||
                BookmarkEntryPtr be = nodeToBookmark(modem);
 | 
					                BookmarkEntryPtr be = nodeToBookmark(modem);
 | 
				
			||||||
                if (be) {
 | 
					                if (be) {
 | 
				
			||||||
                    addBookmark(groupName.c_str(), be);
 | 
					                    addBookmark(groupName, be);
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    std::cout << "error loading bookmarked modem.." << std::endl;
 | 
					                    std::cout << "error loading bookmarked modem.." << std::endl;
 | 
				
			||||||
                    loadStatusOk = false;
 | 
					                    loadStatusOk = false;
 | 
				
			||||||
@ -227,7 +226,7 @@ bool BookmarkMgr::loadFromFile(std::string bookmarkFn, bool backup, bool useFull
 | 
				
			|||||||
                    wxCopyFile(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString(), lastLoaded.GetFullPath(wxPATH_NATIVE).ToStdString());
 | 
					                    wxCopyFile(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString(), lastLoaded.GetFullPath(wxPATH_NATIVE).ToStdString());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else if (!loadStatusOk) {
 | 
					        } else {
 | 
				
			||||||
            if (loadFile.IsDirWritable()) { // Load failed; keep a copy of the failed bookmark file for analysis?
 | 
					            if (loadFile.IsDirWritable()) { // Load failed; keep a copy of the failed bookmark file for analysis?
 | 
				
			||||||
                if (loadFile.FileExists() && (!failFile.FileExists() || failFile.IsFileWritable())) {
 | 
					                if (loadFile.FileExists() && (!failFile.FileExists() || failFile.IsFileWritable())) {
 | 
				
			||||||
                    wxCopyFile(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString(), failFile.GetFullPath(wxPATH_NATIVE).ToStdString());
 | 
					                    wxCopyFile(loadFile.GetFullPath(wxPATH_NATIVE).ToStdString(), failFile.GetFullPath(wxPATH_NATIVE).ToStdString());
 | 
				
			||||||
@ -278,17 +277,17 @@ void BookmarkMgr::resetBookmarks() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool BookmarkMgr::hasLastLoad(std::string bookmarkFn) {
 | 
					bool BookmarkMgr::hasLastLoad(const std::string& bookmarkFn) {
 | 
				
			||||||
    wxFileName lastLoaded(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".lastloaded");
 | 
					    wxFileName lastLoaded(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".lastloaded");
 | 
				
			||||||
    return lastLoaded.FileExists() && lastLoaded.IsFileReadable();
 | 
					    return lastLoaded.FileExists() && lastLoaded.IsFileReadable();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool BookmarkMgr::hasBackup(std::string bookmarkFn) {
 | 
					bool BookmarkMgr::hasBackup(const std::string& bookmarkFn) {
 | 
				
			||||||
    wxFileName backupFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
 | 
					    wxFileName backupFile(wxGetApp().getConfig()->getConfigDir(), bookmarkFn + ".backup");
 | 
				
			||||||
    return backupFile.FileExists() && backupFile.IsFileReadable();
 | 
					    return backupFile.FileExists() && backupFile.IsFileReadable();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::addBookmark(std::string group, DemodulatorInstancePtr demod) {
 | 
					void BookmarkMgr::addBookmark(const std::string& group, const DemodulatorInstancePtr& demod) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	//Create a BookmarkEntry from demod data, saving its
 | 
						//Create a BookmarkEntry from demod data, saving its
 | 
				
			||||||
@ -299,7 +298,7 @@ void BookmarkMgr::addBookmark(std::string group, DemodulatorInstancePtr demod) {
 | 
				
			|||||||
    bmDataSorted[group] = false;
 | 
					    bmDataSorted[group] = false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::addBookmark(std::string group, BookmarkEntryPtr be) {
 | 
					void BookmarkMgr::addBookmark(const std::string& group, const BookmarkEntryPtr& be) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    bmData[group].push_back(be);
 | 
					    bmData[group].push_back(be);
 | 
				
			||||||
@ -307,14 +306,14 @@ void BookmarkMgr::addBookmark(std::string group, BookmarkEntryPtr be) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::removeBookmark(std::string group, BookmarkEntryPtr be) {
 | 
					void BookmarkMgr::removeBookmark(const std::string& group, const BookmarkEntryPtr& be) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
    if (bmData.find(group) == bmData.end()) {
 | 
					    if (bmData.find(group) == bmData.end()) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    BookmarkList::iterator i = std::find(bmData[group].begin(), bmData[group].end(), be);
 | 
					    auto i = std::find(bmData[group].begin(), bmData[group].end(), be);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (i != bmData[group].end()) {
 | 
					    if (i != bmData[group].end()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -322,22 +321,22 @@ void BookmarkMgr::removeBookmark(std::string group, BookmarkEntryPtr be) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::removeBookmark(BookmarkEntryPtr be) {
 | 
					void BookmarkMgr::removeBookmark(const BookmarkEntryPtr& be) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    for (auto &bmd_i : bmData) {
 | 
					    for (auto &bmd_i : bmData) {
 | 
				
			||||||
        BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
 | 
					        auto i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
 | 
				
			||||||
        if (i != bmd_i.second.end()) {
 | 
					        if (i != bmd_i.second.end()) {
 | 
				
			||||||
            bmd_i.second.erase(i);
 | 
					            bmd_i.second.erase(i);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::moveBookmark(BookmarkEntryPtr be, std::string group) {
 | 
					void BookmarkMgr::moveBookmark(const BookmarkEntryPtr& be, const std::string& group) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    for (auto &bmd_i : bmData) {
 | 
					    for (auto &bmd_i : bmData) {
 | 
				
			||||||
        BookmarkList::iterator i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
 | 
					        auto i = std::find(bmd_i.second.begin(), bmd_i.second.end(), be);
 | 
				
			||||||
        if (i != bmd_i.second.end()) {
 | 
					        if (i != bmd_i.second.end()) {
 | 
				
			||||||
            if (bmd_i.first == group) {
 | 
					            if (bmd_i.first == group) {
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
@ -352,7 +351,7 @@ void BookmarkMgr::moveBookmark(BookmarkEntryPtr be, std::string group) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::addGroup(std::string group) {
 | 
					void BookmarkMgr::addGroup(const std::string& group) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (bmData.find(group) == bmData.end()) {
 | 
					    if (bmData.find(group) == bmData.end()) {
 | 
				
			||||||
@ -360,10 +359,10 @@ void BookmarkMgr::addGroup(std::string group) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::removeGroup(std::string group) {
 | 
					void BookmarkMgr::removeGroup(const std::string& group) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkMap::iterator i = bmData.find(group);
 | 
					    auto i = bmData.find(group);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (i != bmData.end()) {
 | 
					    if (i != bmData.end()) {
 | 
				
			||||||
       
 | 
					       
 | 
				
			||||||
@ -371,18 +370,18 @@ void BookmarkMgr::removeGroup(std::string group) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::renameGroup(std::string group, std::string ngroup) {
 | 
					void BookmarkMgr::renameGroup(const std::string& group, const std::string& ngroup) {
 | 
				
			||||||
    if (group == ngroup) {
 | 
					    if (group == ngroup) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkMap::iterator i = bmData.find(group);
 | 
					    auto i = bmData.find(group);
 | 
				
			||||||
    BookmarkMap::iterator it = bmData.find(ngroup);
 | 
					    auto it = bmData.find(ngroup);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (i != bmData.end() && it != bmData.end()) {
 | 
					    if (i != bmData.end() && it != bmData.end()) {
 | 
				
			||||||
        for (auto ii : bmData[group]) {
 | 
					        for (const auto& ii : bmData[group]) {
 | 
				
			||||||
            bmData[ngroup].push_back(ii);
 | 
					            bmData[ngroup].push_back(ii);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        bmData.erase(group);
 | 
					        bmData.erase(group);
 | 
				
			||||||
@ -392,7 +391,7 @@ void BookmarkMgr::renameGroup(std::string group, std::string ngroup) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BookmarkList BookmarkMgr::getBookmarks(std::string group) {
 | 
					BookmarkList BookmarkMgr::getBookmarks(const std::string& group) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (bmData.find(group) == bmData.end()) {
 | 
					    if (bmData.find(group) == bmData.end()) {
 | 
				
			||||||
@ -411,28 +410,28 @@ BookmarkList BookmarkMgr::getBookmarks(std::string group) {
 | 
				
			|||||||
void BookmarkMgr::getGroups(BookmarkNames &arr) {
 | 
					void BookmarkMgr::getGroups(BookmarkNames &arr) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) {
 | 
					    for (auto & i : bmData) {
 | 
				
			||||||
        arr.push_back(i->first);
 | 
					        arr.push_back(i.first);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::getGroups(wxArrayString &arr) {
 | 
					void BookmarkMgr::getGroups(wxArrayString &arr) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (BookmarkMap::iterator i = bmData.begin(); i!= bmData.end(); ++i) {
 | 
					    for (auto & i : bmData) {
 | 
				
			||||||
        arr.push_back(i->first);
 | 
					        arr.push_back(i.first);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::setExpandState(std::string groupName, bool state) {
 | 
					void BookmarkMgr::setExpandState(const std::string& groupName, bool state) {
 | 
				
			||||||
	std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
						std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    expandState[groupName] = state;
 | 
					    expandState[groupName] = state;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool BookmarkMgr::getExpandState(std::string groupName) {
 | 
					bool BookmarkMgr::getExpandState(const std::string& groupName) {
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
						std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -465,7 +464,7 @@ void BookmarkMgr::updateBookmarks() {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::updateBookmarks(std::string group) {
 | 
					void BookmarkMgr::updateBookmarks(const std::string& group) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
 | 
					    BookmarkView *bmv = wxGetApp().getAppFrame()->getBookmarkView();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -475,7 +474,7 @@ void BookmarkMgr::updateBookmarks(std::string group) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::addRecent(DemodulatorInstancePtr demod) {
 | 
					void BookmarkMgr::addRecent(const DemodulatorInstancePtr& demod) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    recents.push_back(demodToBookmarkEntry(demod));
 | 
					    recents.push_back(demodToBookmarkEntry(demod));
 | 
				
			||||||
@ -483,7 +482,7 @@ void BookmarkMgr::addRecent(DemodulatorInstancePtr demod) {
 | 
				
			|||||||
    trimRecents();
 | 
					    trimRecents();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::addRecent(BookmarkEntryPtr be) {
 | 
					void BookmarkMgr::addRecent(const BookmarkEntryPtr& be) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    recents.push_back(be);
 | 
					    recents.push_back(be);
 | 
				
			||||||
@ -493,10 +492,10 @@ void BookmarkMgr::addRecent(BookmarkEntryPtr be) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::removeRecent(BookmarkEntryPtr be) {
 | 
					void BookmarkMgr::removeRecent(const BookmarkEntryPtr& be) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkList::iterator bm_i = std::find(recents.begin(),recents.end(), be);
 | 
					    auto bm_i = std::find(recents.begin(),recents.end(), be);
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
    if (bm_i != recents.end()) {
 | 
					    if (bm_i != recents.end()) {
 | 
				
			||||||
        recents.erase(bm_i);
 | 
					        recents.erase(bm_i);
 | 
				
			||||||
@ -526,17 +525,17 @@ void BookmarkMgr::trimRecents() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::addRange(BookmarkRangeEntryPtr re) {
 | 
					void BookmarkMgr::addRange(const BookmarkRangeEntryPtr& re) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    ranges.push_back(re);
 | 
					    ranges.push_back(re);
 | 
				
			||||||
    rangesSorted = false;
 | 
					    rangesSorted = false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::removeRange(BookmarkRangeEntryPtr re) {
 | 
					void BookmarkMgr::removeRange(const BookmarkRangeEntryPtr& re) {
 | 
				
			||||||
    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
					    std::lock_guard < std::recursive_mutex > lock(busy_lock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkRangeList::iterator re_i = std::find(ranges.begin(), ranges.end(), re);
 | 
					    auto re_i = std::find(ranges.begin(), ranges.end(), re);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (re_i != ranges.end()) {
 | 
					    if (re_i != ranges.end()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -564,7 +563,7 @@ void BookmarkMgr::clearRanges() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BookmarkEntryPtr BookmarkMgr::demodToBookmarkEntry(DemodulatorInstancePtr demod) {
 | 
					BookmarkEntryPtr BookmarkMgr::demodToBookmarkEntry(const DemodulatorInstancePtr& demod) {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkEntryPtr be(new BookmarkEntry);
 | 
					    BookmarkEntryPtr be(new BookmarkEntry);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -583,7 +582,7 @@ BookmarkEntryPtr BookmarkMgr::demodToBookmarkEntry(DemodulatorInstancePtr demod)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string& childNodeName) {
 | 
					std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string& childNodeName) {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    std::wstring decodedWString = L"";
 | 
					    std::wstring decodedWString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (node != nullptr) {
 | 
					    if (node != nullptr) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -593,7 +592,7 @@ std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string&
 | 
				
			|||||||
        try {
 | 
					        try {
 | 
				
			||||||
            childNode->element()->get(decodedWString);
 | 
					            childNode->element()->get(decodedWString);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        } catch (DataTypeMismatchException e) {
 | 
					        } catch (const DataTypeMismatchException &e) {
 | 
				
			||||||
            //2) wstring decode fail, try simple std::string
 | 
					            //2) wstring decode fail, try simple std::string
 | 
				
			||||||
            std::string decodedStdString;
 | 
					            std::string decodedStdString;
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
@ -603,7 +602,7 @@ std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string&
 | 
				
			|||||||
                //use wxString for a clean conversion to a wstring:
 | 
					                //use wxString for a clean conversion to a wstring:
 | 
				
			||||||
                decodedWString = wxString(decodedStdString).ToStdWstring();
 | 
					                decodedWString = wxString(decodedStdString).ToStdWstring();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            } catch (DataTypeMismatchException e) {
 | 
					            } catch (const DataTypeMismatchException &e) {
 | 
				
			||||||
                //nothing works, return an empty string.
 | 
					                //nothing works, return an empty string.
 | 
				
			||||||
                decodedWString = L"";
 | 
					                decodedWString = L"";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -639,10 +638,10 @@ BookmarkEntryPtr BookmarkMgr::nodeToBookmark(DataNode *node) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::wstring BookmarkMgr::getBookmarkEntryDisplayName(BookmarkEntryPtr bmEnt) {
 | 
					std::wstring BookmarkMgr::getBookmarkEntryDisplayName(const BookmarkEntryPtr& bmEnt) {
 | 
				
			||||||
    std::wstring dispName = bmEnt->label;
 | 
					    std::wstring dispName = bmEnt->label;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (dispName == L"") {
 | 
					    if (dispName.empty()) {
 | 
				
			||||||
        std::string freqStr = frequencyToStr(bmEnt->frequency) + " " + bmEnt->type;
 | 
					        std::string freqStr = frequencyToStr(bmEnt->frequency) + " " + bmEnt->type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        dispName = wxString(freqStr).ToStdWstring();
 | 
					        dispName = wxString(freqStr).ToStdWstring();
 | 
				
			||||||
@ -651,10 +650,10 @@ std::wstring BookmarkMgr::getBookmarkEntryDisplayName(BookmarkEntryPtr bmEnt) {
 | 
				
			|||||||
    return dispName;
 | 
					    return dispName;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::wstring BookmarkMgr::getActiveDisplayName(DemodulatorInstancePtr demod) {
 | 
					std::wstring BookmarkMgr::getActiveDisplayName(const DemodulatorInstancePtr& demod) {
 | 
				
			||||||
    std::wstring activeName = demod->getDemodulatorUserLabel();
 | 
					    std::wstring activeName = demod->getDemodulatorUserLabel();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (activeName == L"") {
 | 
					    if (activeName.empty()) {
 | 
				
			||||||
        std::string wstr = frequencyToStr(demod->getFrequency()) + " " + demod->getDemodulatorType();
 | 
					        std::string wstr = frequencyToStr(demod->getFrequency()) + " " + demod->getDemodulatorType();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        activeName = wxString(wstr).ToStdWstring();
 | 
					        activeName = wxString(wstr).ToStdWstring();
 | 
				
			||||||
@ -663,7 +662,7 @@ std::wstring BookmarkMgr::getActiveDisplayName(DemodulatorInstancePtr demod) {
 | 
				
			|||||||
    return activeName;
 | 
					    return activeName;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BookmarkMgr::removeActive(DemodulatorInstancePtr demod) {
 | 
					void BookmarkMgr::removeActive(const DemodulatorInstancePtr& demod) {
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if (demod == nullptr) {
 | 
						if (demod == nullptr) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
				
			|||||||
@ -32,7 +32,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class BookmarkRangeEntry {
 | 
					class BookmarkRangeEntry {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    BookmarkRangeEntry() : label(L""), freq(0), startFreq(0), endFreq(0) {
 | 
					    BookmarkRangeEntry() : freq(0), startFreq(0), endFreq(0) {
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    BookmarkRangeEntry(std::wstring label, long long freq, long long startFreq, long long endFreq) : label(label), freq(freq), startFreq(startFreq), endFreq(endFreq) {
 | 
					    BookmarkRangeEntry(std::wstring label, long long freq, long long startFreq, long long endFreq) : label(label), freq(freq), startFreq(startFreq), endFreq(endFreq) {
 | 
				
			||||||
@ -60,57 +60,57 @@ public:
 | 
				
			|||||||
    BookmarkMgr();
 | 
					    BookmarkMgr();
 | 
				
			||||||
    //if useFullpath = false, use the application config dir.
 | 
					    //if useFullpath = false, use the application config dir.
 | 
				
			||||||
	//else assume bookmarkFn is a full path and use it for location.
 | 
						//else assume bookmarkFn is a full path and use it for location.
 | 
				
			||||||
    void saveToFile(std::string bookmarkFn, bool backup = true, bool useFullpath = false);
 | 
					    void saveToFile(const std::string& bookmarkFn, bool backup = true, bool useFullpath = false);
 | 
				
			||||||
    bool loadFromFile(std::string bookmarkFn, bool backup = true, bool useFullpath = false);
 | 
					    bool loadFromFile(const std::string& bookmarkFn, bool backup = true, bool useFullpath = false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void resetBookmarks();
 | 
						void resetBookmarks();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool hasLastLoad(std::string bookmarkFn);
 | 
					    bool hasLastLoad(const std::string& bookmarkFn);
 | 
				
			||||||
    bool hasBackup(std::string bookmarkFn);
 | 
					    bool hasBackup(const std::string& bookmarkFn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void addBookmark(std::string group, DemodulatorInstancePtr demod);
 | 
					    void addBookmark(const std::string& group, const DemodulatorInstancePtr& demod);
 | 
				
			||||||
    void addBookmark(std::string group, BookmarkEntryPtr be);
 | 
					    void addBookmark(const std::string& group, const BookmarkEntryPtr& be);
 | 
				
			||||||
    void removeBookmark(std::string group, BookmarkEntryPtr be);
 | 
					    void removeBookmark(const std::string& group, const BookmarkEntryPtr& be);
 | 
				
			||||||
    void removeBookmark(BookmarkEntryPtr be);
 | 
					    void removeBookmark(const BookmarkEntryPtr& be);
 | 
				
			||||||
    void moveBookmark(BookmarkEntryPtr be, std::string group);
 | 
					    void moveBookmark(const BookmarkEntryPtr& be, const std::string& group);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void addGroup(std::string group);
 | 
					    void addGroup(const std::string& group);
 | 
				
			||||||
    void removeGroup(std::string group);
 | 
					    void removeGroup(const std::string& group);
 | 
				
			||||||
    void renameGroup(std::string group, std::string ngroup);
 | 
					    void renameGroup(const std::string& group, const std::string& ngroup);
 | 
				
			||||||
	//return an independent copy on purpose 
 | 
						//return an independent copy on purpose 
 | 
				
			||||||
    BookmarkList getBookmarks(std::string group);
 | 
					    BookmarkList getBookmarks(const std::string& group);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void getGroups(BookmarkNames &arr);
 | 
					    void getGroups(BookmarkNames &arr);
 | 
				
			||||||
    void getGroups(wxArrayString &arr);
 | 
					    void getGroups(wxArrayString &arr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setExpandState(std::string groupName, bool state);
 | 
					    void setExpandState(const std::string& groupName, bool state);
 | 
				
			||||||
    bool getExpandState(std::string groupName);
 | 
					    bool getExpandState(const std::string& groupName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void updateActiveList();
 | 
					    void updateActiveList();
 | 
				
			||||||
    void updateBookmarks();
 | 
					    void updateBookmarks();
 | 
				
			||||||
    void updateBookmarks(std::string group);
 | 
					    void updateBookmarks(const std::string& group);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void addRecent(DemodulatorInstancePtr demod);
 | 
					    void addRecent(const DemodulatorInstancePtr& demod);
 | 
				
			||||||
    void addRecent(BookmarkEntryPtr be);
 | 
					    void addRecent(const BookmarkEntryPtr& be);
 | 
				
			||||||
    void removeRecent(BookmarkEntryPtr be);
 | 
					    void removeRecent(const BookmarkEntryPtr& be);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	//return an independent copy on purpose 
 | 
						//return an independent copy on purpose 
 | 
				
			||||||
	BookmarkList getRecents();
 | 
						BookmarkList getRecents();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void clearRecents();
 | 
					    void clearRecents();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void removeActive(DemodulatorInstancePtr demod);
 | 
						void removeActive(const DemodulatorInstancePtr& demod);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void addRange(BookmarkRangeEntryPtr re);
 | 
					    void addRange(const BookmarkRangeEntryPtr& re);
 | 
				
			||||||
    void removeRange(BookmarkRangeEntryPtr re);
 | 
					    void removeRange(const BookmarkRangeEntryPtr& re);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//return an independent copy on purpose 
 | 
						//return an independent copy on purpose 
 | 
				
			||||||
	BookmarkRangeList getRanges();
 | 
						BookmarkRangeList getRanges();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	void clearRanges();
 | 
						void clearRanges();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    static std::wstring getBookmarkEntryDisplayName(BookmarkEntryPtr bmEnt);
 | 
					    static std::wstring getBookmarkEntryDisplayName(const BookmarkEntryPtr& bmEnt);
 | 
				
			||||||
    static std::wstring getActiveDisplayName(DemodulatorInstancePtr demod);
 | 
					    static std::wstring getActiveDisplayName(const DemodulatorInstancePtr& demod);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
@ -122,7 +122,7 @@ protected:
 | 
				
			|||||||
    //return an empty string.
 | 
					    //return an empty string.
 | 
				
			||||||
    static std::wstring getSafeWstringValue(DataNode* node, const std::string& childNodeName);
 | 
					    static std::wstring getSafeWstringValue(DataNode* node, const std::string& childNodeName);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkEntryPtr demodToBookmarkEntry(DemodulatorInstancePtr demod);
 | 
					    BookmarkEntryPtr demodToBookmarkEntry(const DemodulatorInstancePtr& demod);
 | 
				
			||||||
    BookmarkEntryPtr nodeToBookmark(DataNode *node);
 | 
					    BookmarkEntryPtr nodeToBookmark(DataNode *node);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    BookmarkMap bmData;
 | 
					    BookmarkMap bmData;
 | 
				
			||||||
 | 
				
			|||||||
@ -81,7 +81,7 @@ std::string frequencyToStr(long long freq) {
 | 
				
			|||||||
    long double freqTemp;
 | 
					    long double freqTemp;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    freqTemp = freq;
 | 
					    freqTemp = freq;
 | 
				
			||||||
    std::string suffix("");
 | 
					    std::string suffix;
 | 
				
			||||||
    std::stringstream freqStr;
 | 
					    std::stringstream freqStr;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (freqTemp >= 1.0e9) {
 | 
					    if (freqTemp >= 1.0e9) {
 | 
				
			||||||
@ -133,7 +133,7 @@ long long strToFrequency(std::string freqStr) {
 | 
				
			|||||||
        } else if (suffixStr.find_first_of("Hh") != std::string::npos) {
 | 
					        } else if (suffixStr.find_first_of("Hh") != std::string::npos) {
 | 
				
			||||||
            // ...
 | 
					            // ...
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    } else if (numPartStr.find_first_of(".") != std::string::npos || freqTemp <= 3000) {
 | 
					    } else if (numPartStr.find_first_of('.') != std::string::npos || freqTemp <= 3000) {
 | 
				
			||||||
        freqTemp *= 1.0e6;
 | 
					        freqTemp *= 1.0e6;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -148,7 +148,7 @@ public:
 | 
				
			|||||||
        m_questionText->SetLabelText(wxT("All attempts to recover bookmarks have failed. \nWould you like to exit without touching any more save files?\nClick OK to exit without saving; or Cancel to continue anyways."));
 | 
					        m_questionText->SetLabelText(wxT("All attempts to recover bookmarks have failed. \nWould you like to exit without touching any more save files?\nClick OK to exit without saving; or Cancel to continue anyways."));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void doClickOK() {
 | 
					    void doClickOK() override {
 | 
				
			||||||
        wxGetApp().getAppFrame()->disableSave(true);
 | 
					        wxGetApp().getAppFrame()->disableSave(true);
 | 
				
			||||||
        wxGetApp().getAppFrame()->Close(false);
 | 
					        wxGetApp().getAppFrame()->Close(false);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -162,7 +162,7 @@ public:
 | 
				
			|||||||
        m_questionText->SetLabelText(wxT("Sorry; unable to load your bookmarks backup file. \nWould you like to attempt to load the last succssfully loaded bookmarks file?"));
 | 
					        m_questionText->SetLabelText(wxT("Sorry; unable to load your bookmarks backup file. \nWould you like to attempt to load the last succssfully loaded bookmarks file?"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void doClickOK() {
 | 
					    void doClickOK() override {
 | 
				
			||||||
        if (wxGetApp().getBookmarkMgr().hasLastLoad("bookmarks.xml")) {
 | 
					        if (wxGetApp().getBookmarkMgr().hasLastLoad("bookmarks.xml")) {
 | 
				
			||||||
            if (wxGetApp().getBookmarkMgr().loadFromFile("bookmarks.xml.lastloaded",false)) {
 | 
					            if (wxGetApp().getBookmarkMgr().loadFromFile("bookmarks.xml.lastloaded",false)) {
 | 
				
			||||||
                wxGetApp().getBookmarkMgr().updateBookmarks();
 | 
					                wxGetApp().getBookmarkMgr().updateBookmarks();
 | 
				
			||||||
@ -181,7 +181,7 @@ public:
 | 
				
			|||||||
        m_questionText->SetLabelText(wxT("Sorry; unable to load your bookmarks file. \nWould you like to attempt to load the backup file?"));
 | 
					        m_questionText->SetLabelText(wxT("Sorry; unable to load your bookmarks file. \nWould you like to attempt to load the backup file?"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void doClickOK() {
 | 
					    void doClickOK() override {
 | 
				
			||||||
        bool loadOk = false;
 | 
					        bool loadOk = false;
 | 
				
			||||||
        if (wxGetApp().getBookmarkMgr().hasBackup("bookmarks.xml")) {
 | 
					        if (wxGetApp().getBookmarkMgr().hasBackup("bookmarks.xml")) {
 | 
				
			||||||
            loadOk = wxGetApp().getBookmarkMgr().loadFromFile("bookmarks.xml.backup",false);
 | 
					            loadOk = wxGetApp().getBookmarkMgr().loadFromFile("bookmarks.xml.backup",false);
 | 
				
			||||||
@ -201,11 +201,11 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class ActionDialogRigError : public ActionDialog {
 | 
					class ActionDialogRigError : public ActionDialog {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    ActionDialogRigError(std::string message) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Rig Control Error")) {
 | 
					    explicit ActionDialogRigError(const std::string& message) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Rig Control Error")) {
 | 
				
			||||||
        m_questionText->SetLabelText(message);
 | 
					        m_questionText->SetLabelText(message);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void doClickOK() {
 | 
					    void doClickOK() override {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -238,12 +238,12 @@ void CubicSDR::initAudioDevices() const {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    int i = 0;
 | 
					    int i = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (auto devices_i = devices.begin(); devices_i != devices.end(); devices_i++) {
 | 
					    for (auto & device : devices) {
 | 
				
			||||||
        if (devices_i->inputChannels) {
 | 
					        if (device.inputChannels) {
 | 
				
			||||||
            inputDevices[i] = *devices_i;
 | 
					            inputDevices[i] = device;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (devices_i->outputChannels) {
 | 
					        if (device.outputChannels) {
 | 
				
			||||||
            outputDevices[i] = *devices_i;
 | 
					            outputDevices[i] = device;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        i++;
 | 
					        i++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -541,7 +541,7 @@ int CubicSDR::OnExit() {
 | 
				
			|||||||
PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
 | 
					PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
 | 
				
			||||||
    PrimaryGLContext *glContext;
 | 
					    PrimaryGLContext *glContext;
 | 
				
			||||||
    if (!m_glContext) {
 | 
					    if (!m_glContext) {
 | 
				
			||||||
        m_glContext = new PrimaryGLContext(canvas, NULL, GetContextAttributes());
 | 
					        m_glContext = new PrimaryGLContext(canvas, nullptr, GetContextAttributes());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    glContext = m_glContext;
 | 
					    glContext = m_glContext;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -559,9 +559,9 @@ void CubicSDR::OnInitCmdLine(wxCmdLineParser& parser) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
 | 
					bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
 | 
				
			||||||
    wxString *confName = new wxString;
 | 
					    auto *confName = new wxString;
 | 
				
			||||||
    if (parser.Found("c",confName)) {
 | 
					    if (parser.Found("c",confName)) {
 | 
				
			||||||
        if (confName) {
 | 
					        if (!confName->empty()) {
 | 
				
			||||||
            config.setConfigName(confName->ToStdString());
 | 
					            config.setConfigName(confName->ToStdString());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -576,10 +576,10 @@ bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
 | 
				
			|||||||
    useLocalMod.store(true);
 | 
					    useLocalMod.store(true);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxString *modPath = new wxString;
 | 
					    auto *modPath = new wxString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (parser.Found("m",modPath)) {
 | 
					    if (parser.Found("m",modPath)) {
 | 
				
			||||||
        if (modPath) {
 | 
					        if (!modPath->empty()) {
 | 
				
			||||||
            modulePath = modPath->ToStdString();
 | 
					            modulePath = modPath->ToStdString();
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            modulePath = "";
 | 
					            modulePath = "";
 | 
				
			||||||
@ -611,17 +611,17 @@ void CubicSDR::deviceSelector() {
 | 
				
			|||||||
    deviceSelectorDialog->Show();
 | 
					    deviceSelectorDialog->Show();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::addRemote(std::string remoteAddr) {
 | 
					void CubicSDR::addRemote(const std::string& remoteAddr) {
 | 
				
			||||||
    SDREnumerator::addRemote(remoteAddr);
 | 
					    SDREnumerator::addRemote(remoteAddr);
 | 
				
			||||||
    devicesReady.store(false);
 | 
					    devicesReady.store(false);
 | 
				
			||||||
    t_SDREnum = new std::thread(&SDREnumerator::threadMain, sdrEnum);
 | 
					    t_SDREnum = new std::thread(&SDREnumerator::threadMain, sdrEnum);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::removeRemote(std::string remoteAddr) {
 | 
					void CubicSDR::removeRemote(const std::string& remoteAddr) {
 | 
				
			||||||
    SDREnumerator::removeRemote(remoteAddr);
 | 
					    SDREnumerator::removeRemote(remoteAddr);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::sdrThreadNotify(SDRThread::SDRThreadState state, std::string message) {
 | 
					void CubicSDR::sdrThreadNotify(SDRThread::SDRThreadState state, const std::string& message) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(notify_busy);
 | 
					    std::lock_guard < std::mutex > lock(notify_busy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -912,7 +912,7 @@ long long CubicSDR::getSampleRate() {
 | 
				
			|||||||
    return sampleRate;
 | 
					    return sampleRate;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::removeDemodulator(DemodulatorInstancePtr demod) {
 | 
					void CubicSDR::removeDemodulator(const DemodulatorInstancePtr& demod) {
 | 
				
			||||||
    if (!demod) {
 | 
					    if (!demod) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -949,7 +949,7 @@ int CubicSDR::getPPM() {
 | 
				
			|||||||
    return ppm;
 | 
					    return ppm;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode, wxString initString) {
 | 
					void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode, const wxString& initString) {
 | 
				
			||||||
    const wxString demodTitle("Set Demodulator Frequency");
 | 
					    const wxString demodTitle("Set Demodulator Frequency");
 | 
				
			||||||
    const wxString freqTitle("Set Center Frequency");
 | 
					    const wxString freqTitle("Set Center Frequency");
 | 
				
			||||||
    const wxString bwTitle("Modem Bandwidth (150Hz - 500KHz)");
 | 
					    const wxString bwTitle("Modem Bandwidth (150Hz - 500KHz)");
 | 
				
			||||||
@ -976,7 +976,7 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
 | 
				
			|||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case FrequencyDialog::FDIALOG_TARGET_GAIN:
 | 
					        case FrequencyDialog::FDIALOG_TARGET_GAIN:
 | 
				
			||||||
            title = gainTitle;
 | 
					            title = gainTitle;
 | 
				
			||||||
            if (wxGetApp().getActiveGainEntry() == "") {
 | 
					            if (wxGetApp().getActiveGainEntry().empty()) {
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
@ -1005,11 +1005,11 @@ AppFrame *CubicSDR::getAppFrame() {
 | 
				
			|||||||
    return appframe;
 | 
					    return appframe;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::setFrequencySnap(int snap) {
 | 
					void CubicSDR::setFrequencySnap(int snap_in) {
 | 
				
			||||||
    if (snap > 1000000) {
 | 
					    if (snap_in > 1000000) {
 | 
				
			||||||
        snap = 1000000;
 | 
					        snap_in = 1000000;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this->snap = snap;
 | 
					    this->snap = snap_in;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int CubicSDR::getFrequencySnap() {
 | 
					int CubicSDR::getFrequencySnap() {
 | 
				
			||||||
@ -1065,11 +1065,11 @@ bool CubicSDR::getAGCMode() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CubicSDR::setGain(std::string name, float gain_in) {
 | 
					void CubicSDR::setGain(const std::string& name, float gain_in) {
 | 
				
			||||||
    sdrThread->setGain(name,gain_in);
 | 
					    sdrThread->setGain(name,gain_in);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
float CubicSDR::getGain(std::string name) {
 | 
					float CubicSDR::getGain(const std::string& name) {
 | 
				
			||||||
    return sdrThread->getGain(name);
 | 
					    return sdrThread->getGain(name);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -75,14 +75,14 @@ public:
 | 
				
			|||||||
    PrimaryGLContext &GetContext(wxGLCanvas *canvas);
 | 
					    PrimaryGLContext &GetContext(wxGLCanvas *canvas);
 | 
				
			||||||
    wxGLContextAttrs* GetContextAttributes();
 | 
					    wxGLContextAttrs* GetContextAttributes();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual bool OnInit();
 | 
					    bool OnInit() override;
 | 
				
			||||||
    virtual int OnExit();
 | 
					    int OnExit() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual void OnInitCmdLine(wxCmdLineParser& parser);
 | 
					    void OnInitCmdLine(wxCmdLineParser& parser) override;
 | 
				
			||||||
    virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
 | 
					    bool OnCmdLineParsed(wxCmdLineParser& parser) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void deviceSelector();
 | 
					    void deviceSelector();
 | 
				
			||||||
    void sdrThreadNotify(SDRThread::SDRThreadState state, std::string message);
 | 
					    void sdrThreadNotify(SDRThread::SDRThreadState state, const std::string& message);
 | 
				
			||||||
    void sdrEnumThreadNotify(SDREnumerator::SDREnumState state, std::string message);
 | 
					    void sdrEnumThreadNotify(SDREnumerator::SDREnumState state, std::string message);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void setFrequency(long long freq);
 | 
					    void setFrequency(long long freq);
 | 
				
			||||||
@ -128,9 +128,9 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void notifyDemodulatorsChanged();
 | 
					    void notifyDemodulatorsChanged();
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
    void removeDemodulator(DemodulatorInstancePtr demod);
 | 
					    void removeDemodulator(const DemodulatorInstancePtr& demod);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setFrequencySnap(int snap);
 | 
					    void setFrequencySnap(int snap_in);
 | 
				
			||||||
    int getFrequencySnap();
 | 
					    int getFrequencySnap();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    AppConfig *getConfig();
 | 
					    AppConfig *getConfig();
 | 
				
			||||||
@ -139,7 +139,7 @@ public:
 | 
				
			|||||||
    void setPPM(int ppm_in);
 | 
					    void setPPM(int ppm_in);
 | 
				
			||||||
    int getPPM();
 | 
					    int getPPM();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT, wxString initString = "");
 | 
					    void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT, const wxString& initString = "");
 | 
				
			||||||
    void showLabelInput();
 | 
					    void showLabelInput();
 | 
				
			||||||
    AppFrame *getAppFrame();
 | 
					    AppFrame *getAppFrame();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -150,8 +150,8 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void notifyMainUIOfDeviceChange(bool forceRefreshOfGains = false);
 | 
					    void notifyMainUIOfDeviceChange(bool forceRefreshOfGains = false);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void addRemote(std::string remoteAddr);
 | 
					    void addRemote(const std::string& remoteAddr);
 | 
				
			||||||
    void removeRemote(std::string remoteAddr);
 | 
					    void removeRemote(const std::string& remoteAddr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setDeviceSelectorClosed();
 | 
					    void setDeviceSelectorClosed();
 | 
				
			||||||
    void reEnumerateDevices();
 | 
					    void reEnumerateDevices();
 | 
				
			||||||
@ -161,8 +161,8 @@ public:
 | 
				
			|||||||
    void setAGCMode(bool mode);
 | 
					    void setAGCMode(bool mode);
 | 
				
			||||||
    bool getAGCMode();
 | 
					    bool getAGCMode();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setGain(std::string name, float gain_in);
 | 
					    void setGain(const std::string& name, float gain_in);
 | 
				
			||||||
    float getGain(std::string name);
 | 
					    float getGain(const std::string& name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setStreamArgs(SoapySDR::Kwargs streamArgs_in);
 | 
					    void setStreamArgs(SoapySDR::Kwargs streamArgs_in);
 | 
				
			||||||
    void setDeviceArgs(SoapySDR::Kwargs settingArgs_in);
 | 
					    void setDeviceArgs(SoapySDR::Kwargs settingArgs_in);
 | 
				
			||||||
@ -186,7 +186,7 @@ public:
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    int FilterEvent(wxEvent& event);
 | 
					    int FilterEvent(wxEvent& event) override;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    AppFrame *appframe = nullptr;
 | 
					    AppFrame *appframe = nullptr;
 | 
				
			||||||
    AppConfig config;
 | 
					    AppConfig config;
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@ DemodLabelDialog::DemodLabelDialog(wxWindow * parent, wxWindowID id, const wxStr
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    wxString labelStr;
 | 
					    wxString labelStr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //by construction, is allways != nullptr
 | 
					    //by construction, is always != nullptr
 | 
				
			||||||
    activeDemod = demod;
 | 
					    activeDemod = demod;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
    labelStr = activeDemod->getDemodulatorUserLabel();
 | 
					    labelStr = activeDemod->getDemodulatorUserLabel();
 | 
				
			||||||
@ -39,7 +39,7 @@ DemodLabelDialog::DemodLabelDialog(wxWindow * parent, wxWindowID id, const wxStr
 | 
				
			|||||||
    int titleX = this->GetTextExtent(title).GetWidth();
 | 
					    int titleX = this->GetTextExtent(title).GetWidth();
 | 
				
			||||||
    dialogText->SetMinSize(wxSize(max(int(2.0 * titleX), int(2.0 * textCtrlX)), -1));
 | 
					    dialogText->SetMinSize(wxSize(max(int(2.0 * titleX), int(2.0 * textCtrlX)), -1));
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    wxBoxSizer* dialogsizer = new wxBoxSizer(wxALL);
 | 
					    auto* dialogsizer = new wxBoxSizer(wxALL);
 | 
				
			||||||
    dialogsizer->Add(dialogText, wxSizerFlags(1).Expand().Border(wxALL, 5));
 | 
					    dialogsizer->Add(dialogText, wxSizerFlags(1).Expand().Border(wxALL, 5));
 | 
				
			||||||
    SetSizerAndFit(dialogsizer);
 | 
					    SetSizerAndFit(dialogsizer);
 | 
				
			||||||
    Centre();
 | 
					    Centre();
 | 
				
			||||||
 | 
				
			|||||||
@ -25,7 +25,6 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    DemodulatorInstancePtr activeDemod = nullptr;
 | 
					    DemodulatorInstancePtr activeDemod = nullptr;
 | 
				
			||||||
    void OnEnter ( wxCommandEvent &event );
 | 
					 | 
				
			||||||
    void OnChar ( wxKeyEvent &event );
 | 
					    void OnChar ( wxKeyEvent &event );
 | 
				
			||||||
	void OnShow(wxShowEvent &event);
 | 
						void OnShow(wxShowEvent &event);
 | 
				
			||||||
    DECLARE_EVENT_TABLE()
 | 
					    DECLARE_EVENT_TABLE()
 | 
				
			||||||
 | 
				
			|||||||
@ -13,8 +13,8 @@ EVT_CHAR_HOOK(FrequencyDialog::OnChar)
 | 
				
			|||||||
EVT_SHOW(FrequencyDialog::OnShow)
 | 
					EVT_SHOW(FrequencyDialog::OnShow)
 | 
				
			||||||
wxEND_EVENT_TABLE()
 | 
					wxEND_EVENT_TABLE()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstancePtr demod, const wxPoint & position,
 | 
					FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstancePtr demod, const wxPoint & /*position*/,
 | 
				
			||||||
        const wxSize & size, long style, FrequencyDialogTarget targetMode, wxString initString) :
 | 
					        const wxSize & /*size*/, long style, FrequencyDialogTarget targetMode, wxString initString) :
 | 
				
			||||||
        wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, style) {
 | 
					        wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, style) {
 | 
				
			||||||
    wxString freqStr;
 | 
					    wxString freqStr;
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
@ -49,7 +49,7 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (targetMode == FDIALOG_TARGET_GAIN) {
 | 
					    if (targetMode == FDIALOG_TARGET_GAIN) {
 | 
				
			||||||
        if (wxGetApp().getActiveGainEntry() != "") {
 | 
					        if (!wxGetApp().getActiveGainEntry().empty()) {
 | 
				
			||||||
            freqStr = std::to_string((int)wxGetApp().getGain(wxGetApp().getActiveGainEntry()));
 | 
					            freqStr = std::to_string((int)wxGetApp().getGain(wxGetApp().getActiveGainEntry()));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -63,17 +63,17 @@ FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxStrin
 | 
				
			|||||||
    int titleX = this->GetTextExtent(title).GetWidth();
 | 
					    int titleX = this->GetTextExtent(title).GetWidth();
 | 
				
			||||||
    dialogText->SetMinSize(wxSize(max(int(2.0 * titleX), int(2.0 * std::max(textCtrlX, initTextCtrlX))), -1));
 | 
					    dialogText->SetMinSize(wxSize(max(int(2.0 * titleX), int(2.0 * std::max(textCtrlX, initTextCtrlX))), -1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxBoxSizer* dialogsizer = new wxBoxSizer(wxALL);
 | 
					    auto* dialogsizer = new wxBoxSizer(wxALL);
 | 
				
			||||||
    dialogsizer->Add(dialogText, wxSizerFlags(1).Expand().Border(wxALL, 5));
 | 
					    dialogsizer->Add(dialogText, wxSizerFlags(1).Expand().Border(wxALL, 5));
 | 
				
			||||||
    SetSizerAndFit(dialogsizer);
 | 
					    SetSizerAndFit(dialogsizer);
 | 
				
			||||||
    Centre();
 | 
					    Centre();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (initString != "" && initString.length() == 1) {
 | 
					    if (!initString.empty() && initString.length() == 1) {
 | 
				
			||||||
        dialogText->SetValue(initString);
 | 
					        dialogText->SetValue(initString);
 | 
				
			||||||
        dialogText->SetSelection(2, 2);
 | 
					        dialogText->SetSelection(2, 2);
 | 
				
			||||||
        dialogText->SetFocus();
 | 
					        dialogText->SetFocus();
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        if (initString != "") {
 | 
					        if (!initString.empty()) {
 | 
				
			||||||
            dialogText->SetValue(initString);
 | 
					            dialogText->SetValue(initString);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        dialogText->SetSelection(-1, -1);
 | 
					        dialogText->SetSelection(-1, -1);
 | 
				
			||||||
@ -87,7 +87,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
 | 
				
			|||||||
    double dblval;
 | 
					    double dblval;
 | 
				
			||||||
    std::string lastDemodType = activeDemod?activeDemod->getDemodulatorType():wxGetApp().getDemodMgr().getLastDemodulatorType();
 | 
					    std::string lastDemodType = activeDemod?activeDemod->getDemodulatorType():wxGetApp().getDemodMgr().getLastDemodulatorType();
 | 
				
			||||||
    std::string strValue = dialogText->GetValue().ToStdString();
 | 
					    std::string strValue = dialogText->GetValue().ToStdString();
 | 
				
			||||||
    bool ranged = false;
 | 
					    bool ranged;
 | 
				
			||||||
    std::string strValue2;
 | 
					    std::string strValue2;
 | 
				
			||||||
    size_t range_pos;
 | 
					    size_t range_pos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -170,7 +170,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
 | 
				
			|||||||
        if (targetMode == FDIALOG_TARGET_WATERFALL_LPS) {
 | 
					        if (targetMode == FDIALOG_TARGET_WATERFALL_LPS) {
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                freq = std::stoi(strValue);
 | 
					                freq = std::stoi(strValue);
 | 
				
			||||||
            } catch (exception e) {
 | 
					            } catch (const exception &e) {
 | 
				
			||||||
                Close();
 | 
					                Close();
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -185,7 +185,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
 | 
				
			|||||||
        if (targetMode == FDIALOG_TARGET_SPECTRUM_AVG) {
 | 
					        if (targetMode == FDIALOG_TARGET_SPECTRUM_AVG) {
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                dblval = std::stod(strValue);
 | 
					                dblval = std::stod(strValue);
 | 
				
			||||||
            } catch (exception e) {
 | 
					            } catch (const exception &e) {
 | 
				
			||||||
                Close();
 | 
					                Close();
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -201,12 +201,12 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
 | 
				
			|||||||
        if (targetMode == FDIALOG_TARGET_GAIN) {
 | 
					        if (targetMode == FDIALOG_TARGET_GAIN) {
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                freq = std::stoi(strValue);
 | 
					                freq = std::stoi(strValue);
 | 
				
			||||||
            } catch (exception e) {
 | 
					            } catch (const exception &e) {
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            SDRDeviceInfo *devInfo = wxGetApp().getDevice();
 | 
					            SDRDeviceInfo *devInfo = wxGetApp().getDevice();
 | 
				
			||||||
            std::string gainName = wxGetApp().getActiveGainEntry();
 | 
					            std::string gainName = wxGetApp().getActiveGainEntry();
 | 
				
			||||||
            if (gainName == "") {
 | 
					            if (gainName.empty()) {
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            SDRRangeMap gains = devInfo->getGains(SOAPY_SDR_RX, 0);
 | 
					            SDRRangeMap gains = devInfo->getGains(SOAPY_SDR_RX, 0);
 | 
				
			||||||
 | 
				
			|||||||
@ -35,7 +35,6 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    DemodulatorInstancePtr activeDemod;
 | 
					    DemodulatorInstancePtr activeDemod;
 | 
				
			||||||
    void OnEnter ( wxCommandEvent &event );
 | 
					 | 
				
			||||||
    void OnChar ( wxKeyEvent &event );
 | 
					    void OnChar ( wxKeyEvent &event );
 | 
				
			||||||
	void OnShow(wxShowEvent &event);
 | 
						void OnShow(wxShowEvent &event);
 | 
				
			||||||
    FrequencyDialogTarget targetMode;
 | 
					    FrequencyDialogTarget targetMode;
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,6 @@
 | 
				
			|||||||
// SPDX-License-Identifier: GPL-2.0+
 | 
					// SPDX-License-Identifier: GPL-2.0+
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "IOThread.h"
 | 
					#include "IOThread.h"
 | 
				
			||||||
#include <typeinfo>
 | 
					 | 
				
			||||||
#include <memory>
 | 
					#include <memory>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SPIN_WAIT_SLEEP_MS 5
 | 
					#define SPIN_WAIT_SLEEP_MS 5
 | 
				
			||||||
@ -53,51 +52,51 @@ void IOThread::threadMain() {
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
    terminated.store(true);
 | 
					    terminated.store(true);
 | 
				
			||||||
    stopping.store(true);
 | 
					    stopping.store(true);
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::setup() {
 | 
					void IOThread::setup() {
 | 
				
			||||||
    //redefined in subclasses
 | 
					    //redefined in subclasses
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::run() {
 | 
					void IOThread::run() {
 | 
				
			||||||
    //redefined in subclasses
 | 
					    //redefined in subclasses
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::terminate() {
 | 
					void IOThread::terminate() {
 | 
				
			||||||
    stopping.store(true);
 | 
					    stopping.store(true);
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::onBindOutput(std::string /* name */, ThreadQueueBasePtr /* threadQueue */) {
 | 
					void IOThread::onBindOutput(std::string /* name */, ThreadQueueBasePtr /* threadQueue */) {
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::onBindInput(std::string /* name */, ThreadQueueBasePtr /* threadQueue */) {
 | 
					void IOThread::onBindInput(std::string /* name */, ThreadQueueBasePtr /* threadQueue */) {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::setInputQueue(std::string qname, ThreadQueueBasePtr threadQueue) {
 | 
					void IOThread::setInputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue) {
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
					    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
				
			||||||
    input_queues[qname] = threadQueue;
 | 
					    input_queues[qname] = threadQueue;
 | 
				
			||||||
    this->onBindInput(qname, threadQueue);
 | 
					    this->onBindInput(qname, threadQueue);
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ThreadQueueBasePtr IOThread::getInputQueue(std::string qname) {
 | 
					ThreadQueueBasePtr IOThread::getInputQueue(const std::string& qname) {
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
					    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
				
			||||||
    return input_queues[qname];
 | 
					    return input_queues[qname];
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IOThread::setOutputQueue(std::string qname, ThreadQueueBasePtr threadQueue) {
 | 
					void IOThread::setOutputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue) {
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
					    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
				
			||||||
    output_queues[qname] = threadQueue;
 | 
					    output_queues[qname] = threadQueue;
 | 
				
			||||||
    this->onBindOutput(qname, threadQueue);
 | 
					    this->onBindOutput(qname, threadQueue);
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ThreadQueueBasePtr IOThread::getOutputQueue(std::string qname) {
 | 
					ThreadQueueBasePtr IOThread::getOutputQueue(const std::string& qname) {
 | 
				
			||||||
    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
					    std::lock_guard < std::mutex > lock(m_queue_bindings_mutex);
 | 
				
			||||||
    return output_queues[qname];
 | 
					    return output_queues[qname];
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool IOThread::isTerminated(int waitMs) {
 | 
					bool IOThread::isTerminated(int waitMs) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -109,13 +108,12 @@ bool IOThread::isTerminated(int waitMs) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //this is a stupid busy plus sleep loop
 | 
					    //this is a stupid busy plus sleep loop
 | 
				
			||||||
    int nbCyclesToWait = 0;
 | 
					    int nbCyclesToWait;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (waitMs < 0) {
 | 
					    if (waitMs < 0) {
 | 
				
			||||||
        nbCyclesToWait = std::numeric_limits<int>::max();
 | 
					        nbCyclesToWait = std::numeric_limits<int>::max();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        nbCyclesToWait = (waitMs / SPIN_WAIT_SLEEP_MS) + 1;
 | 
					        nbCyclesToWait = (waitMs / SPIN_WAIT_SLEEP_MS) + 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -37,7 +37,7 @@ public:
 | 
				
			|||||||
    PtrType ptr;
 | 
					    PtrType ptr;
 | 
				
			||||||
    int age;
 | 
					    int age;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual ~ReBufferAge() {};
 | 
					    virtual ~ReBufferAge() = default;;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define REBUFFER_GC_LIMIT 100
 | 
					#define REBUFFER_GC_LIMIT 100
 | 
				
			||||||
@ -51,12 +51,10 @@ class ReBuffer {
 | 
				
			|||||||
public:
 | 
					public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//Virtual destructor to assure correct freeing of all descendants.
 | 
						//Virtual destructor to assure correct freeing of all descendants.
 | 
				
			||||||
	virtual ~ReBuffer() {
 | 
						virtual ~ReBuffer() = default;
 | 
				
			||||||
		//nothing
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//constructor
 | 
						//constructor
 | 
				
			||||||
    ReBuffer(std::string bufferId) : bufferId(bufferId) {
 | 
					    explicit ReBuffer(std::string bufferId) : bufferId(bufferId) {
 | 
				
			||||||
		//nothing
 | 
							//nothing
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -187,10 +185,10 @@ public:
 | 
				
			|||||||
    virtual void onBindOutput(std::string name, ThreadQueueBasePtr threadQueue);
 | 
					    virtual void onBindOutput(std::string name, ThreadQueueBasePtr threadQueue);
 | 
				
			||||||
    virtual void onBindInput(std::string name, ThreadQueueBasePtr threadQueue);
 | 
					    virtual void onBindInput(std::string name, ThreadQueueBasePtr threadQueue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setInputQueue(std::string qname, ThreadQueueBasePtr threadQueue);
 | 
					    void setInputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue);
 | 
				
			||||||
    ThreadQueueBasePtr getInputQueue(std::string qname);
 | 
					    ThreadQueueBasePtr getInputQueue(const std::string& qname);
 | 
				
			||||||
    void setOutputQueue(std::string qname, ThreadQueueBasePtr threadQueue);
 | 
					    void setOutputQueue(const std::string& qname, const ThreadQueueBasePtr& threadQueue);
 | 
				
			||||||
    ThreadQueueBasePtr getOutputQueue(std::string qname);
 | 
					    ThreadQueueBasePtr getOutputQueue(const std::string& qname);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
    std::map<std::string, ThreadQueueBasePtr, map_string_less> input_queues;
 | 
					    std::map<std::string, ThreadQueueBasePtr, map_string_less> input_queues;
 | 
				
			||||||
 | 
				
			|||||||
@ -15,13 +15,13 @@ ModemProperties::ModemProperties(wxWindow *parent, wxWindowID winid,
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    this->SetSizer(bSizer);
 | 
					    this->SetSizer(bSizer);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    m_propertyGrid->Connect( wxEVT_PG_ITEM_COLLAPSED, wxPropertyGridEventHandler( ModemProperties::OnCollapse ), NULL, this );
 | 
					    m_propertyGrid->Connect( wxEVT_PG_ITEM_COLLAPSED, wxPropertyGridEventHandler( ModemProperties::OnCollapse ), nullptr, this );
 | 
				
			||||||
    m_propertyGrid->Connect( wxEVT_PG_ITEM_EXPANDED, wxPropertyGridEventHandler( ModemProperties::OnExpand ), NULL, this );
 | 
					    m_propertyGrid->Connect( wxEVT_PG_ITEM_EXPANDED, wxPropertyGridEventHandler( ModemProperties::OnExpand ), nullptr, this );
 | 
				
			||||||
    m_propertyGrid->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( ModemProperties::OnChange ), NULL, this );
 | 
					    m_propertyGrid->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( ModemProperties::OnChange ), nullptr, this );
 | 
				
			||||||
    this->Connect( wxEVT_SHOW, wxShowEventHandler( ModemProperties::OnShow ), NULL, this );
 | 
					    this->Connect( wxEVT_SHOW, wxShowEventHandler( ModemProperties::OnShow ), nullptr, this );
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    this->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( ModemProperties::OnMouseEnter ), NULL, this);
 | 
					    this->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( ModemProperties::OnMouseEnter ), nullptr, this);
 | 
				
			||||||
    this->Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( ModemProperties::OnMouseLeave ), NULL, this);
 | 
					    this->Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( ModemProperties::OnMouseLeave ), nullptr, this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    updateTheme();
 | 
					    updateTheme();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -48,14 +48,12 @@ void ModemProperties::updateTheme() {
 | 
				
			|||||||
    m_propertyGrid->SetLineColour(btn);
 | 
					    m_propertyGrid->SetLineColour(btn);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ModemProperties::~ModemProperties() {
 | 
					ModemProperties::~ModemProperties() = default;
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ModemProperties::initDefaultProperties() {
 | 
					void ModemProperties::initDefaultProperties() {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!audioOutputDevices.size()) {
 | 
					    if (audioOutputDevices.empty()) {
 | 
				
			||||||
        std::vector<string> outputOpts;
 | 
					        std::vector<string> outputOpts;
 | 
				
			||||||
        std::vector<string> outputOptNames;
 | 
					        std::vector<string> outputOptNames;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -63,7 +61,7 @@ void ModemProperties::initDefaultProperties() {
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
        int i = 0;
 | 
					        int i = 0;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        for (auto aDev : audioDevices) {
 | 
					        for (const auto& aDev : audioDevices) {
 | 
				
			||||||
            if (aDev.inputChannels) {
 | 
					            if (aDev.inputChannels) {
 | 
				
			||||||
                audioInputDevices[i] = aDev;
 | 
					                audioInputDevices[i] = aDev;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -76,7 +74,7 @@ void ModemProperties::initDefaultProperties() {
 | 
				
			|||||||
        // int defaultDevice = 0;
 | 
					        // int defaultDevice = 0;
 | 
				
			||||||
        // int dc = 0;
 | 
					        // int dc = 0;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        for (auto mdevices_i : audioOutputDevices) {
 | 
					        for (const auto& mdevices_i : audioOutputDevices) {
 | 
				
			||||||
            outputOpts.push_back(std::to_string(mdevices_i.first));
 | 
					            outputOpts.push_back(std::to_string(mdevices_i.first));
 | 
				
			||||||
            outputOptNames.push_back(mdevices_i.second.name);
 | 
					            outputOptNames.push_back(mdevices_i.second.name);
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
@ -101,7 +99,7 @@ void ModemProperties::initDefaultProperties() {
 | 
				
			|||||||
    defaultProps["._audio_output"] = addArgInfoProperty(m_propertyGrid, outputArg);
 | 
					    defaultProps["._audio_output"] = addArgInfoProperty(m_propertyGrid, outputArg);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ModemProperties::initProperties(ModemArgInfoList newArgs, DemodulatorInstancePtr demodInstance) {
 | 
					void ModemProperties::initProperties(ModemArgInfoList newArgs, const DemodulatorInstancePtr& demodInstance) {
 | 
				
			||||||
    args = newArgs;
 | 
					    args = newArgs;
 | 
				
			||||||
    demodContext = demodInstance;
 | 
					    demodContext = demodInstance;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -142,7 +140,7 @@ wxPGProperty *ModemProperties::addArgInfoProperty(wxPropertyGrid *pg, ModemArgIn
 | 
				
			|||||||
        case ModemArgInfo::INT:
 | 
					        case ModemArgInfo::INT:
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                intVal = std::stoi(arg.value);
 | 
					                intVal = std::stoi(arg.value);
 | 
				
			||||||
            } catch (std::invalid_argument e) {
 | 
					            } catch (const std::invalid_argument &e) {
 | 
				
			||||||
                intVal = 0;
 | 
					                intVal = 0;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            prop = pg->Append( new wxIntProperty(arg.name, wxPG_LABEL, intVal) );
 | 
					            prop = pg->Append( new wxIntProperty(arg.name, wxPG_LABEL, intVal) );
 | 
				
			||||||
@ -154,7 +152,7 @@ wxPGProperty *ModemProperties::addArgInfoProperty(wxPropertyGrid *pg, ModemArgIn
 | 
				
			|||||||
        case ModemArgInfo::FLOAT:
 | 
					        case ModemArgInfo::FLOAT:
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                floatVal = std::stod(arg.value);
 | 
					                floatVal = std::stod(arg.value);
 | 
				
			||||||
            } catch (std::invalid_argument e) {
 | 
					            } catch (const std::invalid_argument &e) {
 | 
				
			||||||
                floatVal = 0;
 | 
					                floatVal = 0;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            prop = pg->Append( new wxFloatProperty(arg.name, wxPG_LABEL, floatVal) );
 | 
					            prop = pg->Append( new wxFloatProperty(arg.name, wxPG_LABEL, floatVal) );
 | 
				
			||||||
@ -167,13 +165,13 @@ wxPGProperty *ModemProperties::addArgInfoProperty(wxPropertyGrid *pg, ModemArgIn
 | 
				
			|||||||
            prop = pg->Append( new wxBoolProperty(arg.name, wxPG_LABEL, (arg.value=="true")) );
 | 
					            prop = pg->Append( new wxBoolProperty(arg.name, wxPG_LABEL, (arg.value=="true")) );
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case ModemArgInfo::STRING:
 | 
					        case ModemArgInfo::STRING:
 | 
				
			||||||
            if (arg.options.size()) {
 | 
					            if (!arg.options.empty()) {
 | 
				
			||||||
                intVal = 0;
 | 
					                intVal = 0;
 | 
				
			||||||
                prop = pg->Append( new wxEnumProperty(arg.name, wxPG_LABEL) );
 | 
					                prop = pg->Append( new wxEnumProperty(arg.name, wxPG_LABEL) );
 | 
				
			||||||
                for (stringIter = arg.options.begin(); stringIter != arg.options.end(); stringIter++) {
 | 
					                for (stringIter = arg.options.begin(); stringIter != arg.options.end(); stringIter++) {
 | 
				
			||||||
                    std::string optName = (*stringIter);
 | 
					                    std::string optName = (*stringIter);
 | 
				
			||||||
                    std::string displayName = optName;
 | 
					                    std::string displayName = optName;
 | 
				
			||||||
                    if (arg.optionNames.size()) {
 | 
					                    if (!arg.optionNames.empty()) {
 | 
				
			||||||
                        displayName = arg.optionNames[intVal];
 | 
					                        displayName = arg.optionNames[intVal];
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
@ -196,14 +194,14 @@ wxPGProperty *ModemProperties::addArgInfoProperty(wxPropertyGrid *pg, ModemArgIn
 | 
				
			|||||||
            break;
 | 
					            break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (prop != NULL) {
 | 
					    if (prop != nullptr) {
 | 
				
			||||||
        prop->SetHelpString(arg.name + ": " + arg.description);
 | 
					        prop->SetHelpString(arg.name + ": " + arg.description);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    return prop;
 | 
					    return prop;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::string ModemProperties::readProperty(std::string key) {
 | 
					std::string ModemProperties::readProperty(const std::string& key) {
 | 
				
			||||||
    int i = 0;
 | 
					    int i = 0;
 | 
				
			||||||
    ModemArgInfoList::const_iterator args_i;
 | 
					    ModemArgInfoList::const_iterator args_i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -212,8 +210,8 @@ std::string ModemProperties::readProperty(std::string key) {
 | 
				
			|||||||
        if (arg.key == key) {
 | 
					        if (arg.key == key) {
 | 
				
			||||||
            wxPGProperty *prop = props[key];
 | 
					            wxPGProperty *prop = props[key];
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            std::string result = "";
 | 
					            std::string result;
 | 
				
			||||||
            if (arg.type == ModemArgInfo::STRING && arg.options.size()) {
 | 
					            if (arg.type == ModemArgInfo::STRING && !arg.options.empty()) {
 | 
				
			||||||
                return arg.options[prop->GetChoiceSelection()];
 | 
					                return arg.options[prop->GetChoiceSelection()];
 | 
				
			||||||
            } else if (arg.type == ModemArgInfo::BOOL) {
 | 
					            } else if (arg.type == ModemArgInfo::BOOL) {
 | 
				
			||||||
                return (prop->GetValueAsString()=="True")?"true":"false";
 | 
					                return (prop->GetValueAsString()=="True")?"true":"false";
 | 
				
			||||||
@ -241,7 +239,7 @@ void ModemProperties::OnChange(wxPropertyGridEvent &event) {
 | 
				
			|||||||
        if (demodContext) {
 | 
					        if (demodContext) {
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                demodContext->setOutputDevice(std::stoi(outputArg.value));
 | 
					                demodContext->setOutputDevice(std::stoi(outputArg.value));
 | 
				
			||||||
            } catch (exception e) {
 | 
					            } catch (const exception &e) {
 | 
				
			||||||
                // .. this should never happen ;)
 | 
					                // .. this should never happen ;)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -292,7 +290,7 @@ void ModemProperties::setCollapsed(bool state) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool ModemProperties::isCollapsed() {
 | 
					bool ModemProperties::isCollapsed() const {
 | 
				
			||||||
    return collapsed;
 | 
					    return collapsed;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class ModemProperties : public wxPanel {
 | 
					class ModemProperties : public wxPanel {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    ModemProperties(
 | 
					    explicit ModemProperties(
 | 
				
			||||||
        wxWindow *parent,
 | 
					        wxWindow *parent,
 | 
				
			||||||
        wxWindowID winid = wxID_ANY,
 | 
					        wxWindowID winid = wxID_ANY,
 | 
				
			||||||
        const wxPoint& pos = wxDefaultPosition,
 | 
					        const wxPoint& pos = wxDefaultPosition,
 | 
				
			||||||
@ -21,20 +21,20 @@ public:
 | 
				
			|||||||
        long style = wxTAB_TRAVERSAL | wxNO_BORDER,
 | 
					        long style = wxTAB_TRAVERSAL | wxNO_BORDER,
 | 
				
			||||||
        const wxString& name = wxPanelNameStr
 | 
					        const wxString& name = wxPanelNameStr
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    ~ModemProperties();
 | 
					    ~ModemProperties() override;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void initDefaultProperties();
 | 
					    void initDefaultProperties();
 | 
				
			||||||
    void initProperties(ModemArgInfoList newArgs, DemodulatorInstancePtr demodInstance);
 | 
					    void initProperties(ModemArgInfoList newArgs, const DemodulatorInstancePtr& demodInstance);
 | 
				
			||||||
    bool isMouseInView();
 | 
					    bool isMouseInView();
 | 
				
			||||||
    void setCollapsed(bool state);
 | 
					    void setCollapsed(bool state);
 | 
				
			||||||
    bool isCollapsed();
 | 
					    bool isCollapsed() const;
 | 
				
			||||||
    void fitColumns();
 | 
					    void fitColumns();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    void updateTheme();
 | 
					    void updateTheme();
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    wxPGProperty *addArgInfoProperty(wxPropertyGrid *pg, ModemArgInfo arg);
 | 
					    wxPGProperty *addArgInfoProperty(wxPropertyGrid *pg, ModemArgInfo arg);
 | 
				
			||||||
    std::string readProperty(std::string);
 | 
					    std::string readProperty(const std::string&);
 | 
				
			||||||
    void OnChange(wxPropertyGridEvent &event);
 | 
					    void OnChange(wxPropertyGridEvent &event);
 | 
				
			||||||
    void OnShow(wxShowEvent &event);
 | 
					    void OnShow(wxShowEvent &event);
 | 
				
			||||||
    void OnCollapse(wxPropertyGridEvent &event);
 | 
					    void OnCollapse(wxPropertyGridEvent &event);
 | 
				
			||||||
 | 
				
			|||||||
@ -45,7 +45,7 @@ void SessionMgr::saveSession(std::string fileName) {
 | 
				
			|||||||
    s.SaveToFileXML(fileName);
 | 
					    s.SaveToFileXML(fileName);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool SessionMgr::loadSession(std::string fileName) {
 | 
					bool SessionMgr::loadSession(const std::string& fileName) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DataTree l;
 | 
					    DataTree l;
 | 
				
			||||||
    if (!l.LoadFromFileXML(fileName)) {
 | 
					    if (!l.LoadFromFileXML(fileName)) {
 | 
				
			||||||
@ -88,7 +88,7 @@ bool SessionMgr::loadSession(std::string fileName) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (header->hasAnother("sample_rate")) {
 | 
					        if (header->hasAnother("sample_rate")) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            long sample_rate = *header->getNext("sample_rate");
 | 
					            long sample_rate = (long)*header->getNext("sample_rate");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            SDRDeviceInfo *dev = wxGetApp().getSDRThread()->getDevice();
 | 
					            SDRDeviceInfo *dev = wxGetApp().getSDRThread()->getDevice();
 | 
				
			||||||
            if (dev) {
 | 
					            if (dev) {
 | 
				
			||||||
@ -120,7 +120,7 @@ bool SessionMgr::loadSession(std::string fileName) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (header->hasAnother("solo_mode")) {
 | 
					        if (header->hasAnother("solo_mode")) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int solo_mode_activated = *header->getNext("solo_mode");
 | 
					            int solo_mode_activated = (int)*header->getNext("solo_mode");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            wxGetApp().setSoloMode(solo_mode_activated > 0);
 | 
					            wxGetApp().setSoloMode(solo_mode_activated > 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -162,7 +162,7 @@ bool SessionMgr::loadSession(std::string fileName) {
 | 
				
			|||||||
        } // if l.rootNode()->hasAnother("demodulators")
 | 
					        } // if l.rootNode()->hasAnother("demodulators")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (header->hasAnother("center_freq")) {
 | 
					        if (header->hasAnother("center_freq")) {
 | 
				
			||||||
            long long center_freq = *header->getNext("center_freq");
 | 
					            long long center_freq = (long long)*header->getNext("center_freq");
 | 
				
			||||||
            wxGetApp().setFrequency(center_freq);
 | 
					            wxGetApp().setFrequency(center_freq);
 | 
				
			||||||
            //            std::cout << "\tCenter Frequency: " << center_freq << std::endl;
 | 
					            //            std::cout << "\tCenter Frequency: " << center_freq << std::endl;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -171,8 +171,8 @@ bool SessionMgr::loadSession(std::string fileName) {
 | 
				
			|||||||
            DataNode *viewState = header->getNext("view_state");
 | 
					            DataNode *viewState = header->getNext("view_state");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (viewState->hasAnother("center_freq") && viewState->hasAnother("bandwidth")) {
 | 
					            if (viewState->hasAnother("center_freq") && viewState->hasAnother("bandwidth")) {
 | 
				
			||||||
                long long center_freq = *viewState->getNext("center_freq");
 | 
					                auto center_freq = (long long)*viewState->getNext("center_freq");
 | 
				
			||||||
                int bandwidth = *viewState->getNext("bandwidth");
 | 
					                auto bandwidth = (int)*viewState->getNext("bandwidth");
 | 
				
			||||||
                spectrumCanvas->setView(center_freq, bandwidth);
 | 
					                spectrumCanvas->setView(center_freq, bandwidth);
 | 
				
			||||||
                waterfallCanvas->setView(center_freq, bandwidth);
 | 
					                waterfallCanvas->setView(center_freq, bandwidth);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
@ -10,5 +10,5 @@
 | 
				
			|||||||
class SessionMgr {
 | 
					class SessionMgr {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    void saveSession(std::string fileName);
 | 
					    void saveSession(std::string fileName);
 | 
				
			||||||
    bool loadSession(std::string fileName);
 | 
					    bool loadSession(const std::string& fileName);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user