diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-20 20:42:52 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-20 20:42:52 +0200 |
commit | 0291837ddd2133cca130a35582273594994f9ba9 (patch) | |
tree | 4b3592ab7da94bcbfc446b1903cb5f2e5d434dca | |
parent | 2d2b889bb25f9db008bdac54babf84c2120d2a45 (diff) |
Read music root path from config.
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | music.c | 10 | ||||
-rw-r--r-- | music.h | 2 |
3 files changed, 10 insertions, 4 deletions
@@ -20,7 +20,7 @@ int main(int argc, char **argv) { conf_load(); - music_init(argv[1]); + music_init(); music_scan_root(); server_start(); @@ -1,13 +1,19 @@ #include "music.h" +#include "conf.h" #include <glib/gstdio.h> #include <string.h> struct directory *music_root = NULL; -gboolean music_init(const gchar *path) { +gboolean music_init() { + gchar *path = conf_get_string("audist", "music_root"); + if(path == NULL) { + g_error("no music_root is set!"); + } + music_root = g_new0(struct directory, 1); - music_root->path = g_strdup(path); + music_root->path = path; g_debug("added music root %s", path); @@ -20,7 +20,7 @@ struct directory { extern struct directory *music_root; -gboolean music_init(const gchar *path); +gboolean music_init(); gboolean music_scan(struct directory *directory); gboolean music_scan_root(); struct directory *music_find_dir(const gchar *path); |