diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-09 17:08:11 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-09 17:08:11 +0100 |
commit | da9af1db7efaa9e6ebca68db76e1c10956f777ba (patch) | |
tree | eca3453e1257e5cc3e7c0688481e854adeb40de1 | |
parent | dc255f983cca59d605c60d3f2b3b2d39deb9e6e0 (diff) |
gtkui: added API for accessing album covers from widget plugins
-rw-r--r-- | plugins/gtkui/gtkui.c | 2 | ||||
-rw-r--r-- | plugins/gtkui/gtkui_api.h | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 14ddf57d..449fd281 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -1663,4 +1663,6 @@ static ddb_gtkui_t plugin = { .w_replace = w_replace, .w_remove = w_remove, .create_pltmenu = gtkui_create_pltmenu, + .get_cover_art_pixbuf = get_cover_art_callb, + .cover_get_default_pixbuf = cover_get_default_pixbuf, }; diff --git a/plugins/gtkui/gtkui_api.h b/plugins/gtkui/gtkui_api.h index e57d99a3..c8057339 100644 --- a/plugins/gtkui/gtkui_api.h +++ b/plugins/gtkui/gtkui_api.h @@ -191,5 +191,16 @@ typedef struct { // function to create the standard playlist context menu (the same as // appears when right-clicked on playlist tab) GtkWidget* (*create_pltmenu) (int plt_idx); + + // get_cover_art_pixbuf will return pixbuf, if available. + // if not available, the requested cover will be loaded asyncronously. + // the callback will be called when the requested cover is available, + // in which case you will need to call the get_cover_art_pixbuf again from + // the callback. + GdkPixbuf *(*get_cover_art_pixbuf) (const char *uri, const char *artist, const char *album, int size, void (*callback)(void *user_data), void *user_data); + + // get_default_cover_pixbuf returns the default cover art image + GdkPixbuf *(*cover_get_default_pixbuf) (void); } ddb_gtkui_t; + #endif |