Functions

  browse (source, playlist, keys, options, filter_func, callback, *user_data)
  browse_by_spec (source, filter_func, bs)
  browse_sync (source, playlist, keys, options, filter_func)
  file_to_media (content, file, info, handle_pls, options)
  get_file_attributes ()
  media_is_playlist (media)

Details

GrlPls.browse(source, playlist, keys, options, filter_func, callback, *user_data)
Parameters:
Returns:

the operation identifier

Return type:

int

Browse into a playlist. The playlist entries are returned via the callback function as Grl.Media objects. This function imitates the API and way of working of Grl.Source.browse.

The playlist provided could be of any Grl.Media class, as long as its URI points to a valid playlist file.

This function is asynchronous.

See Grl.Source.browse() function for additional information and sample code.

New in version 0.2.0.

GrlPls.browse_by_spec(source, filter_func, bs)
Parameters:

Browse into a playlist. The playlist entries are returned via the bs->callback function as Grl.Media objects. This function is more suitable to be called from plugins, which by design get the Grl.SourceBrowseSpec already filled in.

The bs->playlist provided could be of any Grl.Media class, as long as its URI points to a valid playlist file.

This function is asynchronous.

See GrlPls.browse() and Grl.Source.browse() function for additional information and sample code.

New in version 0.2.0.

GrlPls.browse_sync(source, playlist, keys, options, filter_func)
Parameters:
Raises:

GLib.Error

Returns:

a GLib.List with Grl.Media elements. After use GObject.Object.unref() every element and g_list_free() the list.

Return type:

[Grl.Media]

Browse into a playlist. The playlist entries are returned via the callback function as Grl.Media objects. This function imitates the API and way of working of Grl.Source.browse_sync.

The filter function filter_func will be used for plugins or applications to be able to refuse particular entries from being listed.

If a None filter function is passed, the media will be added with only the metadata coming from the playlist included.

This function is synchronous.

See Grl.Source.browse_sync() function for additional information and sample code.

New in version 0.2.0.

GrlPls.file_to_media(content, file, info, handle_pls, options)
Parameters:
Returns:

a new Grl.Media.

Return type:

Grl.Media

This function will update (if content is non-None) or create a Grl.Media and populate it with information from info.

If info is None, a call to Gio.File.query_info() will be made.

This function is useful for plugins that browse the local filesystem and want to easily create Grl.Media from filesystem information.

New in version 0.2.0.

GrlPls.get_file_attributes()
Returns:a string containing the list of attributes.
Return type:str

Returns the list of attributes to pass to Gio.File.query_info() to make it possible to populate a Grl.Media using GrlPls.file_to_media().

Do not free the result of this function.

New in version 0.2.0.

GrlPls.media_is_playlist(media)
Parameters:media (Grl.Media) – Grl.Media
Returns:True if a Grl.Media is recognized as a playlist.
Return type:bool

Check if a file identified by Grl.Media object is a playlist or not. This function does blocking I/O.

New in version 0.2.0.