/* | Copyright (C) 2002-2007 Jorg Schuler | Part of the gtkpod project. | | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | | This program is free software; you can redistribute it and/or modify | it under the terms of the GNU General Public License as published by | the Free Software Foundation; either version 2 of the License, or | (at your option) any later version. | | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License | along with this program; if not, write to the Free Software | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | | iTunes and iPod are trademarks of Apple | | This product is not supported/written/published by Apple! | | $Id: display.h 1570 2007-06-21 15:27:11Z jcsjcs $ */ #ifndef __DISPLAY_H__ #define __DISPLAY_H__ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "itdb.h" #include "display_itdb.h" #include "display_coverart.h" /* Main XML glade file */ GladeXML *main_window_xml; /* pointer to main window */ extern GtkWidget *gtkpod_window; /* types for sort */ enum { SORT_ASCENDING = GTK_SORT_ASCENDING, SORT_DESCENDING = GTK_SORT_DESCENDING, SORT_NONE = 10*(GTK_SORT_ASCENDING+GTK_SORT_DESCENDING), }; /* Categories in each sort tab (page numbers) */ typedef enum { ST_CAT_ARTIST = 0, ST_CAT_ALBUM, ST_CAT_GENRE, ST_CAT_COMPOSER, ST_CAT_TITLE, ST_CAT_YEAR, ST_CAT_SPECIAL, ST_CAT_NUM } ST_CAT_item; /* Number of search tabs to be supported. */ #define SORT_TAB_MAX (ST_CAT_NUM-1) /* Number of GtkPaned elements in the main window. The positions of * these elements will be stored in the prefs file and be set to the * last value when starting gtkpod again */ /* Number defined with glade ("paned%d") */ enum { PANED_PLAYLIST = 0, PANED_TRACKLIST, PANED_STATUS1, PANED_STATUS2, PANED_NUM_GLADE }; /* Number created in display.c (for sort tabs, stored in st_paned[]) */ #define PANED_NUM_ST (SORT_TAB_MAX-1) /* Total number */ #define PANED_NUM (PANED_NUM_GLADE+PANED_NUM_ST) /* max. number of stars */ #define RATING_MAX 5 /* struct for each entry in sort tab */ typedef struct { gchar *name; gboolean master; /* set if this is the "All" entry */ gboolean compilation; /* set if this is the "Compilation" entry */ GList *members; /* GList with member tracks (pointer to "Track") */ } TabEntry; /* struct for time info (added, played, modified) */ typedef struct { gchar *int_str; /* copy of string specified in the sort tab */ gboolean valid; /* is current string valid? */ time_t lower; /* timestamp for lower limit */ time_t upper; /* timestamp for upper limit ("-1": no limit) */ GtkWidget *entry; /* pointer to GtkEntry in sort tab */ GtkWidget *active;/* pointer to toggle button */ } TimeInfo; /* struct with data corresponding to each sort tab */ typedef struct { guint current_category; /* current page (category) selected) */ gboolean final; /* have all tracks been added? */ GtkWidget *window[ST_CAT_NUM]; /* pointer to scrolled window */ /* The following are used for "normal" categories (not ST_CAT_SPECIAL) */ GtkTreeModel *model; /* pointer to model used */ GtkNotebook *notebook; /* pointer to notebook used */ GtkTreeView *treeview[ST_CAT_NUM]; /* pointer to treeviews used */ GList *entries; /* list with entries */ TabEntry *current_entry; /* pointer to currently selected entry */ gchar *lastselection[ST_CAT_NUM]; /* name of entry last selected */ GHashTable *entry_hash; /* table for quick find of tab entries */ gboolean unselected; /* unselected item since last st_init? */ /* The following are used for "special" categories (ST_CAT_SPECIAL) */ GList *sp_members; /* list of tracks in sorttab */ GList *sp_selected; /* list of tracks selected */ gboolean is_go; /* pass new members on automatically */ TimeInfo ti_added; /* TimeInfo "added" (sp) */ TimeInfo ti_modified; /* TimeInfo "modified" (sp) */ TimeInfo ti_played; /* TimeInfo "played" (sp) */ GtkTooltipsData *sp_tooltips_data; /* ptr to tooltips in special st */ /* function used for string comparisons, set in on_st_switch_page */ gint (*string_compare_func) (const gchar *str1, const gchar *str2); } SortTab; /* "Column numbers" in sort tab model */ typedef enum { ST_COLUMN_ENTRY = 0, ST_NUM_COLUMNS } ST_item; /* Column numbers in track model */ /* Note: add corresponding entries to T_item and TM_to_T() as well * (below and in misc_conversion.c). * IMPORTANT: Do not change the order -- always add new entries at the * end */ typedef enum { TM_COLUMN_TITLE = 0, TM_COLUMN_ARTIST, TM_COLUMN_ALBUM, TM_COLUMN_GENRE, TM_COLUMN_COMPOSER, TM_COLUMN_TRACK_NR, /* 5 */ TM_COLUMN_IPOD_ID, TM_COLUMN_PC_PATH, TM_COLUMN_TRANSFERRED, TM_COLUMN_SIZE, TM_COLUMN_TRACKLEN, /* 10 */ TM_COLUMN_BITRATE, TM_COLUMN_PLAYCOUNT, TM_COLUMN_RATING, TM_COLUMN_TIME_PLAYED, TM_COLUMN_TIME_MODIFIED, /* 15 */ TM_COLUMN_VOLUME, TM_COLUMN_YEAR, TM_COLUMN_CD_NR, TM_COLUMN_TIME_ADDED, TM_COLUMN_IPOD_PATH, /* 20 */ TM_COLUMN_SOUNDCHECK, TM_COLUMN_SAMPLERATE, TM_COLUMN_BPM, TM_COLUMN_FILETYPE, TM_COLUMN_GROUPING, /* 25 */ TM_COLUMN_COMPILATION, TM_COLUMN_COMMENT, TM_COLUMN_CATEGORY, TM_COLUMN_DESCRIPTION, TM_COLUMN_PODCASTURL, /* 30 */ TM_COLUMN_PODCASTRSS, TM_COLUMN_SUBTITLE, TM_COLUMN_TIME_RELEASED, TM_COLUMN_THUMB_PATH, TM_COLUMN_MEDIA_TYPE, /* 35 */ TM_COLUMN_TV_SHOW, TM_COLUMN_TV_EPISODE, TM_COLUMN_TV_NETWORK, TM_COLUMN_SEASON_NR, TM_COLUMN_EPISODE_NR, /* 40 */ TM_COLUMN_ALBUMARTIST, TM_COLUMN_SORT_ARTIST, TM_COLUMN_SORT_TITLE, TM_COLUMN_SORT_ALBUM, TM_COLUMN_SORT_ALBUMARTIST, /* 45 */ TM_COLUMN_SORT_COMPOSER, TM_COLUMN_SORT_TVSHOW, TM_NUM_COLUMNS } TM_item; /* A means to address the fields by uniform IDs. May be extended as * needed. You should extend "track_get_item_pointer()" defined in * track.c as well for string fields. */ /* Add corresponding entries to t_strings[] and t_tooltips[] in misc_conversion.c! */ /* Used in prefs_window.c to label the sort_ign_field buttons */ /* Used in details.c to label the detail_label_ labels */ typedef enum { T_ALL = 0, /* all fields */ T_ALBUM, T_ARTIST, T_TITLE, T_GENRE, T_COMMENT, /* 5 */ T_COMPOSER, T_FILETYPE, T_PC_PATH, T_IPOD_PATH, T_IPOD_ID, /* 10 */ T_TRACK_NR, T_TRANSFERRED, T_SIZE, T_TRACKLEN, T_BITRATE, /* 15 */ T_SAMPLERATE, T_BPM, T_PLAYCOUNT, T_RATING, T_TIME_ADDED, /* 20 */ T_TIME_PLAYED, T_TIME_MODIFIED, T_VOLUME, T_SOUNDCHECK, T_YEAR, /* 25 */ T_CD_NR, T_GROUPING, T_COMPILATION, T_CATEGORY, T_DESCRIPTION, /* 30 */ T_PODCASTURL, T_PODCASTRSS, T_SUBTITLE, T_TIME_RELEASED, T_CHECKED, /* 35 */ T_STARTTIME, T_STOPTIME, T_REMEMBER_PLAYBACK_POSITION, T_SKIP_WHEN_SHUFFLING, T_THUMB_PATH, /* 40 */ T_MEDIA_TYPE, T_TV_SHOW, T_TV_EPISODE, T_TV_NETWORK, T_SEASON_NR, /* 45 */ T_EPISODE_NR, T_ALBUMARTIST, T_SORT_ARTIST, T_SORT_TITLE, T_SORT_ALBUM, /* 50 */ T_SORT_ALBUMARTIST, T_SORT_COMPOSER, T_SORT_TVSHOW, T_ITEM_NUM, } T_item; /* number of entries with "autoset empty tag to filename " feature */ #define TM_NUM_TAGS_PREFS (5) /* "Column numbers" in playlist model */ enum { PM_COLUMN_ITDB = 0, PM_COLUMN_PLAYLIST, PM_NUM_COLUMNS }; /* Drag and drop types */ enum { DND_GTKPOD_TRACKLIST = 1000, DND_GTKPOD_TM_PATHLIST, DND_GTKPOD_PLAYLISTLIST, DND_TEXT_URI_LIST, DND_TEXT_PLAIN }; /* used for the ST_CAT_SPECIAL user_data (see st_create_special and * the corresponding signal functions) */ #define SP_SHIFT 9 #define SP_MASK ((1<