/* vim: set ai et ts=4 sw=4: */ #ifndef __playlist_h__ #define __playlist_h__ #include #define PLAYLIST(obj) GTK_CHECK_CAST(obj, playlist_get_type(), Playlist) #define PLAYLIST_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, playlist_get_type(), PlaylistClass) #define IS_PLAYLIST(obj) GTK_CHECK_TYPE(obj, playlist_get_type()) typedef struct _Playlist { GtkTreeView parent; GtkTreeModel* model; GtkTreeSelection* selection; gulong total_bytes; // total length as byte gulong total_seconds; // total length as second gint total_count; // number of items gulong check_bytes; // total length for checked item as byte gulong check_seconds; // total length for checked item as second gint check_count; // number of checked items gint current; // index of current row gint* play_order; // shuffled(or not) play order gchar* filename; // playlist filename } Playlist; typedef struct _PlaylistClass { GtkTreeViewClass parent_class; } PlaylistClass; GtkType playlist_get_type(void); GtkWidget* playlist_new(void); //void playlist_free(Playlist* pl); void playlist_init_columns(Playlist* pl); void playlist_set_filename(Playlist* pl, const gchar* filename); void playlist_read(Playlist* pl); void playlist_write(Playlist* pl); void playlist_cut(Playlist* pl); void playlist_copy(Playlist* pl); void playlist_paste(Playlist* pl); void playlist_clear(Playlist* pl); void playlist_select_all(Playlist* pl); void playlist_select_none(Playlist* pl); void playlist_invert_selection(Playlist* pl); gboolean playlist_show_dialog(Playlist* pl); void playlist_prev(Playlist* pl); void playlist_start(Playlist* pl); void playlist_stop(Playlist* pl); void playlist_pause(Playlist* pl); void playlist_next(Playlist* pl); void playlist_refresh(Playlist* pl); void playlist_add_file(Playlist* pl, const gchar* filename, gboolean check); void playlist_add_dir(Playlist* pl, const gchar* dirname, gboolean check); void playlist_import_pls(Playlist* pl, const gchar* filename); void playlist_export_pls(Playlist* pl, const gchar* filename); void playlist_update_row(Playlist* pl, GtkTreeIter* iter); void playlist_remove_row(Playlist* pl, GtkTreeIter* iter); void playlist_renumber(Playlist* pl); void playlist_shuffle(Playlist* pl); gint playlist_get_row_count(Playlist* pl); gboolean playlist_get_row(Playlist* pl, GtkTreeIter* iter, gint row); gboolean playlist_get_current_row(Playlist* pl, GtkTreeIter* iter); gchar* playlist_get_current_file(Playlist* pl); void playlist_set_current_icon(Playlist* pl, const gchar* filename); gboolean playlist_clipboard_is_empty(Playlist* pl); gchar* playlist_get_status_text(Playlist* pl); typedef enum _PlaylistColumnIndex { PL_ICON_COLUMN, PL_CHECK_COLUMN, PL_NUMBER_COLUMN, PL_TITLE_COLUMN, PL_ARTIST_COLUMN, PL_ALBUM_COLUMN, PL_TRACK_COLUMN, PL_YEAR_COLUMN, PL_GENRE_COLUMN, PL_TIME_COLUMN, PL_QUALITY_COLUMN, PL_RATING_COLUMN, PL_COMMENT_COLUMN, // invisible PL_FILENAME_COLUMN, PL_BYTES_COLUMN, PL_SECONDS_COLUMN, PL_N_COLUMNS } PlaylistColumnIndex; #endif /*playlist.h*/