mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-04-20 21:26:30 +08:00
ggwave-gui : update version to 1.0.0
This commit is contained in:
@@ -289,7 +289,7 @@ void renderMain() {
|
|||||||
ImGui::BeginChild("Settings:main", ImGui::GetContentRegionAvail(), true);
|
ImGui::BeginChild("Settings:main", ImGui::GetContentRegionAvail(), true);
|
||||||
ImGui::Text("%s", "");
|
ImGui::Text("%s", "");
|
||||||
ImGui::Text("%s", "");
|
ImGui::Text("%s", "");
|
||||||
ImGui::Text("Waver v0.1");
|
ImGui::Text("Waver v1.0.0");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
ImGui::Text("%s", "");
|
ImGui::Text("%s", "");
|
||||||
|
|||||||
@@ -572,20 +572,20 @@ void GGWave::receive(const CBDequeueAudio & CBDequeueAudio) {
|
|||||||
bool isReceiving = false;
|
bool isReceiving = false;
|
||||||
|
|
||||||
for (const auto & rxProtocol : kTxProtocols) {
|
for (const auto & rxProtocol : kTxProtocols) {
|
||||||
bool isReceivingCur = true;
|
int nDetectedMarkerBits = m_nBitsInMarker;
|
||||||
|
|
||||||
for (int i = 0; i < m_nBitsInMarker; ++i) {
|
for (int i = 0; i < m_nBitsInMarker; ++i) {
|
||||||
double freq = bitFreq(rxProtocol, i);
|
double freq = bitFreq(rxProtocol, i);
|
||||||
int bin = std::round(freq*m_ihzPerSample);
|
int bin = std::round(freq*m_ihzPerSample);
|
||||||
|
|
||||||
if (i%2 == 0) {
|
if (i%2 == 0) {
|
||||||
if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isReceivingCur = false;
|
if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) --nDetectedMarkerBits;
|
||||||
} else {
|
} else {
|
||||||
if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isReceivingCur = false;
|
if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) --nDetectedMarkerBits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isReceivingCur) {
|
if (nDetectedMarkerBits == m_nBitsInMarker) {
|
||||||
m_markerFreqStart = rxProtocol.freqStart;
|
m_markerFreqStart = rxProtocol.freqStart;
|
||||||
isReceiving = true;
|
isReceiving = true;
|
||||||
break;
|
break;
|
||||||
@@ -611,20 +611,20 @@ void GGWave::receive(const CBDequeueAudio & CBDequeueAudio) {
|
|||||||
bool isEnded = false;
|
bool isEnded = false;
|
||||||
|
|
||||||
for (const auto & rxProtocol : kTxProtocols) {
|
for (const auto & rxProtocol : kTxProtocols) {
|
||||||
bool isEndedCur = true;
|
int nDetectedMarkerBits = m_nBitsInMarker;
|
||||||
|
|
||||||
for (int i = 0; i < m_nBitsInMarker; ++i) {
|
for (int i = 0; i < m_nBitsInMarker; ++i) {
|
||||||
double freq = bitFreq(rxProtocol, i);
|
double freq = bitFreq(rxProtocol, i);
|
||||||
int bin = std::round(freq*m_ihzPerSample);
|
int bin = std::round(freq*m_ihzPerSample);
|
||||||
|
|
||||||
if (i%2 == 0) {
|
if (i%2 == 0) {
|
||||||
if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isEndedCur = false;
|
if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) nDetectedMarkerBits--;
|
||||||
} else {
|
} else {
|
||||||
if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isEndedCur = false;
|
if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) nDetectedMarkerBits--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEndedCur) {
|
if (nDetectedMarkerBits == m_nBitsInMarker) {
|
||||||
isEnded = true;
|
isEnded = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user