Functions¶
|
|
|
|
|
|
|
|
|
Details¶
- GrlPls.browse(source, playlist, keys, options, filter_func, callback, *user_data)¶
- Parameters:
source (
Grl.Source
) – a sourceplaylist (
Grl.Media
) – a playlistoptions (
Grl.OperationOptions
) – options wanted for that operationfilter_func (
GrlPls.FilterFunc
orNone
) – A filter function, orNone
callback (
Grl.SourceResultCb
) – the user defined callbackuser_data (
object
orNone
) – the user data to pass in the callback
- Returns:
the operation identifier
- Return type:
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 ofGrl.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:
source (
Grl.Source
) – a sourcefilter_func (
GrlPls.FilterFunc
orNone
) – A filter function, orNone
bs (
Grl.SourceBrowseSpec
) – aGrl.SourceBrowseSpec
structure with details of the browsing operation
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 theGrl.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
() andGrl.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:
source (
Grl.Source
) – a sourceplaylist (
Grl.Media
) – a playlistoptions (
Grl.OperationOptions
) – options wanted for that operationfilter_func (
GrlPls.FilterFunc
orNone
) – A filter function, orNone
- Raises:
- Returns:
a
GLib.List
withGrl.Media
elements. After useGObject.Object.unref
() every element and g_list_free() the list.- Return type:
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 ofGrl.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:
content (
Grl.Media
) – an existingGrl.Media
for the file, orNone
file (
Gio.File
) – aGio.File
pointing to the file or directory in questioninfo (
Gio.FileInfo
) – an existingGio.FileInfo
, orNone
handle_pls (
bool
) – Whether playlists should be handled as containersoptions (
Grl.OperationOptions
) – aGrl.OperationOptions
representing the options to apply to this operation.
- Returns:
a new
Grl.Media
.- Return type:
This function will update (if content is non-
None
) or create aGrl.Media
and populate it with information from info.If info is
None
, a call toGio.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:
Returns the list of attributes to pass to
Gio.File.query_info
() to make it possible to populate aGrl.Media
usingGrlPls.file_to_media
().Do not free the result of this function.
New in version 0.2.0.