RB.PlaylistSource

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Box Gtk.Box RB.DisplayPage RB.DisplayPage Gtk.Box->RB.DisplayPage Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container RB.Source RB.Source RB.DisplayPage->RB.Source RB.PlaylistSource RB.PlaylistSource RB.Source->RB.PlaylistSource

Subclasses:

RB.AutoPlaylistSource, RB.StaticPlaylistSource

Methods

Inherited:

RB.Source (33), RB.DisplayPage (12), Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new_from_xml (shell, node)

add_to_map (location)

get_db ()

get_query_model ()

location_in_map (location)

mark_dirty ()

save_playlist (uri, export_type)

save_to_xml (parent_node)

set_query_model (model)

setup_entry_view (entry_view)

Virtual Methods

Inherited:

RB.Source (27), RB.DisplayPage (12), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_mark_dirty ()

do_save_contents_to_xml (node)

do_show_entry_view_popup (view, over_entry)

Properties

Inherited:

RB.Source (10), RB.DisplayPage (5), Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

db

RB.RhythmDB

r

rhythmdb instance

dirty

bool

r

whether this playlist should be saved

is-local

bool

r/w/co

whether this playlist is attached to the local library

Child Properties

Inherited:

Gtk.Box (5)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

RB.Source (3), RB.DisplayPage (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

RB.Source (3), RB.DisplayPage (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent

RB.Source

r

Class Details

class RB.PlaylistSource(*args, **kwargs)
Bases:

RB.Source

Abstract:

Yes

Structure:

RB.PlaylistSourceClass

classmethod new_from_xml(shell, node)
Parameters:
Returns:

the playlist

Return type:

RB.Source

Constructs a playlist source instance from the XML serialized format. This function knows about all the playlist types that can be saved to disk, and it hands off the XML node to the appropriate constructor based on the ‘type’ attribute of the root node of the playlist.

add_to_map(location)
Parameters:

location (str) – a URI to add

Returns:

True if the URI was added to the entry map, False if it was already there.

Return type:

bool

Adds a URI to the playlist’s entry map. This is useful when the URI is being added to the database, but no entry exists for it yet. When the entry is created, it will be added to the query model.

get_db()
Returns:

the RB.RhythmDB instance

Return type:

RB.RhythmDB

Returns the RB.RhythmDB instance. The caller must not unref the object once finished with it.

get_query_model()
Returns:

the current RB.RhythmDBQueryModel

Return type:

RB.RhythmDBQueryModel

Returns the current RB.RhythmDBQueryModel for the playlist. The caller must not unref the object once finished with it.

location_in_map(location)
Parameters:

location (str) – a URI to check

Returns:

True if the URI is present

Return type:

bool

Returns True if the specified URI is in the playlist entry map

mark_dirty()

Marks the playlist dirty. This generally means that the playlist will be saved to disk fairly soon, but the exact meaning can vary between playlist types.

save_playlist(uri, export_type)
Parameters:

Saves the playlist to an external file in a standard format (M3U, PLS, or XSPF).

save_to_xml(parent_node)
Parameters:

parent_node (libxml2.NodePtr) – libxml node below which to save the playlist

Converts the playlist to XML format, below the specified parent node.

set_query_model(model)
Parameters:

model (RB.RhythmDBQueryModel) – the new RB.RhythmDBQueryModel

Sets a new query model for the playlist. This updates the entry view to use the new query model and also updates the source query-model property.

This needs to be called when the playlist subclass creates a new query model.

setup_entry_view(entry_view)
Parameters:

entry_view (RB.EntryView) – the new RB.EntryView to set up

Connects signal handlers and sets up drag and drop support for an entry view to be used by a playlist source. This only needs to be called if the playlist subclass is creating a new entry view.

do_mark_dirty() virtual

Marks the playlist dirty. This generally means that the playlist will be saved to disk fairly soon, but the exact meaning can vary between playlist types.

do_save_contents_to_xml(node) virtual
Parameters:

node (libxml2.NodePtr) –

do_show_entry_view_popup(view, over_entry) virtual
Parameters:

Property Details

RB.PlaylistSource.props.db
Name:

db

Type:

RB.RhythmDB

Default Value:

None

Flags:

READABLE

The RB.RhythmDB instance

RB.PlaylistSource.props.dirty
Name:

dirty

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the playlist has been changed since it was last saved to disk.

RB.PlaylistSource.props.is_local
Name:

is-local

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the playlist is attached to the local library. Remote DAAP playlists, for example, are not local.