examples : add "simple-rx" example + minor clean-up

This commit is contained in:
Georgi Gerganov
2020-12-19 11:26:36 +02:00
parent 9edc4d8239
commit 174b6872e8
9 changed files with 64 additions and 22 deletions

View File

@@ -0,0 +1,30 @@
#include "ggwave/ggwave.h"
#include "ggwave-common.h"
#include "ggwave-common-sdl2.h"
#include <cstdio>
#include <thread>
int main(int argc, char** argv) {
printf("Usage: %s [-cN]\n", argv[0]);
printf(" -cN - select capture device N\n");
printf("\n");
auto argm = parseCmdArguments(argc, argv);
int captureId = argm["c"].empty() ? 0 : std::stoi(argm["c"]);
if (GGWave_init(0, captureId) == false) {
fprintf(stderr, "Failed to initialize GGWave\n");
return -1;
}
while (true) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
GGWave_mainLoop();
}
GGWave_deinit();
return 0;
}