5 extern gmpcPlugin discogs_plugin
;
6 typedef gpointer _config_obj
;
7 config_obj
*config
= NULL
;
8 GmpcMetaWatcher
*gmw
= NULL
;
9 MpdObj
*connection
= NULL
;
10 void pixbuf_cache_invalidate_pixbuf_entry(const gchar
*url
)
14 void show_error_message(void)
18 void gmpc_meta_watcher_data_changed (GmpcMetaWatcher
* self
, mpd_Song
* song
, MetaDataType type
, MetaDataResult result
, MetaData
* met
)
22 gmpc_meta_watcher_match_data (MetaDataType type
, mpd_Song
* song1
, mpd_Song
* song2
)
26 void playlist3_show_error_message(const char *message
, int el
)
33 int cfg_get_single_value_as_int_with_default(config_obj
*config
, const gchar
*a
, const gchar
*b
, int def
)
37 char * cfg_get_single_value_as_string_with_default(config_obj
*config
, const gchar
*a
, const gchar
*b
, const gchar
* def
)
41 char *cfg_get_single_value_as_string(config_obj
*config
, const gchar
*a
, const gchar
*b
)
45 void cfg_set_single_value_as_string(config_obj
*config
, const gchar
*a
, const gchar
*b
, const gchar
*def
)
49 void cfg_set_single_value_as_int(config_obj
* cfg
, const char *class,
50 const char *key
, int value
)
54 static int queries
= 4;
55 void callback(GList
*list
, gpointer data
)
57 GMainLoop
*lop
= (GMainLoop
*)data
;
58 printf("got result\n");
62 for(iter
= g_list_first(list
); iter
!= NULL
; iter
= g_list_next(iter
))
64 MetaData
*m
= iter
->data
;
65 if(meta_data_is_uri(m
))
67 const char *uri
= meta_data_get_uri(m
);
68 printf("uri: %s\n", uri
);
71 g_list_foreach(list
, meta_data_free
, NULL
);
77 g_idle_add(g_main_loop_quit
,lop
);
81 int main (int argc
, char **argv
)
84 g_type_init_with_debug_flags(G_TYPE_DEBUG_MASK
);
85 if(!g_thread_supported())
87 l
= g_main_loop_new(NULL
, TRUE
);
89 mpd_Song
*song
= mpd_newSong();
90 song
->artist
= g_strdup("Eric Clapton");
91 song
->album
= g_strdup("Unplugged");
92 discogs_plugin
.metadata
->get_metadata(song
, META_ALBUM_ART
, callback
, l
);
93 discogs_plugin
.metadata
->get_metadata(song
, META_ARTIST_ART
, callback
, l
);
96 song
->artist
= g_strdup("Appnottoaf");
97 song
->album
= g_strdup("grabba");
98 discogs_plugin
.metadata
->get_metadata(song
, META_ALBUM_ART
, callback
, l
);
99 discogs_plugin
.metadata
->get_metadata(song
, META_ARTIST_ART
, callback
, l
);
103 gmpc_easy_async_quit();
104 g_main_loop_unref(l
);