Sources are extensions, therefore, the first step is to obtain a reference to them
using the framework registry, like this:
MafwProxyRegistry *registry = MAFW_REGISTRY(mafw_registry_get_instance());
if (registry) {
GList *sources = mafw_registry_get_sources(MAFW_REGISTRY(registry));
}
The code above allows the application developer to obtain a list of available
sources. The developer can use this list to show the available sources to the
users, allowing them to select the ones they are interested in.
Once reference to the source we are interested in has been obtained, the developer
can start to use it. The way sources are used is usually this:
- User wants to browse the contents of the source. The
application should browse the root container of the selected source
using mafw_source_browse and show the results to the user. The
application developer should request the metadata MAFW_METADATA_KEY_MIME to
distinguish containers from media items.
- Once users have obtained the results of the browse operation,
they may want to browse one of the containers contained in the
root container, in this case the application should issue a new browse
operation with the Object ID of the selected container,
repeating the process.
- Also, users may want to select browse results and include them
in a playlist to be played later on in a renderer.
- The user can also request more metadata from a specific item
obtained in the browse operation, to do so, the developer should use
mafw_source_get_metadata passing the Object ID of the
selected item.
For more information about the source API, please check
the Mafw API reference.