/*************************************************************************** dbmusicglobals.h - description ------------------- begin : Wed Dec 19 2001 copyright : (C) 2001 by Will DeRousse email : badhack@users.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 file is the central location for all includes, global structs and variables, * and for processing the compiling environment. * Put includes in this file instead of individual headers to maintain consistency. * @short Central location for includes and global decs. * @author Will DeRousse <badhack@users.sourceforge.net> */ #ifndef DBMUSICGLOBALS_H #define DBMUSICGLOBALS_H #ifdef HAVE_CONFIG_H #include "../config.h" #endif using namespace std; // low level server codes #define DB_EMPTY_QUERY -199 #define DB_FATAL_ERROR -198 #define DB_UNKNOWN_ERROR -197 #define DB_NULL_QUERY -196 #define DB_CONNECTION_BAD -195 #define DB_BAD_RESPONSE -194 #define DB_NONFATAL_ERROR -193 #define DB_TUPLES_OK 97 #define DB_COMMAND_OK 98 #define EVERYTHING_OK 99 #define ARTIST_ADD_FAIL -192 #define ARTIST_DELETE_FAIL -191 #define ARTIST_GET_FAIL -190 #define ARTIST_SUM_FAIL -189 #define ARTIST_UPDATE_FAIL -188 #define TITLE_ADD_FAIL -187 #define TITLE_DELETE_FAIL -186 #define TITLE_GET_FAIL -185 #define TITLE_SUM_FAIL -184 #define TITLE_UPDATE_FAIL -183 #define TRACK_ADD_FAIL -182 #define TRACK_DELETE_FAIL -181 #define TRACK_GET_FAIL -180 #define TRACK_SUM_FAIL -179 #define TRACK_UPDATE_FAIL -178 #define CATEGORY_ADD_FAIL -177 #define CATEGORY_DELETE_FAIL -176 #define CATEGORY_GET_FAIL -175 #define CATEGORY_SUM_FAIL -174 #define CATEGORY_UPDATE_FAIL -173 #define CATEGORY_UNKDEL_FAIL -172 #define LYRIC_UPDATE_FAIL -171 #define LYRIC_GET_FAIL -170 #define FILE_OPEN_FAIL -169 #define VACUUM_FAIL -168 #define TABLE_FORMAT_FAIL -167 #define NO_MEMORY -166 #define NO_TUPLES -165 #define WORK_FAIL -164 #define VERSION_GET_FAIL -163 /** * Default values */ #define DATA_BASE "dbmusic.dump" #define DB_VERSION "0.97" #define KBOXSET 0 #define KFORMAT 1 #define KGENRE 2 #define KLABEL 3 #define KMETHOD 4 #define KTYPE 5 #define KBTE 6 #define REPORT_ALL 21 #define REPORT_YES 22 #define REPORT_NO 23 #define ASC 41 #define DES 42 #define ARTIST 30 #define TITLE 31 #define TRACK 32 #define LYRIC 33 #define REPORT_TBYA 61 #define REPORT_TBYT 62 #define REPORT_ARTISTS 63 #define REPORT_COLLECTION 64 #define REPORT_DATERANGE 65 #define REPORT_BTE 66 #define REPORT_STATS 67 #define REPORT_NAMESEARCH 68 #define REPORT_CATEGORYSEARCH 69 #define REPORT_TOPTITLES 70 #define REPORT_CUSTOM 71 /* *SUSE 7.2 fix (maybe others who knows) */ //#define HAVE_CXX_STRING_HEADER 1 /** * Library Includes */ #include <qstring.h> #include <qfont.h> /** * Global struct prototypes */ /** * @short Struct for holding artist information. * @param aid AID * @param notes Artist Specific Notes * @param first First title/year of conception * @param last Demise/Last Release * @param homepage Homepage * @param name Name Of Artist * @param follow Do you still collect the artist? */ struct artistInfo { QString aid,notes,first,last,homepage,name; bool follow; }; /** * @short Struct for holding category information. * @param name Name Of Category * @param xid Category ID * @param ctype Category Type */ struct categoryInfo { QString name, xid; int ctype; }; /** * @short Struct for holding color information of type QString in form #RRGGBB. * @param artist Artists/artist information * @param background Background Color * @param misc Headers, misc "other"/"leftover" useage. May be expanded upon in the future * @param title Titles/title information * @param totals Totals, sums, etc * @param track Tracks/track information * @param text Text Color */ struct colorInfo { QString artist, background, misc, title, totals, track, text; }; /** * @short Struct for holding database connection information. * @param db_name Name of the database * @param db_location Web Address/IP * @param db_passwd Password for user (blank if none) * @param db_port Port database is receiving connections on * @param db_user Username used to connect to db (if blank then what you are logged in as) * @param pg_version The version of the PostgreSQL server (if set) */ struct dbInfo { QString db_name, db_location, db_passwd, db_port, db_user; QString pg_version; }; /** * @short Struct to hold which artist columns to display in a QListView. * @param name Name * @param first Conception * @param last Demise * @param follow Artist followed or not * @param homepage Homepage * @param notes Notes * @param aid Artist ID */ struct enabledArtistColumns { bool name,first,last,follow,homepage,notes,aid; }; /** * @short Struct to hold which categories columns to display in a QListView. * @param name Name * @param xid Category ID */ struct enabledCategoryColumns { bool name,xid; }; /** * @short Struct to hold which title columns to display in a QListView. * @param name Name Of Title * @param collected Title collected or not * @param length Length Of Title * @param nod Number Of Media * @param notracks Number Of Tracks * @param fid Format * @param gid Genre * @param lid Label * @param mid Method * @param tid Type * @param yearstart Year Start * @param yearend Year End * @param rating Rating of the music * @param quality Quality Of Recording * @param notes Title Notes * @param code Extra field (indexing, etc) * @param loan On loan or not * @param cdid Title ID */ struct enabledTitleColumns { bool name,collected,length,nod,notracks,fid,gid,lid,mid,tid,yearstart,yearend,rating,quality,notes,code,loan,cdid; }; /** * @short Struct to hold which track columns to display in a QListView. * @param num Track Number * @param name Name Of Track * @param length Length Of Track * @param lyric Track Lyrics * @param side Release side (1,2 or a,b) * @param notes Track Notes * @param trackid Track ID */ struct enabledTrackColumns { bool num,name,length,lyric,side,notes,trackid; }; /** * @short Struct for holding report options. Used when generating reports custom tailored to the users selection. * @param date_range_enabled Used to set if the report will be restricted by a date range * @param limit_enabled Used to set if the report will be restricted by a limited amount of results * @param sort_time If sort by number is enabled * @param report_type All, Collected, or Not Collected * @param sort_order Ascending or Descending * @param end End year (inclusive) for date range * @param start Start year (inclusive) for date range * @param charset Locale Charset * @param limit Limit Report to n values * @param rfont Report Font */ struct reportInfo { bool date_range_enabled, sort_time, limit_enabled; int report_type, sort_order; QString end, start, charset, limit; QFont rfont; }; /** * @short Struct for holding supported report options. Can be used in report dialogs for enabling/disabling widgets. * @param orderby Ascending/Descending support * @param collect Collect, Not Collected, All * @param range A Date Range (i.e. 1980-1989) * @param font Font Changing * @param color Color Changing * @param limit LIMIT Setting */ struct reportProvides { bool orderby, collect, range, font, color, limit; }; /** * @short Struct for holding title information. * @param name Name Of Title * @param cdid DB CDID Index * @param yearstart Yearstart * @param yearend Yearend * @param nod Number Of Media * @param notracks Number Of Tracks * @param length Length Of Title * @param notes Title Specific Notes * @param picpath Path to the pic * @param collected Is this title in your collection? * @param rating How much do you like the release? * @param quality How good is the recording? * @param code For storing title code, cuecat, or any other information * @param loan If you have loaned out the title or not * @param cat List of 6 categoryInfo structs to hold boxset, format, genre, label, method, type. */ struct titleInfo { QString name,cdid,yearstart,yearend,nod,notracks,length,notes,picpath,rating,quality,code; categoryInfo cat[6]; bool collected, loan; }; /** * @short Struct for holding track information. * @param trackid Track ID * @param name Track Name * @param length Track Length (xx:xx:xx) * @param lyric Track Lyrics * @param side Side that track is on * @param notes Track Notes */ struct trackInfo { QString trackid,name,length,lyric,side,notes; }; #endif