mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-26 19:08:30 +01:00
Fixed delete[] in soapy.h
This commit is contained in:
parent
03dc5d2042
commit
b2191c5d2c
@ -70,13 +70,8 @@ void saveCurrentSource() {
|
|||||||
void loadSourceConfig(std::string name) {
|
void loadSourceConfig(std::string name) {
|
||||||
json sourceSettings = config::config["sourceSettings"][name];
|
json sourceSettings = config::config["sourceSettings"][name];
|
||||||
|
|
||||||
// Set sample rate
|
|
||||||
|
|
||||||
spdlog::warn("Type {0}", sourceSettings.contains("sampleRate"));
|
|
||||||
|
|
||||||
sampleRate = sourceSettings["sampleRate"];
|
sampleRate = sourceSettings["sampleRate"];
|
||||||
|
|
||||||
|
|
||||||
auto _srIt = std::find(soapy.sampleRates.begin(), soapy.sampleRates.end(), sampleRate);
|
auto _srIt = std::find(soapy.sampleRates.begin(), soapy.sampleRates.end(), sampleRate);
|
||||||
// If the sample rate isn't valid, set to minimum
|
// If the sample rate isn't valid, set to minimum
|
||||||
if (_srIt == soapy.sampleRates.end()) {
|
if (_srIt == soapy.sampleRates.end()) {
|
||||||
@ -90,7 +85,7 @@ void loadSourceConfig(std::string name) {
|
|||||||
soapy.setSampleRate(sampleRate);
|
soapy.setSampleRate(sampleRate);
|
||||||
|
|
||||||
// Set gains
|
// Set gains
|
||||||
delete uiGains;
|
delete[] uiGains;
|
||||||
uiGains = new float[soapy.gainList.size()];
|
uiGains = new float[soapy.gainList.size()];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (std::string gainName : soapy.gainList) {
|
for (std::string gainName : soapy.gainList) {
|
||||||
@ -531,8 +526,15 @@ void drawWindow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
bool noDevice = (soapy.devList.size() == 0);
|
||||||
if (ImGui::Button("Refresh", ImVec2(menuColumnWidth - ImGui::GetCursorPosX(), 0.0f))) {
|
if (ImGui::Button("Refresh", ImVec2(menuColumnWidth - ImGui::GetCursorPosX(), 0.0f))) {
|
||||||
soapy.refresh();
|
soapy.refresh();
|
||||||
|
if (noDevice && soapy.devList.size() > 0) {
|
||||||
|
soapy.setDevice(soapy.devList[0]);
|
||||||
|
if (config::config["sourceSettings"][soapy.devNameList[0]]) {
|
||||||
|
loadSourceConfig(soapy.devNameList[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playing) { style::endDisabled(); };
|
if (playing) { style::endDisabled(); };
|
||||||
@ -563,10 +565,6 @@ void drawWindow() {
|
|||||||
config::configModified = true;
|
config::configModified = true;
|
||||||
}
|
}
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
if (uiGains[i] != soapy.currentGains[i]) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
Loading…
Reference in New Issue
Block a user