Multiple

Multiple — Search in multiple loaded sources

Synopsis

#include <grilo.h>

guint               grl_multiple_search                 (const GList *sources,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);
GList *             grl_multiple_search_sync            (const GList *sources,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);
void                grl_multiple_get_media_from_uri     (const gchar *uri,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceMetadataCb callback,
                                                         gpointer user_data);

Description

These helper functions are due to ease the search in multiple sources. You can specify the list of sources to use for the searching. Those sources must have enabled the search capability.

Also you can set NULL that sources list, so the function will use all the available sources with the search capability.

Details

grl_multiple_search ()

guint               grl_multiple_search                 (const GList *sources,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);

Search for text in all the sources specified in sources.

If text is NULL then NULL-text searchs will be used for each searchable plugin (see grl_media_source_search for more details).

This method is asynchronous.

sources :

a GList of GrlMediaSources to search from (NULL for all searchable sources). [element-type Grl.MediaSource][allow-none]

text :

the text to search for

keys :

the GList of GrlKeyID to retrieve. [element-type GObject.ParamSpec]

count :

the maximum number of elements to retrieve

flags :

the operation flags

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass to the user callback

Returns :

the operation identifier

Since 0.1.6


grl_multiple_search_sync ()

GList *             grl_multiple_search_sync            (const GList *sources,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);

Search for text in all the sources specified in sources.

This method is synchronous.

sources :

a GList of GrlMediaSources where to search from (NULL for all available sources with search capability). [element-type Grl.MediaSource][allow-none]

text :

the text to search for

keys :

the GList of GrlKeyID to retrieve. [element-type GObject.ParamSpec]

count :

the maximum number of elements to retrieve

flags :

the operation flags

error :

a GError, or NULL

Returns :

a list with GrlMedia elements. [element-type Grl.Media][transfer full]

Since 0.1.6


grl_multiple_get_media_from_uri ()

void                grl_multiple_get_media_from_uri     (const gchar *uri,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceMetadataCb callback,
                                                         gpointer user_data);

Goes though all available media sources until it finds one capable of constructing a GrlMedia object representing the media resource exposed by uri.

This method is asynchronous.

uri :

A URI that can be used to identify a media resource

keys :

List of metadata keys we want to obtain. [element-type GrlKeyID]

flags :

the operation flags

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass to the user callback

Since 0.1.7

See Also

GrlMediaPlugin, GrlMetadataSource, GrlMediaSource