1 /* EasyTAG - Tag editor for audio files
2  * Copyright (C) 2014  David King <amigadave@amigadave.com>
3  * Copyright (C) 2000-2003  Jerome Couderc <easytag@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 
21 #ifndef ET_SETTINGS_H_
22 #define ET_SETTINGS_H_
23 
24 #include <gtk/gtk.h>
25 
26 /* Categories to search in CDDB manual search. */
27 typedef enum
28 {
29     ET_CDDB_SEARCH_CATEGORY_BLUES = 1 << 0,
30     ET_CDDB_SEARCH_CATEGORY_CLASSICAL = 1 << 1,
31     ET_CDDB_SEARCH_CATEGORY_COUNTRY = 1 << 2,
32     ET_CDDB_SEARCH_CATEGORY_FOLK = 1 << 3,
33     ET_CDDB_SEARCH_CATEGORY_JAZZ = 1 << 4,
34     ET_CDDB_SEARCH_CATEGORY_MISC = 1 << 5,
35     ET_CDDB_SEARCH_CATEGORY_NEWAGE = 1 << 6,
36     ET_CDDB_SEARCH_CATEGORY_REGGAE = 1 << 7,
37     ET_CDDB_SEARCH_CATEGORY_ROCK = 1 << 8,
38     ET_CDDB_SEARCH_CATEGORY_SOUNDTRACK = 1 << 9
39 } EtCddbSearchCategory;
40 
41 /* Fields to use in CDDB manual search. */
42 typedef enum
43 {
44     ET_CDDB_SEARCH_FIELD_ARTIST = 1 << 0,
45     ET_CDDB_SEARCH_FIELD_TITLE = 1 << 1,
46     ET_CDDB_SEARCH_FIELD_TRACK = 1 << 2,
47     ET_CDDB_SEARCH_FIELD_OTHER = 1 << 3
48 } EtCddbSearchField;
49 
50 /* Fields to set from CDDB search results. */
51 typedef enum
52 {
53     ET_CDDB_SET_FIELD_TITLE = 1 << 0,
54     ET_CDDB_SET_FIELD_ARTIST = 1 << 1,
55     ET_CDDB_SET_FIELD_ALBUM = 1 << 2,
56     ET_CDDB_SET_FIELD_YEAR = 1 << 3,
57     ET_CDDB_SET_FIELD_TRACK = 1 << 4,
58     ET_CDDB_SET_FIELD_TRACK_TOTAL = 1 << 5,
59     ET_CDDB_SET_FIELD_GENRE = 1 << 6,
60     ET_CDDB_SET_FIELD_FILENAME = 1 << 7
61 } EtCddbSetField;
62 
63 /* Character set for passing to iconv. */
64 typedef enum
65 {
66     ET_CHARSET_IBM864,
67     ET_CHARSET_ISO_8859_6,
68     ET_CHARSET_WINDOWS_1256,
69     ET_CHARSET_ISO_8859_13,
70     ET_CHARSET_ISO_8859_4,
71     ET_CHARSET_WINDOWS_1257,
72     ET_CHARSET_ISO_8859_14,
73     ET_CHARSET_IBM852,
74     ET_CHARSET_ISO_8859_2,
75     ET_CHARSET_WINDOWS_1250,
76     ET_CHARSET_GB18030,
77     ET_CHARSET_GB2312,
78     ET_CHARSET_BIG5,
79     ET_CHARSET_BIG5_HKSCS,
80     ET_CHARSET_IBM855,
81     ET_CHARSET_ISO_8859_5,
82     ET_CHARSET_ISO_IR_111,
83     ET_CHARSET_ISO_KOI8_R,
84     ET_CHARSET_WINDOWS_1251,
85     ET_CHARSET_IBM866,
86     ET_CHARSET_KOI8_U,
87     ET_CHARSET_US_ASCII,
88     ET_CHARSET_ISO_8859_7,
89     ET_CHARSET_WINDOWS_1253,
90     ET_CHARSET_IBM862,
91     ET_CHARSET_WINDOWS_1255,
92     ET_CHARSET_EUC_JP,
93     ET_CHARSET_ISO_2022_JP,
94     ET_CHARSET_SHIFT_JIS,
95     ET_CHARSET_EUC_KR,
96     ET_CHARSET_ISO_8859_10,
97     ET_CHARSET_ISO_8859_3,
98     ET_CHARSET_TIS_620,
99     ET_CHARSET_IBM857,
100     ET_CHARSET_ISO_8859_9,
101     ET_CHARSET_WINDOWS_1254,
102     ET_CHARSET_UTF_8,
103     ET_CHARSET_VISCII,
104     ET_CHARSET_WINDOWS_1258,
105     ET_CHARSET_ISO_8859_8,
106     ET_CHARSET_IBM850,
107     ET_CHARSET_ISO_8859_1,
108     ET_CHARSET_ISO_8859_15,
109     ET_CHARSET_WINDOWS_1252
110 } EtCharset;
111 
112 /* Method for processing spaces when updating tags. */
113 typedef enum
114 {
115     ET_CONVERT_SPACES_SPACES,
116     ET_CONVERT_SPACES_UNDERSCORES,
117     ET_CONVERT_SPACES_REMOVE,
118     ET_CONVERT_SPACES_NO_CHANGE
119 } EtConvertSpaces;
120 
121 typedef enum
122 {
123     ET_FILENAME_EXTENSION_LOWER_CASE,
124     ET_FILENAME_EXTENSION_UPPER_CASE,
125     ET_FILENAME_EXTENSION_NO_CHANGE
126 } EtFilenameExtensionMode;
127 
128 /* Tag fields to process in the scanner. */
129 typedef enum
130 {
131     ET_PROCESS_FIELD_FILENAME = 1 << 0,
132     ET_PROCESS_FIELD_TITLE = 1 << 1,
133     ET_PROCESS_FIELD_ARTIST = 1 << 2,
134     ET_PROCESS_FIELD_ALBUM_ARTIST = 1 << 3,
135     ET_PROCESS_FIELD_ALBUM = 1 << 4,
136     ET_PROCESS_FIELD_GENRE = 1 << 5,
137     ET_PROCESS_FIELD_COMMENT = 1 << 6,
138     ET_PROCESS_FIELD_COMPOSER = 1 << 7,
139     ET_PROCESS_FIELD_ORIGINAL_ARTIST = 1 << 8,
140     ET_PROCESS_FIELD_COPYRIGHT = 1 << 9,
141     ET_PROCESS_FIELD_URL = 1 << 10,
142     ET_PROCESS_FIELD_ENCODED_BY = 1 << 11
143 } EtProcessField;
144 
145 typedef enum
146 {
147     ET_PROCESS_FIELDS_CONVERT_SPACES,
148     ET_PROCESS_FIELDS_CONVERT_UNDERSCORES,
149     ET_PROCESS_FIELDS_CONVERT_CHARACTERS,
150     ET_PROCESS_FIELDS_CONVERT_NO_CHANGE
151 } EtProcessFieldsConvert;
152 
153 /* Content of generated playlists. */
154 typedef enum
155 {
156     ET_PLAYLIST_CONTENT_FILENAMES,
157     ET_PLAYLIST_CONTENT_EXTENDED,
158     ET_PLAYLIST_CONTENT_EXTENDED_MASK
159 } EtPlaylistContent;
160 
161 /* Encoding options when renaming files. */
162 typedef enum
163 {
164     ET_RENAME_ENCODING_TRY_ALTERNATIVE,
165     ET_RENAME_ENCODING_TRANSLITERATE,
166     ET_RENAME_ENCODING_IGNORE
167 } EtRenameEncoding;
168 
169 /*
170  * The mode for the scanner window.
171  */
172 typedef enum
173 {
174     ET_SCAN_MODE_FILL_TAG,
175     ET_SCAN_MODE_RENAME_FILE,
176     ET_SCAN_MODE_PROCESS_FIELDS
177 } EtScanMode;
178 
179 /* Types of sorting. See the GSettings key "sort-mode". */
180 typedef enum
181 {
182     ET_SORT_MODE_ASCENDING_FILENAME,
183     ET_SORT_MODE_DESCENDING_FILENAME,
184     ET_SORT_MODE_ASCENDING_TITLE,
185     ET_SORT_MODE_DESCENDING_TITLE,
186     ET_SORT_MODE_ASCENDING_ARTIST,
187     ET_SORT_MODE_DESCENDING_ARTIST,
188     ET_SORT_MODE_ASCENDING_ALBUM_ARTIST,
189     ET_SORT_MODE_DESCENDING_ALBUM_ARTIST,
190     ET_SORT_MODE_ASCENDING_ALBUM,
191     ET_SORT_MODE_DESCENDING_ALBUM,
192     ET_SORT_MODE_ASCENDING_YEAR,
193     ET_SORT_MODE_DESCENDING_YEAR,
194     ET_SORT_MODE_ASCENDING_DISC_NUMBER,
195     ET_SORT_MODE_DESCENDING_DISC_NUMBER,
196     ET_SORT_MODE_ASCENDING_TRACK_NUMBER,
197     ET_SORT_MODE_DESCENDING_TRACK_NUMBER,
198     ET_SORT_MODE_ASCENDING_GENRE,
199     ET_SORT_MODE_DESCENDING_GENRE,
200     ET_SORT_MODE_ASCENDING_COMMENT,
201     ET_SORT_MODE_DESCENDING_COMMENT,
202     ET_SORT_MODE_ASCENDING_COMPOSER,
203     ET_SORT_MODE_DESCENDING_COMPOSER,
204     ET_SORT_MODE_ASCENDING_ORIG_ARTIST,
205     ET_SORT_MODE_DESCENDING_ORIG_ARTIST,
206     ET_SORT_MODE_ASCENDING_COPYRIGHT,
207     ET_SORT_MODE_DESCENDING_COPYRIGHT,
208     ET_SORT_MODE_ASCENDING_URL,
209     ET_SORT_MODE_DESCENDING_URL,
210     ET_SORT_MODE_ASCENDING_ENCODED_BY,
211     ET_SORT_MODE_DESCENDING_ENCODED_BY,
212     ET_SORT_MODE_ASCENDING_CREATION_DATE,
213     ET_SORT_MODE_DESCENDING_CREATION_DATE,
214     ET_SORT_MODE_ASCENDING_FILE_TYPE,
215     ET_SORT_MODE_DESCENDING_FILE_TYPE,
216     ET_SORT_MODE_ASCENDING_FILE_SIZE,
217     ET_SORT_MODE_DESCENDING_FILE_SIZE,
218     ET_SORT_MODE_ASCENDING_FILE_DURATION,
219     ET_SORT_MODE_DESCENDING_FILE_DURATION,
220     ET_SORT_MODE_ASCENDING_FILE_BITRATE,
221     ET_SORT_MODE_DESCENDING_FILE_BITRATE,
222     ET_SORT_MODE_ASCENDING_FILE_SAMPLERATE,
223     ET_SORT_MODE_DESCENDING_FILE_SAMPLERATE
224 } EtSortMode;
225 
226 /* Additional options to be passed to iconv(). */
227 typedef enum
228 {
229     ET_TAG_ENCODING_NONE,
230     ET_TAG_ENCODING_TRANSLITERATE,
231     ET_TAG_ENCODING_IGNORE
232 } EtTagEncoding;
233 
234 /*
235  * Config variables
236  */
237 
238 extern GSettings *MainSettings;
239 
240 void Init_Config_Variables (void);
241 
242 gboolean Setting_Create_Files     (void);
243 
244 
245 /* MasksList */
246 void Load_Scan_Tag_Masks_List (GtkListStore *liststore, gint colnum,
247                                const gchar * const *fallback);
248 void Save_Scan_Tag_Masks_List (GtkListStore *liststore, gint colnum);
249 
250 /* RenameFileMasksList */
251 void Load_Rename_File_Masks_List (GtkListStore *liststore, gint colnum,
252                                   const gchar * const *fallback);
253 void Save_Rename_File_Masks_List (GtkListStore *liststore, gint colnum);
254 
255 /* 'BrowserEntry' combobox */
256 void Load_Path_Entry_List (GtkListStore *liststore, gint colnum);
257 void Save_Path_Entry_List (GtkListStore *liststore, gint colnum);
258 
259 /* Run Program combobox (tree browser) */
260 void Load_Run_Program_With_Directory_List (GtkListStore *liststore, gint colnum);
261 void Save_Run_Program_With_Directory_List (GtkListStore *liststore, gint colnum);
262 
263 /* Run Program combobox (file browser) */
264 void Load_Run_Program_With_File_List (GtkListStore *liststore, gint colnum);
265 void Save_Run_Program_With_File_List (GtkListStore *liststore, gint colnum);
266 
267 /* 'SearchStringEntry' combobox */
268 void Load_Search_File_List (GtkListStore *liststore, gint colnum);
269 void Save_Search_File_List (GtkListStore *liststore, gint colnum);
270 
271 gboolean et_settings_enum_get (GValue *value, GVariant *variant,
272                                gpointer user_data);
273 GVariant *et_settings_enum_set (const GValue *value,
274                                 const GVariantType *expected_type,
275                                 gpointer user_data);
276 gboolean et_settings_enum_radio_get (GValue *value, GVariant *variant,
277                                      gpointer user_data);
278 GVariant *et_settings_enum_radio_set (const GValue *value,
279                                       const GVariantType *expected_type,
280                                       gpointer user_data);
281 gboolean et_settings_flags_toggle_get (GValue *value, GVariant *variant,
282                                        gpointer user_data);
283 GVariant *et_settings_flags_toggle_set (const GValue *value,
284                                         const GVariantType *expected_type,
285                                         gpointer user_data);
286 
287 
288 #endif /* ET_SETTINGS_H_ */
289