RBStaticPlaylistSource

RBStaticPlaylistSource — Manually defined playlist class

Synopsis

struct              RBStaticPlaylistSource;
struct              RBStaticPlaylistSourceClass;
RBSource *          rb_static_playlist_source_new       (RBShell *shell,
                                                         const char *name,
                                                         const char *settings_name,
                                                         gboolean local,
                                                         RhythmDBEntryType *entry_type);
RBSource *          rb_static_playlist_source_new_from_xml
                                                        (RBShell *shell,
                                                         xmlNodePtr node);
void                rb_static_playlist_source_load_from_xml
                                                        (RBStaticPlaylistSource *source,
                                                         xmlNodePtr node);
void                rb_static_playlist_source_add_entry (RBStaticPlaylistSource *source,
                                                         RhythmDBEntry *entry,
                                                         gint index);
void                rb_static_playlist_source_remove_entry
                                                        (RBStaticPlaylistSource *source,
                                                         RhythmDBEntry *entry);
void                rb_static_playlist_source_add_location
                                                        (RBStaticPlaylistSource *source,
                                                         const char *location,
                                                         gint index);
void                rb_static_playlist_source_add_locations
                                                        (RBStaticPlaylistSource *source,
                                                         GList *locations);
void                rb_static_playlist_source_remove_location
                                                        (RBStaticPlaylistSource *source,
                                                         const char *location);
void                rb_static_playlist_source_move_entry
                                                        (RBStaticPlaylistSource *source,
                                                         RhythmDBEntry *entry,
                                                         gint index);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkBox
                           +----GtkHBox
                                 +----RBDisplayPage
                                       +----RBSource
                                             +----RBPlaylistSource
                                                   +----RBStaticPlaylistSource
                                                         +----RBPlayQueueSource

Implemented Interfaces

RBStaticPlaylistSource implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Description

Static playlists are not defined by a query, but instead by manually selected and ordered tracks.

This class is used for static playlists built from the user's library, and is also a base class for the play queue and for playlists on devices and network shares.

It has some ability to track locations that are not yet present in the database and to add them to the playlist once they are added.

Details

struct RBStaticPlaylistSource

struct RBStaticPlaylistSource;


struct RBStaticPlaylistSourceClass

struct RBStaticPlaylistSourceClass {
	RBPlaylistSourceClass parent;
};


rb_static_playlist_source_new ()

RBSource *          rb_static_playlist_source_new       (RBShell *shell,
                                                         const char *name,
                                                         const char *settings_name,
                                                         gboolean local,
                                                         RhythmDBEntryType *entry_type);

Creates a new static playlist source.

shell :

the RBShell

name :

the playlist name

settings_name :

the settings name for the playlist (GSettings path friendly)

local :

if TRUE, the playlist is local to the library

entry_type :

type of database entries that can be added to the playlist.

Returns :

new playlist.

rb_static_playlist_source_new_from_xml ()

RBSource *          rb_static_playlist_source_new_from_xml
                                                        (RBShell *shell,
                                                         xmlNodePtr node);

Constructs a new playlist from the given XML document node.

shell :

the RBShell

node :

XML node containing playlist entries

Returns :

playlist read from XML

rb_static_playlist_source_load_from_xml ()

void                rb_static_playlist_source_load_from_xml
                                                        (RBStaticPlaylistSource *source,
                                                         xmlNodePtr node);

Loads the playlist contents from the specified XML document node.

source :

an RBStaticPlaylistSource

node :

XML node to load from

rb_static_playlist_source_add_entry ()

void                rb_static_playlist_source_add_entry (RBStaticPlaylistSource *source,
                                                         RhythmDBEntry *entry,
                                                         gint index);

Adds the specified entry to the playlist.

source :

an RBStaticPlaylistSource

entry :

entry to add to the playlist

index :

position at which to add it (-1 to add at the end)

rb_static_playlist_source_remove_entry ()

void                rb_static_playlist_source_remove_entry
                                                        (RBStaticPlaylistSource *source,
                                                         RhythmDBEntry *entry);

Removes the specified entry from the playlist.

source :

an RBStaticPlaylistSource

entry :

the entry to remove

rb_static_playlist_source_add_location ()

void                rb_static_playlist_source_add_location
                                                        (RBStaticPlaylistSource *source,
                                                         const char *location,
                                                         gint index);

If the location matches an entry in the database, the entry is added to the playlist. Otherwise, if it identifies a directory, the contents of that directory are added.

source :

an RBStaticPlaylistSource

location :

location (URI) to add to the playlist

index :

position at which to add the location (-1 to add at the end)

rb_static_playlist_source_add_locations ()

void                rb_static_playlist_source_add_locations
                                                        (RBStaticPlaylistSource *source,
                                                         GList *locations);

Adds the locations specified in locations to the playlist. See rb_static_playlist_source_add_location for details.

source :

an RBStaticPlaylistSource

locations :

URI strings to add. [element-type utf8][transfer none]

rb_static_playlist_source_remove_location ()

void                rb_static_playlist_source_remove_location
                                                        (RBStaticPlaylistSource *source,
                                                         const char *location);

Removes the specified location from the playlist. This affects both the location map and the query model, whether an entry exists for the location or not.

source :

an RBStaticPlaylistSource

location :

location to remove

rb_static_playlist_source_move_entry ()

void                rb_static_playlist_source_move_entry
                                                        (RBStaticPlaylistSource *source,
                                                         RhythmDBEntry *entry,
                                                         gint index);

Moves an entry within the playlist.

source :

an RBStaticPlaylistSource

entry :

the entry to move

index :

new location for the entry