Merge volume and build fixes
[disorder] / lib / uaudio-command.c
index b9a1abb..5e4531e 100644 (file)
@@ -34,6 +34,7 @@
 #include "mem.h"
 #include "wstat.h"
 #include "uaudio.h"
+#include "configuration.h"
 
 /** @brief Pipe to subprocess */
 static int command_fd;
@@ -69,7 +70,7 @@ static void command_open(void) {
   int pfd[2];
   const char *command;
 
-  if(!(command = uaudio_get("command")))
+  if(!(command = uaudio_get("command", NULL)))
     fatal(0, "'command' not set");
   xpipe(pfd);
   command_pid = xfork();
@@ -137,13 +138,18 @@ static void command_deactivate(void) {
   uaudio_thread_deactivate();
 }
 
+static void command_configure(void) {
+  uaudio_set("command", config->speaker_command);
+}
+
 const struct uaudio uaudio_command = {
   .name = "command",
   .options = command_options,
   .start = command_start,
   .stop = command_stop,
   .activate = command_activate,
-  .deactivate = command_deactivate
+  .deactivate = command_deactivate,
+  .configure = command_configure,
 };
 
 /*