Playlist View Models

Playlist View Models — Catalog and playlist list view models

Synopsis

#include <rc-ui-listmodel.h>

enum                RCUiCatalogColumns;
struct              RCUiCatalogStore;
struct              RCUiCatalogStoreClass;
enum                RCUiPlaylistColumns;
struct              RCUiPlaylistStore;
struct              RCUiPlaylistStoreClass;
RCLibDbCatalogIter * rc_ui_list_model_get_catalog_by_model
                                                        (GtkTreeModel *model);
GtkTreeModel *      rc_ui_list_model_get_catalog_store  ();
GtkTreeModel *      rc_ui_list_model_get_playlist_store (GtkTreeIter *iter);
const gchar *       rc_ui_list_model_get_playlist_title_format
                                                        ();
void                rc_ui_list_model_set_playlist_title_format
                                                        (const gchar *format);

Object Hierarchy

  GObject
   +----RCUiCatalogStore
  GObject
   +----RCUiPlaylistStore

Implemented Interfaces

RCUiCatalogStore implements GtkTreeModel.

RCUiPlaylistStore implements GtkTreeModel.

Description

This module provides 2 classes: RCUiCatalogStore and RCUiPlaylistStore, which implements interface GtkTreeModel. They can be used by GtkTreeView for showing and operating the data inside. RCUiCatalogStore contains the catalog list, and RCUiPlaylistStore contains the playlist.

Details

enum RCUiCatalogColumns

typedef enum {
    RC_UI_CATALOG_COLUMN_TYPE,
    RC_UI_CATALOG_COLUMN_STATE,
    RC_UI_CATALOG_COLUMN_NAME,
    RC_UI_CATALOG_COLUMN_PLAYING_FLAG,
    RC_UI_CATALOG_COLUMN_LAST
} RCUiCatalogColumns;

The enum type for the columns in the catalog store.

RC_UI_CATALOG_COLUMN_TYPE

the type column

RC_UI_CATALOG_COLUMN_STATE

the state column

RC_UI_CATALOG_COLUMN_NAME

the name column

RC_UI_CATALOG_COLUMN_PLAYING_FLAG

the playing flag column

RC_UI_CATALOG_COLUMN_LAST

the last column, do not use it

struct RCUiCatalogStore

struct RCUiCatalogStore;

The data structure used for RCUiCatalogStore class.


struct RCUiCatalogStoreClass

struct RCUiCatalogStoreClass {
};

RCUiCatalogStoreClass class.


enum RCUiPlaylistColumns

typedef enum {
    RC_UI_PLAYLIST_COLUMN_TYPE,
    RC_UI_PLAYLIST_COLUMN_STATE,
    RC_UI_PLAYLIST_COLUMN_FTITLE,
    RC_UI_PLAYLIST_COLUMN_TITLE,
    RC_UI_PLAYLIST_COLUMN_ARTIST,
    RC_UI_PLAYLIST_COLUMN_ALBUM,
    RC_UI_PLAYLIST_COLUMN_FTYPE,
    RC_UI_PLAYLIST_COLUMN_GENRE,
    RC_UI_PLAYLIST_COLUMN_LENGTH,
    RC_UI_PLAYLIST_COLUMN_TRACK,
    RC_UI_PLAYLIST_COLUMN_RATING,
    RC_UI_PLAYLIST_COLUMN_YEAR,
    RC_UI_PLAYLIST_COLUMN_PLAYING_FLAG,
    RC_UI_PLAYLIST_COLUMN_LAST
} RCUiPlaylistColumns;

The enum type for the columns in the playlist store.

RC_UI_PLAYLIST_COLUMN_TYPE

the type column

RC_UI_PLAYLIST_COLUMN_STATE

the state column

RC_UI_PLAYLIST_COLUMN_FTITLE

the title column

RC_UI_PLAYLIST_COLUMN_TITLE

the real title column

RC_UI_PLAYLIST_COLUMN_ARTIST

the artist column

RC_UI_PLAYLIST_COLUMN_ALBUM

the album column

RC_UI_PLAYLIST_COLUMN_FTYPE

the file type (format) column

RC_UI_PLAYLIST_COLUMN_GENRE

the genre column

RC_UI_PLAYLIST_COLUMN_LENGTH

the time length column

RC_UI_PLAYLIST_COLUMN_TRACK

the track number column

RC_UI_PLAYLIST_COLUMN_RATING

the rating column

RC_UI_PLAYLIST_COLUMN_YEAR

the year column

RC_UI_PLAYLIST_COLUMN_PLAYING_FLAG

the playing flag column

RC_UI_PLAYLIST_COLUMN_LAST

the last column, do not use it

struct RCUiPlaylistStore

struct RCUiPlaylistStore;

The data structure used for RCUiPlaylistStore class.


struct RCUiPlaylistStoreClass

struct RCUiPlaylistStoreClass {
};

RCUiPlaylistStoreClass class.


rc_ui_list_model_get_catalog_by_model ()

RCLibDbCatalogIter * rc_ui_list_model_get_catalog_by_model
                                                        (GtkTreeModel *model);

Get the catalog iter by given playlist store model.

model :

the playlist store model

Returns :

(skip): The catalog iter. [transfer none]

rc_ui_list_model_get_catalog_store ()

GtkTreeModel *      rc_ui_list_model_get_catalog_store  ();

Get the catalog store. If the catalog store is not initialize, it will be intialized first.

Returns :

The catalog store. [transfer none]

rc_ui_list_model_get_playlist_store ()

GtkTreeModel *      rc_ui_list_model_get_playlist_store (GtkTreeIter *iter);

Get the playlist store by the iter in the catalog. If the store is not initialized, it will be initialzed first.

iter :

the iter for the playlist in the catalog

Returns :

The playlist store, NULL if the iter is invalid. [transfer none]

rc_ui_list_model_get_playlist_title_format ()

const gchar *       rc_ui_list_model_get_playlist_title_format
                                                        ();

Get the format string of the title column in the playlist.

Returns :

The format string, do not free or modify it.

rc_ui_list_model_set_playlist_title_format ()

void                rc_ui_list_model_set_playlist_title_format
                                                        (const gchar *format);

Set the format string of the title column in the playlist, using %TITLE as title string, %ARTIST as artist string, %ALBUM as album string. Notice that %TITLE should be always included in the string.

format :

the format string