Multiple: Grilo Reference Manual

## Multiple Multiple — Search in multiple loaded sources |

## Functions

void | grl_multiple_get_media_from_uri ()
guint | grl_multiple_search ()
GList * | grl_multiple_search_sync ()

## Includes

    #include <grilo.h>

## 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.

## Functions

### grl_multiple_get_media_from_uri ()

    void
    grl_multiple_get_media_from_uri (const gchar *uri,
                                     const GList *keys,
                                     GrlOperationOptions *options,
                                     GrlSourceResolveCb 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.

#### Parameters

uri | A URI that can be used to identify a media resource |
keys | List of metadata keys we want to obtain. | [element-type GrlKeyID]
options | options wanted for that operation |
callback | the user defined callback. | [scope notified]
user_data | the user data to pass to the user callback |

Since: 0.2.0

### grl_multiple_search ()

    guint
    grl_multiple_search (const GList *sources,
                         const gchar *text,
                         const GList *keys,
                         GrlOperationOptions *options,
                         GrlSourceResultCb 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_source_search for more details).

This method is asynchronous.

#### Parameters

sources | a GList of GrlSources to search from (`NULL` for all searchable sources). | [element-type GrlSource][allow-none]
text | the text to search for |
keys | the GList of GrlKeyID to retrieve. | [element-type GrlKeyID]
options | options wanted for that operation |
callback | the user defined callback. | [scope notified]
user_data | the user data to pass to the user callback |

#### Returns

the operation identifier

Since: 0.2.0

### grl_multiple_search_sync ()

    GList *
    grl_multiple_search_sync (const GList *sources,
                              const gchar *text,
                              const GList *keys,
                              GrlOperationOptions *options,
                              GError **error);

Search for `text` in all the sources specified in `sources` .

This method is synchronous.

#### Parameters

sources | a GList of GrlSources where to search from (`NULL` for all available sources with search capability). | [element-type GrlSource][allow-none]
text | the text to search for |
keys | the GList of GrlKeyID to retrieve. | [element-type GrlKeyID]
options | options wanted for that operation |
error | a GError, or `NULL` |

#### Returns

a list with GrlMedia elements.

[element-type GrlMedia][transfer full]

Since: 0.2.0

## Types and Values

## See Also

GrlPlugin, GrlSource