commit d9a11a2025312d1ddd19040ce58bf86066a3a6e5
parent 6aceb30069a69d1ea40eb8f756ec44698ed78d4d
Author: Jacob R. Edwards <n/a>
Date: Tue, 27 Dec 2022 13:04:54 -0800
Add more configuration options to config.h
- Move commands from main.c to config.h
- Add 'name' variable (currently for socket path, but it's use may
be expanded in the future)
Diffstat:
2 files changed, 28 insertions(+), 22 deletions(-)
diff --git a/aps/config.h b/aps/config.h
@@ -1,4 +1,29 @@
+/* aps config */
+
+static char *name = NULL;
+
static char *player[] = {
/* The item's path is appended */
"ffplay", "-loglevel", "error", "-nodisp", "-autoexit", NULL
};
+
+static struct command commands[] = {
+ { "add", com_add },
+ { "close", com_close },
+ { "commands", com_commands },
+ { "list", com_list },
+ { "log", com_log },
+ { "name", com_name },
+ { "next", com_next },
+ { "pause", com_pause },
+ { "play", com_play },
+ { "player", com_player },
+ { "previous", com_previous },
+ { "remove", com_remove },
+ { "seek", com_seek },
+ { "status", com_status },
+ { "stop", com_stop },
+ { "terminate", com_terminate },
+ { "toggle", com_toggle },
+ { "truncate", com_truncate }
+};
diff --git a/aps/main.c b/aps/main.c
@@ -32,33 +32,14 @@
#include "aps.h"
#include "command.h"
-#include "config.h"
#include "find.h"
#include "log.h"
#include "queue.h"
#include "util.h"
+#include "config.h"
+
static struct aps *aps;
-static struct command commands[] = {
- { "add", com_add },
- { "close", com_close },
- { "commands", com_commands },
- { "list", com_list },
- { "log", com_log },
- { "name", com_name },
- { "next", com_next },
- { "pause", com_pause },
- { "play", com_play },
- { "player", com_player },
- { "previous", com_previous },
- { "remove", com_remove },
- { "seek", com_seek },
- { "status", com_status },
- { "stop", com_stop },
- { "terminate", com_terminate },
- { "toggle", com_toggle },
- { "truncate", com_truncate }
-};
void
die(char *s)
@@ -120,7 +101,7 @@ main(int argc, char *argv[])
die("pledge");
#endif
- aps = aps_open(NULL, player);
+ aps = aps_open(name, player);
if (aps == NULL)
die("unable to setup server");