Sayonara Player
SettingKey.h
1/* SettingKey.h */
2
3/* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21// clazy:excludeall=non-pod-global-static
22
23#ifndef SETTINGKEY_H
24#define SETTINGKEY_H
25
26#include "Utils/typedefs.h"
27
28enum class SettingKey : unsigned short
29{
30 LFM_Active = 0,
31 LFM_ScrobbleTimeSec,
32 LFM_Login,
33 LFM_Username,
34 LFM_Password,
35 LFM_Corrections,
36 LFM_ShowErrors,
37 LFM_SessionKey,
38 Eq_Last,
39 Eq_Gauss,
40 Lib_Show,
41 Lib_Path,
42 Lib_ColStateAlbums,
43 Lib_ColStateArtists,
44 Lib_ColStateTracks,
45 Lib_LiveSearch,
46 Lib_Sorting,
47 Lib_CurPlugin,
48 Lib_SplitterStateArtist,
49 Lib_SplitterStateTrack,
50 Lib_SplitterStateGenre,
51 Lib_SplitterStateDate,
52 Lib_OldWidth,
53 Lib_DC_DoNothing,
54 Lib_DC_PlayIfStopped,
55 Lib_DC_PlayImmediately,
56 Lib_DD_DoNothing,
57 Lib_DD_PlayIfStoppedAndEmpty,
58 Lib_SearchMode,
59 Lib_AutoUpdate,
60 Lib_ShowAlbumArtists,
61 Lib_ShowAlbumCovers,
62 Lib_ViewType,
63 Lib_FontBold,
64 Lib_CoverZoom,
65 Lib_CoverShowUtils,
66 Lib_CoverShowArtist,
67 Lib_CoverOrigPMCache,
68 Lib_CoverScaledPMCache,
69 Lib_GenreTree,
70 Lib_LastIndex,
71 Lib_AllLibraries,
72 Lib_UseViewClearButton,
73 Lib_ShowFilterExtBar,
74 Lib_SortIgnoreArtistArticle,
75 Lib_HeaderAutoResizeArtists,
76 Lib_HeaderAutoResizeAlbums,
77 Lib_HeaderAutoResizeTracks,
78 Dir_ShowTracks,
79 Dir_SplitterDirFile,
80 Dir_SplitterTracks,
81 Dir_TagToFilenameExpression,
82 Player_Version,
83 Player_Language,
84 Player_Style,
85 Player_FadingCover,
86 Player_ControlStyle,
87 Player_Geometry,
88 Player_Fullscreen,
89 Player_Maximized,
90 Player_ShownPlugin,
91 Player_OneInstance,
92 Player_Min2Tray,
93 Player_StartInTray,
94 Player_ShowTrayIcon,
95 Player_514Fix,
96 Player_NotifyNewVersion,
97 Player_SplitterState,
98 Player_SplitterControls,
99 Player_PrivId,
100 Player_PublicId,
101 PL_EntryLook,
102 PL_LastTrack,
103 PL_LastTrackBeforeStop,
104 PL_LastPlaylist,
105 PL_LoadLastTrack,
106 PL_LoadSavedPlaylists,
107 PL_LoadTemporaryPlaylists,
108 PL_Mode,
109 PL_Playlist,
110 PL_RememberTime,
111 PL_RememberTrackAfterStop,
112 PL_ShowClearButton,
113 PL_ShowCovers,
114 PL_ShowNumbers,
115 PL_ShowBottomBar,
116 PL_ShowRating,
117 PL_StartPlaying,
118 PL_CurrentTrackCustomColorStandard,
119 PL_CurrentTrackColorStringStandard,
120 PL_CurrentTrackCustomColorDark,
121 PL_CurrentTrackColorStringDark,
122 PL_JumpToCurrentTrack,
123 Notification_Show,
124 Notification_Timeout,
125 Notification_Name,
126 Engine_Name,
127 Engine_Vol,
128 Engine_Mute,
129 AudioConvert_NumberThreads,
130 AudioConvert_PreferredConverter,
131 AudioConvert_QualityLameVBR,
132 AudioConvert_QualityLameCBR,
133 AudioConvert_QualityOgg,
134 Engine_CovertTargetPath,
135 Engine_SpectrumBins,
136 Engine_ShowSpectrum,
137 Engine_ShowLevel,
138 Engine_CurTrackPos_s,
139 Engine_CrossFaderActive,
140 Engine_CrossFaderTime,
141 Engine_Pitch,
142 Engine_PreservePitch,
143 Engine_Speed,
144 Engine_SpeedActive,
145 Engine_Sink,
146 Engine_AlsaDevice,
147 Engine_BufferSizeMS,
148 Engine_SR_Active,
149 Engine_SR_Warning,
150 Engine_SR_Path,
151 Engine_SR_SessionPath,
152 Engine_SR_SessionPathTemplate,
153 Engine_SR_AutoRecord,
154 Spectrum_Style,
155 Level_Style,
156 Broadcast_Active,
157 Broadcast_Prompt,
158 Broadcast_Port,
159 MP3enc_found,
160 Pitch_found,
161 Player_Quit,
162 Remote_Active,
163 Remote_Port,
164 Remote_Discoverable,
165 Remote_DiscoverPort,
166 Stream_NewTab,
167 Stream_ShowHistory,
168 Stream_SearchWindowSize,
169 Lyrics_Zoom,
170 Lyrics_Server,
171 Cover_Server,
172 Cover_FetchFromWWW,
173 Cover_SaveToDB,
174 Cover_StartSearch,
175 Cover_SaveToLibrary,
176 Cover_SaveToSayonaraDir,
177 Cover_TemplatePath,
178 Icon_Theme,
179 Icon_ForceInDarkTheme,
180 Proxy_Active,
181 Proxy_Username,
182 Proxy_Password,
183 Proxy_Hostname,
184 Proxy_Port,
185 Proxy_SavePw,
186 Speed_LastTab,
187 InfoDialog_Size,
188 AlternativeCovers_Size,
189 Logger_Level,
190 Settings_Revision,
191 Num_Setting_Keys
192};
193
194class QString;
195class QStringList;
196class QPoint;
197class QSize;
198class QByteArray;
199
200class EqualizerSetting;
201struct RawShortcutMap;
202
203namespace Playlist
204{
205 class Mode;
206}
207
208namespace Library
209{
210 class Sortings;
211 class Info;
212 enum class ViewType : quint8;
213}
214
215template<typename DataType, SettingKey keyIndex>
217{
218 public:
219 using Data = DataType;
220 const static SettingKey key = keyIndex;
221
222 private:
223 SettingIdentifier() = delete;
225};
226
227#define INST_ABSTR(ns, type, settingkey) \
228 namespace ns { \
229 using settingkey = SettingIdentifier<type, SettingKey:: settingkey>; \
230 }
231
232#define INST(type, settingkey) INST_ABSTR(Set, type, settingkey)
233#define INST_NO_DB(type, settingkey) INST_ABSTR(SetNoDB, type, settingkey)
234
239INST(bool, LFM_Active) /* is lastFM active? */
240INST(int, LFM_ScrobbleTimeSec) /* time in sec when to scrobble */
241INST(StringPair, LFM_Login) /* deprecated: 2-Tupel, username, password */
242INST(QString, LFM_Username) /* username*/
243INST(QString, LFM_Password) /* encrypted password */
244
245INST(bool, LFM_Corrections) /* propose lfm corrections */
246INST(bool, LFM_ShowErrors) /* get error message, if there are lfm problems */
247INST(QString, LFM_SessionKey) /* lfm session key */
248
249INST(int, Eq_Last) /* last equalizer index */
250INST(bool, Eq_Gauss) /* do curve, when changing eq setting */
251
252INST(bool, Lib_Show) /* show library */
253INST(QString, Lib_Path) // deprecated
254INST(QByteArray, Lib_ColStateAlbums)
255INST(QByteArray, Lib_ColStateArtists)
256INST(QByteArray, Lib_ColStateTracks)
257INST(bool, Lib_LiveSearch) /* library live search */
258INST(::Library::Sortings, Lib_Sorting) /* how to sort in lib */
259INST(QString, Lib_CurPlugin) /* Current shown library plugin */
260INST(QByteArray, Lib_SplitterStateArtist) /* Splitter state between artists and albums */
261INST(QByteArray, Lib_SplitterStateTrack) /* Splitter state between artists and tracks */
262INST(QByteArray, Lib_SplitterStateGenre) /* Splitter state between tracks and genres */
263INST(QByteArray, Lib_SplitterStateDate) /* Splitter state between tracks and genres */
264INST(int, Lib_OldWidth) /* Old library width when hiding library */
265INST(bool, Lib_DC_DoNothing) /* when double clicked, create playlist and do nothing*/
266INST(bool, Lib_DC_PlayIfStopped) /* when double clicked, play if stopped */
267INST(bool, Lib_DC_PlayImmediately) /* when double clicked, play immediately */
268INST(bool, Lib_DD_DoNothing) /* when drag dropped, insert tracks and do nothing */
269INST(bool, Lib_DD_PlayIfStoppedAndEmpty) /* when drag dropped, play if playlist is empty and stopped */
270INST(int, Lib_SearchMode) /* Search mode in library. See */
271INST(bool, Lib_AutoUpdate) /* Automatic update of library */
272INST(bool, Lib_ShowAlbumArtists) /* Show album artists instead of artists */
273INST(bool, Lib_ShowAlbumCovers) /* Show album cover view */
274INST(::Library::ViewType, Lib_ViewType) /* Standard view, CoverView, LibraryView */
275INST(int, Lib_CoverZoom) /* Zoom of album cover view */
276INST(int, Lib_CoverOrigPMCache) /* Original sized pixmap cache */
277INST(int, Lib_CoverScaledPMCache) /* Scaled sized pixmap cache */
278INST(bool, Lib_CoverShowUtils) /* Show utils bar in cover view */
279INST(bool, Lib_CoverShowArtist) /* Show artist name in cover view */
280INST(bool, Lib_GenreTree) /* Show tree view of genres */
281INST(QList<::Library::Info>, Lib_AllLibraries) // deprecated
282INST(int, Lib_LastIndex) /* Last selected library */
283INST(bool, Lib_FontBold) /* bold fonts in library */
284INST(bool, Lib_UseViewClearButton) /* Show clear button in single view */
285INST(bool, Lib_ShowFilterExtBar) /* Show the file extension filter bar in track view */
286INST(bool, Lib_SortIgnoreArtistArticle) /* ignore article for artist */
287INST(bool, Lib_HeaderAutoResizeArtists) /* resize columns automatically in artists */
288INST(bool, Lib_HeaderAutoResizeAlbums) /* resize columns automatically in albums */
289INST(bool, Lib_HeaderAutoResizeTracks) /* resize columns automatically in tracks */
290
291INST(bool, Dir_ShowTracks) /* show tracks panel in directory view */
292INST(QByteArray, Dir_SplitterDirFile) /* Splitter state between dirs and files */
293INST(QByteArray, Dir_SplitterTracks) /* Splitter between upper and track view */
294INST(QString, Dir_TagToFilenameExpression) /* Last used expression when converting tags to filename */
295
296INST(QString, Player_Version) /* Version string of player */
297INST(QString, Player_Language) /* language of player */
298INST(int, Player_Style) /* dark or native: native = 0, dark = 1 */
299INST(int, Player_ControlStyle) /* Big cover or not */
300INST(bool, Player_FadingCover) /* If cover buttons should fade */
301INST(bool, Player_Fullscreen) /* player fullscreen */
302INST(bool, Player_Maximized) /* player maximized */
303INST(QByteArray, Player_Geometry) /* player geometry */
304INST(QString, Player_ShownPlugin) /* current shown plugin in player, empty if none */
305INST(bool, Player_OneInstance) /* only one Sayonara instance is allowed */
306INST(bool, Player_Min2Tray) /* minimize Sayonara to tray */
307INST(bool, Player_ShowTrayIcon) /* Show/hide the tray icon */
308INST(bool, Player_StartInTray) /* start in tray */
309INST(bool, Player_514Fix) /* https://bugs.archlinux.org/task/59451 */
310INST(bool, Player_NotifyNewVersion) /* check for new version on startup */
311INST(QByteArray, Player_SplitterState) /* spliter state between playlist and library */
312//INST(RawShortcutMap, Player_Shortcuts) /* player shortcuts */
313INST(QByteArray, Player_SplitterControls) /* Splitter state between controls and playlist */
314INST(QByteArray, Player_PrivId) /* Unique identifier */
315INST(QByteArray, Player_PublicId) /* Unique identifier */
316
317INST(QStringList,
318 PL_Playlist) /* old playlist: list of integers in case of library tracks, if no library track, filepath */
319INST(bool, PL_LoadSavedPlaylists) /* load saved playlists on startup */
320INST(bool, PL_LoadTemporaryPlaylists) /* load temporary playlists on startup */
321INST(bool, PL_LoadLastTrack) /* load last track on startup */
322INST(bool, PL_RememberTime) /* remember time of last track */
323INST(bool, PL_StartPlaying) /* start playing immediately when opening Sayonara */
324INST(int, PL_LastTrack) /* last track idx in playlist */
325INST(int, PL_LastTrackBeforeStop) /* last track before stop */
326INST(int, PL_LastPlaylist) /* last Playlist id, where LastTrack has been played */
327INST(QString, PL_EntryLook) /* formatting of playlist entry */
328INST(bool, PL_ShowClearButton) /* show clear button in playlist */
329INST(Playlist::Mode, PL_Mode) /* playlist mode: rep1, repAll, shuffle... */
330INST(bool, PL_ShowNumbers) /* show numbers in playlist */
331INST(bool, PL_ShowBottomBar) /* Show bottom bar in playlist */
332INST(bool, PL_RememberTrackAfterStop) /* when stop button is pressed, remember last track index */
333INST(bool, PL_ShowCovers) /* Show covers in Playlist */
334INST(bool, PL_ShowRating) /* Show rating in playlist */
335INST(bool, PL_CurrentTrackCustomColorStandard) /* use custom color in standard theme */
336INST(QString, PL_CurrentTrackColorStringStandard) /* custom color string in standard theme */
337INST(bool, PL_CurrentTrackCustomColorDark) /* use custom color in dark theme */
338INST(QString, PL_CurrentTrackColorStringDark) /* custom color in dark theme */
339INST(bool, PL_JumpToCurrentTrack) /* jump to current track when track changes */
340
341INST(bool, Notification_Show) /* show notifications */
342INST(int, Notification_Timeout) /* notification timeout */
343INST(QString, Notification_Name) /* type of notifications: libnotify or empty for native baloons :( */
344
345INST(int, AudioConvert_NumberThreads) /* Number of threads */
346INST(QString, AudioConvert_PreferredConverter) /* Preferred Converter: ogg, lame cbr, lame vbr */
347INST(int, AudioConvert_QualityLameVBR) /* Lame Quality for variable bitrate 1-10 */
348INST(int, AudioConvert_QualityLameCBR) /* 64 - 320 */
349INST(int, AudioConvert_QualityOgg) /* 1 - 10 */
350
351INST(QString, Engine_Name) /* Deprecated: Engine name */
352INST(int, Engine_Vol) /* Volume */
353INST(bool, Engine_Mute) /* Muted/unmuted */
354INST(int, Engine_CurTrackPos_s) /* position of track (used to load old position) */
355INST(QString, Engine_CovertTargetPath) /* last convert path */
356INST(int, Engine_SpectrumBins) /* number of spectrum bins */
357INST(bool, Engine_ShowSpectrum) /* show spectrum */
358INST(bool, Engine_ShowLevel) /* show level */
359INST(bool, Engine_CrossFaderActive) /* crossfader, but not gapless active */
360INST(int, Engine_CrossFaderTime) /* crossfader overlap time */
361INST(int, Engine_Pitch) /* hertz of a */
362INST(bool, Engine_SpeedActive) /* is speed control active? */
363INST(float, Engine_Speed) /* if yes, set speed */
364INST(bool, Engine_PreservePitch) /* if yes, should pitch be preserved? */
365INST(QString, Engine_Sink) /* Alsa, pulseaudio */
366INST(QString, Engine_AlsaDevice) /* Specific alsa device */
367INST(int, Engine_BufferSizeMS) /* Buffer size for streaming */
368
369INST(bool, Engine_SR_Active) /* Streamripper active */
370INST(bool, Engine_SR_Warning) /* streamripper warnings */
371INST(QString, Engine_SR_Path) /* streamripper paths */
372INST(bool, Engine_SR_SessionPath) /* create streamripper session path? */
373INST(QString, Engine_SR_SessionPathTemplate) /* streamripper session path template*/
374INST(bool, Engine_SR_AutoRecord) /* streamripper automatic recording */
375
376INST(int, Spectrum_Style) /* index of spectrum style */
377INST(int, Level_Style) /* index of level style */
378INST(bool, Broadcast_Active) /* is broadcast active? */
379INST(bool, Broadcast_Prompt) /* prompt when new connection arrives? */
380INST(int, Broadcast_Port) /* broadcast port */
381
382INST(bool, Remote_Active) /* Remote control activated */
383INST(int, Remote_Port) /* Remote control port */
384INST(bool, Remote_Discoverable) /* broadcast is discoverable via UDP */
385INST(int, Remote_DiscoverPort) /* UDP port for remote discovering */
386
387INST(bool, Stream_NewTab) /* Open Streams in new tab */
388INST(bool, Stream_ShowHistory) /* Show history when playing streams */
389INST(QSize, Stream_SearchWindowSize)
390
391INST(int, Lyrics_Zoom) /* Zoom factor in lyrics window */
392INST(QString, Lyrics_Server) /* Lyrics server */
393
394INST(QStringList, Cover_Server) /* Cover server */
395INST(bool, Cover_FetchFromWWW) /* Fetch covers from www */
396INST(bool, Cover_SaveToDB) /* Save covers to DB */
397INST(bool, Cover_StartSearch) /* start alternative cover search automatically */
398INST(bool, Cover_SaveToLibrary) /* Save covers in library */
399INST(bool, Cover_SaveToSayonaraDir) /* Save covers in library */
400INST(QString, Cover_TemplatePath) /* Name of cover file in library */
401INST(QString, Icon_Theme) /* Current icon theme */
402INST(bool, Icon_ForceInDarkTheme) /* Current icon theme */
403
404INST(bool, Proxy_Active) /* Is proxy server active */
405INST(QString, Proxy_Username) /* Proxy Username */
406INST(QString, Proxy_Password) /* Proxy Password */
407INST(QString, Proxy_Hostname) /* Proxy Hostname/IP Address */
408INST(int, Proxy_Port) /* Proxy Port 3128 */
409INST(bool, Proxy_SavePw) /* Should password be saved */
410
411INST(int, Speed_LastTab) /* Last tab selected int he speed/pitch plugin */
412
413INST(QSize, InfoDialog_Size) /* Size of Info Dialog */
414INST(QSize, AlternativeCovers_Size) /* Size of Alternative Cover Dialog */
415
416INST(int, Settings_Revision) /* Version number of settings */
417
418INST(int, Logger_Level) /* Also log development: */
419
420INST_NO_DB(bool, MP3enc_found)
421INST_NO_DB(bool, Pitch_found)
422INST_NO_DB(bool, Player_Quit)
423
424#endif // SETTINGKEY_H
The EQ_Setting class. Container for Equalizer configurations.
Definition: EqualizerSetting.h:35
The Sortings class.
Definition: Sorting.h:37
The Mode class.
Definition: PlaylistMode.h:42
Definition: EngineUtils.h:33
Definition: SettingKey.h:217
INST(bool, LFM_Active) INST(int
Set namespace defines the setting: Which key and which type.
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31
Definition: typedefs.h:33
The RawShortcutMap struct consisting of a specifier writable into database and a shortcut....
Definition: RawShortcutMap.h:38