More fixes to wfù

This commit is contained in:
Ryzerth 2021-04-18 00:47:23 +02:00
parent 5aa9359236
commit 91176c9291
2 changed files with 27 additions and 26 deletions

View File

@ -103,10 +103,9 @@ namespace dsp {
return -1; return -1;
} }
generic_block<PolyphaseResampler<T>>::ctrlMtx.lock(); {
std::lock_guard<std::mutex> lck(ctrlMtx);
int outCount = calcOutSize(count); int outCount = calcOutSize(count);
memcpy(&buffer[tapsPerPhase], _in->readBuf, count * sizeof(T)); memcpy(&buffer[tapsPerPhase], _in->readBuf, count * sizeof(T));
_in->flush(); _in->flush();
@ -127,11 +126,12 @@ namespace dsp {
outIndex++; outIndex++;
} }
} }
if (!out.swap(outCount)) { return -1; } if (!out.swap(outCount)) {
return -1;
}
memmove(buffer, &buffer[count], tapsPerPhase * sizeof(T)); memmove(buffer, &buffer[count], tapsPerPhase * sizeof(T));
}
generic_block<PolyphaseResampler<T>>::ctrlMtx.unlock();
return count; return count;
} }

View File

@ -317,7 +317,8 @@ namespace ImGui {
// If a vfo border is selected, resize VFO accordingly // If a vfo border is selected, resize VFO accordingly
if (vfoBorderSelect) { if (vfoBorderSelect) {
double dist = fabsf(mousePos.x - relatedVfo->lineMin.x); double dist = (relatedVfo->reference == REF_CENTER) ? fabsf(mousePos.x - relatedVfo->lineMin.x) : (mousePos.x - relatedVfo->lineMin.x);
if (relatedVfo->reference == REF_UPPER) { dist = -dist; }
double hzDist = dist * (viewBandwidth / (double)dataWidth); double hzDist = dist * (viewBandwidth / (double)dataWidth);
if (relatedVfo->reference == REF_CENTER) { if (relatedVfo->reference == REF_CENTER) {
hzDist *= 2.0; hzDist *= 2.0;