From 4e3bdbb0bc8649208400b9eb63751db15bc9bcda Mon Sep 17 00:00:00 2001 From: waker Date: Thu, 14 Apr 2011 20:50:40 +0200 Subject: new event passing system --- plugins/artwork/artwork.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'plugins/artwork') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index b29db8f2..a86b83a7 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -722,7 +722,7 @@ artwork_reset (int fast) { } static int -artwork_on_configchanged (DB_event_t *ev, uintptr_t data) { +artwork_configchanged (void) { int new_artwork_enable_embedded = deadbeef->conf_get_int ("artwork.enable_embedded", 1); int new_artwork_enable_local = deadbeef->conf_get_int ("artwork.enable_localfolder", 1); int new_artwork_enable_lfm = deadbeef->conf_get_int ("artwork.enable_lastfm", 0); @@ -751,6 +751,16 @@ artwork_on_configchanged (DB_event_t *ev, uintptr_t data) { return 0; } +static int +artwork_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { + switch (id) { + case DB_EV_CONFIGCHANGED: + artwork_configchanged (); + break; + } + return 0; +} + static int artwork_plugin_start (void) { @@ -777,8 +787,6 @@ artwork_plugin_start (void) artwork_filemask[sizeof(artwork_filemask)-1] = 0; - deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (artwork_on_configchanged), 0); - mutex = deadbeef->mutex_create_nonrecursive (); imlib_mutex = deadbeef->mutex_create_nonrecursive (); cond = deadbeef->cond_create (); @@ -790,7 +798,6 @@ artwork_plugin_start (void) static int artwork_plugin_stop (void) { - deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (artwork_on_configchanged), 0); if (current_file) { deadbeef->fabort (current_file); } @@ -861,6 +868,7 @@ static DB_artwork_plugin_t plugin = { .plugin.plugin.start = artwork_plugin_start, .plugin.plugin.stop = artwork_plugin_stop, .plugin.plugin.configdialog = settings_dlg, + .plugin.plugin.message = artwork_message, .get_album_art = get_album_art, .reset = artwork_reset, .get_default_cover = get_default_cover, -- cgit v1.2.3