ALSA - prefer stereo configuraton if available.

This commit is contained in:
Robin Davies
2024-10-29 05:01:10 -04:00
parent c6b31f9b38
commit 3cf7fba95f
7 changed files with 428 additions and 18 deletions
+39
View File
@@ -0,0 +1,39 @@
#include <alsa/asoundlib.h>
#include <iostream>
#include <vector>
#include <string>
#include "CommandLineParser.hpp"
#include "alsaCheck.hpp"
using namespace std;
using namespace pipedal;
int main(int argc, char* argv[]) {
bool listDevices = false;
try {
CommandLineParser commandLineParser;
std::string device = "";
commandLineParser.AddOption("--list",&listDevices);
commandLineParser.Parse(argc,(const char**)argv);
if (commandLineParser.Arguments().size() >= 1) {
device = commandLineParser.Arguments()[0];
}
if (listDevices || device.empty()) {
list_alsa_devices();
} else {
check_alsa_channel_configs(device.c_str());
}
return EXIT_SUCCESS;
} catch (const std::exception &e)
{
cerr << "Error: " << e.what() << endl;
return EXIT_FAILURE;
}
}