aboutsummaryrefslogtreecommitdiffstats
path: root/src/lyrics_hd.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-16 19:11:40 +0200
committerMax Kellermann <max@duempel.org>2008-09-16 19:11:40 +0200
commitf41b9942af7278ab67dc799ad6c17ad74dc0aa1b (patch)
tree69c7c715ff3abd78bb26a7a4d80dd1da5fd5c08b /src/lyrics_hd.c
parent4d01c183b4c1e4c51dff3d9aeec1c01ce13a4323 (diff)
downloadmpd-f41b9942af7278ab67dc799ad6c17ad74dc0aa1b.tar.gz
mpd-f41b9942af7278ab67dc799ad6c17ad74dc0aa1b.tar.xz
mpd-f41b9942af7278ab67dc799ad6c17ad74dc0aa1b.zip
lyrics: converted in-process plugins to external programs
In-process plugins are very problematic. It is much easier and flexible to move the lyrics plugins to external programs, with a trivial protocol. This is work in progress, among the things missing: - protocol specification, including exit codes - plugin installation - plugin search directory - run-time configuration (currently hard coded) - automatic polling (using glib's main loop?) - better and more robust error handling
Diffstat (limited to '')
-rw-r--r--src/lyrics_hd.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/lyrics_hd.c b/src/lyrics_hd.c
deleted file mode 100644
index e7acfc252..000000000
--- a/src/lyrics_hd.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "src_lyrics.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-
-char *check_lyr_hd(char *artist, char *title, int how)
-{ //checking whether for lyrics file existence and proper access
- result |= 2;
- static char path[1024];
- snprintf(path, 1024, "%s/.lyrics/%s/%s.lyric",
- getenv("HOME"), artist, title);
-
- if(g_access(path, how) != 0) return NULL;
- return path;
-}
-
-
-int get_lyr_hd(char *artist, char *title)
-{
- char *path = check_lyr_hd(artist, title, R_OK);
- if(path == NULL) return -1;
-
- FILE *lyr_file;
- lyr_file = fopen(path, "r");
- if(lyr_file == NULL) return -1;
- result |= 4;
- char *buf = NULL;
- char **line = &buf;
- size_t n = 0;
-
- while(1)
- {
- n = getline(line, &n, lyr_file);
- if( n < 1 || *line == NULL || feof(lyr_file) != 0 ) return 0;
- add_text_line(&lyr_text, *line, n);
- free(*line);
- *line = NULL; n = 0;
- }
-
- return 0;
-}
-
-int register_lyr_hd (src_lyr *source_descriptor)
-{
- source_descriptor->check_lyr = check_lyr_hd;
- source_descriptor->get_lyr = get_lyr_hd;
-
- source_descriptor->name = "Harddisk";
- source_descriptor->description = "";
-}