summaryrefslogtreecommitdiff
path: root/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'settings.c')
-rw-r--r--settings.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/settings.c b/settings.c
index 9aa9e6a..b28db6b 100644
--- a/settings.c
+++ b/settings.c
@@ -32,19 +32,30 @@ bool cSettings::processArgs(int argc, char *argv[])
{
static struct option long_options[] = {
{ "firmware-loading", no_argument, NULL, 'f' },
+ { "audio-driver", required_argument, NULL, 'a' },
{ NULL }
};
int c;
- while ((c = getopt_long(argc, argv, "f", long_options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "f:a", long_options, NULL)) != -1) {
switch (c) {
- case 'f':
- dsyslog("[dxr3-settings] enableing automatic firmware loading");
- loadFirmware(true);
- break;
+ case 'f':
+ dsyslog("[dxr3-settings] enableing automatic firmware loading");
+ loadFirmware(true);
+ break;
- default:
- return false;
+ case 'a':
+ if (optarg && strcmp(optarg, "alsa") == 0) {
+ audioDriver(ALSA);
+ } else if (optarg && strcmp(optarg, "oss") == 0) {
+ audioDriver(OSS);
+ } else {
+ esyslog("[dxr3-settings] unkown audio driver - default audio driver will be used");
+ }
+ break;
+
+ default:
+ return false;
}
}
return true;