aboutsummaryrefslogtreecommitdiffstats
path: root/src/lyrics.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-23 12:08:53 +0200
committerMax Kellermann <max@duempel.org>2008-09-23 12:08:53 +0200
commita03216c4dd0d06da63a5040bbb1dce9212fc0271 (patch)
tree2b3b44fceacbce2f8ac59a2c18c446d8963ed4c8 /src/lyrics.h
parent20e286dd6ccd108b1d1a41169059d0db8022b158 (diff)
downloadmpd-a03216c4dd0d06da63a5040bbb1dce9212fc0271.tar.gz
mpd-a03216c4dd0d06da63a5040bbb1dce9212fc0271.tar.xz
mpd-a03216c4dd0d06da63a5040bbb1dce9212fc0271.zip
lyrics: added callback
Instead of letting our caller poll lyrics_result(), call it back as soon as we have the result.
Diffstat (limited to '')
-rw-r--r--src/lyrics.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/lyrics.h b/src/lyrics.h
index 34380c344..613ccb338 100644
--- a/src/lyrics.h
+++ b/src/lyrics.h
@@ -21,11 +21,7 @@
#include <glib.h>
-enum lyrics_loader_result {
- LYRICS_SUCCESS,
- LYRICS_BUSY,
- LYRICS_FAILED
-};
+typedef void (*lyrics_callback_t)(const GString *result, void *data);
struct lyrics_loader;
@@ -34,15 +30,10 @@ void lyrics_init(void);
void lyrics_deinit(void);
struct lyrics_loader *
-lyrics_load(const char *artist, const char *title);
+lyrics_load(const char *artist, const char *title,
+ lyrics_callback_t callback, void *callback_data);
void
lyrics_free(struct lyrics_loader *loader);
-enum lyrics_loader_result
-lyrics_result(struct lyrics_loader *loader);
-
-const GString *
-lyrics_get(struct lyrics_loader *loader);
-
#endif