Waver v1.4.0 (#23)

* waver : change default protocol

* waver : global scale to 1.25

* waver : more colors

* waver : resend last message

* waver : bigger send button

* waver : start with fixed-length enabled

* waver : fix spectrum display for fixed-length mode

* waver : add option to control input sample rate offset

* ggwave : improve fixed-length decoding

* examples-common : SDL now captures 1024 samples instead of 4096

* waver : spectrum improvements + spectrogram mode

* minor changes

* ggwave : add FFT static method

* waver : realtime spectrum display

* waver : fix dragging behavior

* waver : show current tx protocol in "Messages"

* waver : show frequency range and bandwidth of selected protocol

* waver : change sample rate offset function

output instead of input

* waver : add info about local peers

* waver : add option to pause spectrum by clicking it

* waver : minor

* waver : add option descriptions

* waver : fix data races

* waver : purple-ish background

* waver : cian-ish background

* waver : add option button to cancel receiving

* waver : add option to select Rx Protocols

* waver : change default protocol

* waver : fix displayed protocol for each message
This commit is contained in:
Georgi Gerganov
2021-02-27 11:45:01 +02:00
committed by GitHub
parent 553b414929
commit 5b5293d764
6 changed files with 693 additions and 204 deletions

View File

@@ -164,7 +164,7 @@ bool GGWave_init(
captureSpec = g_obtainedSpecOut;
captureSpec.freq = GGWave::kBaseSampleRate + sampleRateOffset;
captureSpec.format = AUDIO_F32SYS;
captureSpec.samples = 4096;
captureSpec.samples = 1024;
SDL_zero(g_obtainedSpecInp);
@@ -228,7 +228,7 @@ bool GGWave_init(
return true;
}
GGWave * GGWave_instance() { return g_ggWave; }
GGWave *& GGWave_instance() { return g_ggWave; }
bool GGWave_mainLoop() {
if (g_devIdInp == 0 && g_devIdOut == 0) {

View File

@@ -8,6 +8,6 @@ class GGWave;
void GGWave_setDefaultCaptureDeviceName(std::string name);
bool GGWave_init(const int playbackId, const int captureId, const int payloadLength = -1, const int sampleRateOffset = 0);
GGWave * GGWave_instance();
GGWave *& GGWave_instance();
bool GGWave_mainLoop();
bool GGWave_deinit();

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,8 @@
#include <vector>
#include <functional>
const float kGlobalImGuiScale = 1.25f;
// ImGui helpers
bool ImGui_tryLoadFont(const std::string & filename, float size = 14.0f, bool merge = false) {
@@ -106,7 +108,7 @@ bool ImGui_SetStyle() {
style.Colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.24f, 0.41f, 0.41f, 1.00f);
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.11f, 0.15f, 0.20f, 0.60f);
//style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
style.Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
style.Colors[ImGuiCol_Border] = ImVec4(0.31f, 0.31f, 0.31f, 0.71f);
@@ -148,6 +150,8 @@ bool ImGui_SetStyle() {
style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f);
style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(1.00f, 0.98f, 0.95f, 0.78f);
style.ScaleAllSizes(kGlobalImGuiScale);
return true;
}
@@ -222,13 +226,13 @@ int main(int argc, char** argv) {
ImGui_Init(window, gl_context);
ImGui::GetIO().IniFilename = nullptr;
ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", 14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", 14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", 14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", 14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", 14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", 14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
ImGui_SetStyle();
@@ -300,10 +304,10 @@ int main(int argc, char** argv) {
}
deinitMain();
GGWave_deinit();
worker.join();
GGWave_deinit();
// Cleanup
ImGui_Shutdown();
ImGui::DestroyContext();