本文整理汇总了C++中Query::callback方法的典型用法代码示例。如果您正苦于以下问题:C++ Query::callback方法的具体用法?C++ Query::callback怎么用?C++ Query::callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::callback方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: biography_callback
static void biography_callback(const GEADAsyncHandler *handle, GEADStatus status, gpointer user_data)
{
Query *q = (Query *)user_data;
GList *list = NULL;
if(status == GEAD_PROGRESS) return;
if(status == GEAD_DONE)
{
goffset size=0;
const gchar *data = gmpc_easy_handler_get_data(handle, &size);
char* url = __lastfm_art_xml_get_artist_bio(data, size);
if(url)
{
MetaData *mtd = meta_data_new();
mtd->type = META_ARTIST_TXT;
mtd->plugin_name = lastfm_plugin.name;
mtd->content_type = META_DATA_CONTENT_HTML;
mtd->content = url;
mtd->size = -1;
list = g_list_append(list, mtd);
}
}
q->callback(list, q->user_data);
g_slice_free(Query, q);
}
示例2: album_info_callback
static void album_info_callback(const GEADAsyncHandler *handle,
GEADStatus status, gpointer user_data)
{
Query *q = (Query *)user_data;
GList *list = NULL;
if(status == GEAD_PROGRESS) return;
if(status == GEAD_DONE)
{
goffset size=0;
const gchar* data = gmpc_easy_handler_get_data(handle, &size);
list = __lastfm_art_xml_get_album_info(data, size);
}
q->callback(list, q->user_data);
g_slice_free(Query, q);
}
示例3: similar_artist_callback
/**
* Similar artist
*/
static void similar_artist_callback(const GEADAsyncHandler *handle, GEADStatus status, gpointer user_data)
{
Query *q = (Query *)user_data;
GList *list = NULL;
if(status == GEAD_PROGRESS) return;
if(status == GEAD_DONE)
{
goffset size=0;
const gchar* data = gmpc_easy_handler_get_data(handle, &size);
MetaData *mtd = __lastfm_art_xml_get_artist_similar(data, size);
if(mtd){
list = g_list_append(list, mtd);
}
}
q->callback(list, q->user_data);
g_slice_free(Query, q);
}