mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-04-20 05:06:32 +08:00
minor
This commit is contained in:
@@ -14,11 +14,7 @@ int main(int argc, char** argv) {
|
|||||||
printf("Usage: %s [-cN] [-pN] [-tN]\n", argv[0]);
|
printf("Usage: %s [-cN] [-pN] [-tN]\n", argv[0]);
|
||||||
printf(" -cN - select capture device N\n");
|
printf(" -cN - select capture device N\n");
|
||||||
printf(" -pN - select playback device N\n");
|
printf(" -pN - select playback device N\n");
|
||||||
printf(" -tN - transmission protocol:\n");
|
printf(" -tN - transmission protocol\n");
|
||||||
printf(" -t0 : Normal\n");
|
|
||||||
printf(" -t1 : Fast (default)\n");
|
|
||||||
printf(" -t2 : Fastest\n");
|
|
||||||
printf(" -t3 : Ultrasonic\n");
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
auto argm = parseCmdArguments(argc, argv);
|
auto argm = parseCmdArguments(argc, argv);
|
||||||
@@ -33,6 +29,16 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
auto ggWave = GGWave_instance();
|
auto ggWave = GGWave_instance();
|
||||||
|
|
||||||
|
printf("Available Tx protocols:\n");
|
||||||
|
for (int i = 0; i < (int) ggWave->getTxProtocols().size(); ++i) {
|
||||||
|
printf(" -t%d : %s\n", i, ggWave->getTxProtocols()[i].name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (txProtocol < 0 || txProtocol > (int) ggWave->getTxProtocols().size()) {
|
||||||
|
fprintf(stderr, "Unknown Tx protocol %d\n", txProtocol);
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
printf("Selecting Tx protocol %d\n", txProtocol);
|
printf("Selecting Tx protocol %d\n", txProtocol);
|
||||||
|
|
||||||
std::mutex mutex;
|
std::mutex mutex;
|
||||||
|
|||||||
@@ -50,17 +50,11 @@ int main(int argc, char** argv) {
|
|||||||
printf("Usage: %s [-cN] [-pN] [-tN]\n", argv[0]);
|
printf("Usage: %s [-cN] [-pN] [-tN]\n", argv[0]);
|
||||||
printf(" -cN - select capture device N\n");
|
printf(" -cN - select capture device N\n");
|
||||||
printf(" -pN - select playback device N\n");
|
printf(" -pN - select playback device N\n");
|
||||||
printf(" -tN - transmission protocol:\n");
|
|
||||||
printf(" -t0 : Normal\n");
|
|
||||||
printf(" -t1 : Fast (default)\n");
|
|
||||||
printf(" -t2 : Fastest\n");
|
|
||||||
printf(" -t3 : Ultrasonic\n");
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
auto argm = parseCmdArguments(argc, argv);
|
auto argm = parseCmdArguments(argc, argv);
|
||||||
int captureId = argm["c"].empty() ? 0 : std::stoi(argm["c"]);
|
int captureId = argm["c"].empty() ? 0 : std::stoi(argm["c"]);
|
||||||
int playbackId = argm["p"].empty() ? 0 : std::stoi(argm["p"]);
|
int playbackId = argm["p"].empty() ? 0 : std::stoi(argm["p"]);
|
||||||
int txProtocol = argm["t"].empty() ? 1 : std::stoi(argm["t"]);
|
|
||||||
|
|
||||||
if (GGWave_init(playbackId, captureId) == false) {
|
if (GGWave_init(playbackId, captureId) == false) {
|
||||||
fprintf(stderr, "Failed to initialize GGWave\n");
|
fprintf(stderr, "Failed to initialize GGWave\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user