Sayonara Player
SettingKey.h
1 /* SettingKey.h */
2 
3 /* Copyright (C) 2011-2015 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 
22 
23 #ifndef SETTINGKEY_H
24 #define SETTINGKEY_H
25 
26 #include "Helper/globals.h"
27 //#include "Helper/EqualizerPresets.h"
28 //#include "GUI/Helper/Shortcuts/RawShortcutMap.h"
29 //#include "Helper/PlaylistMode.h"
30 //#include "Components/Library/Sorting.h"
31 //#include <QString>
32 //#include <QPoint>
33 //#include <QSize>
34 class QString;
35 class QPoint;
36 class QSize;
37 class LibSortOrder;
38 struct EQ_Setting;
39 struct PlaylistMode;
40 struct RawShortcutMap;
41 
42 
47 namespace SK {
48  enum SettingKey {
49 
50  LFM_Active=0,
51  LFM_Login,
52  LFM_Corrections,
53  LFM_ShowErrors,
54  LFM_SessionKey,
55 
56  Eq_Last,
57  Eq_List,
58  Eq_Gauss,
59 
60  Lib_Show,
61  Lib_Path,
62  Lib_ColsTitle,
63  Lib_ColsArtist,
64  Lib_ColsAlbum,
65  Lib_LiveSearch,
66  Lib_Sorting,
67  Lib_CurPlugin,
68  Lib_SplitterStateArtist,
69  Lib_SplitterStateTrack,
70  Lib_SplitterStateGenre,
71  Lib_OldWidth,
72  Lib_DC_DoNothing,
73  Lib_DC_PlayIfStopped,
74  Lib_DC_PlayImmediately,
75  Lib_DD_DoNothing,
76  Lib_DD_PlayIfStoppedAndEmpty,
77  Lib_FontSize,
78  Lib_FontBold,
79 
80  Player_Version,
81  Player_Language,
82  Player_FontName,
83  Player_FontSize,
84  Player_Style,
85  Player_Size,
86  Player_Pos,
87  Player_Fullscreen,
88  Player_Maximized,
89  Player_ShownPlugin,
90  Player_OneInstance,
91  Player_Min2Tray,
92  Player_StartInTray,
93  Player_NotifyNewVersion,
94  Player_SplitterState,
95  Player_Shortcuts,
96 
97  PL_Playlist,
98  PL_LoadSavedPlaylists,
99  PL_LoadTemporaryPlaylists,
100  PL_LoadLastTrack,
101  PL_RememberTime,
102  PL_StartPlaying,
103  PL_LastTrack,
104  PL_LastPlaylist,
105  PL_Mode,
106  PL_ShowNumbers,
107  PL_EntryLook,
108  PL_FontSize,
109 
110  Notification_Show,
111  Notification_Timeout,
112  Notification_Name,
113 
114  Engine_Name,
115  Engine_Vol,
116  Engine_Mute,
117  Engine_ConvertQuality,
118  Engine_CovertTargetPath,
119  Engine_Gapless,
120  Engine_ShowSpectrum,
121  Engine_ShowLevel,
122  Engine_CurTrackPos_s,
123 
124  Engine_SR_Active,
125  Engine_SR_Warning,
126  Engine_SR_Path,
127  Engine_SR_SessionPath,
128 
129  Spectrum_Style,
130  Level_Style,
131 
132  Broadcast_Active,
133  Broadcast_Prompt,
134  Broadcast_Port,
135 
136  MP3enc_found,
137  Player_Quit,
138 
139  Remote_Active,
140  Remote_Port,
141 
142  Num_Setting_Keys
143  };
144 }
145 
146 template<typename T, SK::SettingKey S>
148 {
149  public:
150  T* p=nullptr;
151  SettingKey(){}
152  ~SettingKey(){}
153 };
154 
155 
156 /*
157  * typedef SettingKey<QString, SK::Lib_Path> LibPath_t; LibPath_t LibPath;
158  *
159  */
160 
167 #define INST(type, settingkey) typedef SettingKey<type, SK:: settingkey> settingkey##_t; const settingkey##_t settingkey
168 
173 namespace Set {
174 
175  //typedef SettingKey<bool, SK::LFM_Active> LFM_Active_t; const LFM_Active_t LFM_Active
176  INST(bool, LFM_Active); /* is lastFM active? */
177  INST(StringPair, LFM_Login); /* 2-Tupel, username, password */
178 
179  INST(bool, LFM_Corrections); /* propose lfm corrections */
180  INST(bool, LFM_ShowErrors); /* get error message, if there are lfm problems */
181  INST(QString, LFM_SessionKey); /* lfm session key */
182 
183  INST(int, Eq_Last); /* last equalizer index */
184  INST(QList<EQ_Setting>, Eq_List); /* All equalizers */
185  INST(bool, Eq_Gauss); /* do curve, when changing eq setting */
186 
187  INST(bool, Lib_Show); /* show library */
188  INST(QString, Lib_Path); /* library path */
189  INST(BoolList, Lib_ColsTitle); /* shown columns tracks */
190  INST(BoolList, Lib_ColsArtist); /* shown columns artist */
191  INST(BoolList, Lib_ColsAlbum); /* shown columns albums */
192  INST(bool, Lib_LiveSearch); /* library live search */
193  INST(LibSortOrder, Lib_Sorting); /* how to sort in lib */
194  INST(QString, Lib_CurPlugin); /* Current shown library plugin */
195  INST(QByteArray, Lib_SplitterStateArtist); /* Splitter state between artists and albums */
196  INST(QByteArray, Lib_SplitterStateTrack); /* Splitter state between artists and tracks */
197  INST(QByteArray, Lib_SplitterStateGenre); /* Splitter state between tracks and genres */
198  INST(int, Lib_OldWidth); /* Old library width when hiding library */
199  INST(bool, Lib_DC_DoNothing); /* when double clicked, create playlist and do nothing*/
200  INST(bool, Lib_DC_PlayIfStopped); /* when double clicked, play if stopped */
201  INST(bool, Lib_DC_PlayImmediately); /* when double clicked, play immediately */
202  INST(bool, Lib_DD_DoNothing); /* when drag dropped, insert tracks and do nothing */
203  INST(bool, Lib_DD_PlayIfStoppedAndEmpty); /* when drag dropped, play if playlist is empty and stopped */
204  INST(int, Lib_FontSize); /* current library font size */
205  INST(bool, Lib_FontBold); /* current library font weight */
206 
207 
208 
209  INST(QString, Player_Version); /* Version string of player */
210  INST(QString, Player_Language); /* language of player */
211  INST(int, Player_Style); /* dark or native: native = 0, dark = 1 */
212  INST(QString, Player_FontName); /* current font name */
213  INST(int, Player_FontSize); /* current font size */
214  INST(QSize, Player_Size); /* player size */
215  INST(QPoint, Player_Pos); /* player position */
216  INST(bool, Player_Fullscreen); /* player fullscreen */
217  INST(bool, Player_Maximized); /* player maximized */
218  INST(QString, Player_ShownPlugin); /* current shown plugin in player, empty if none */
219  INST(bool, Player_OneInstance); /* only one Sayonara instance is allowed */
220  INST(bool, Player_Min2Tray); /* minimize Sayonara to tray */
221  INST(bool, Player_StartInTray); /* start in tray */
222  INST(bool, Player_NotifyNewVersion); /* check for new version on startup */
223  INST(QByteArray, Player_SplitterState); /* spliter state between playlist and library */
224  INST(RawShortcutMap, Player_Shortcuts); /* player shortcuts */
225 
226  INST(QStringList, PL_Playlist); /* old playlist: list of integers in case of library tracks, if no library track, filepath */
227  INST(bool, PL_LoadSavedPlaylists); /* load saved playlists on startup */
228  INST(bool, PL_LoadTemporaryPlaylists); /* load temporary playlists on startup */
229  INST(bool, PL_LoadLastTrack); /* load last track on startup */
230  INST(bool, PL_RememberTime); /* remember time of last track */
231  INST(bool, PL_StartPlaying); /* start playing immediately when opening Sayonara */
232  INST(int, PL_LastTrack); /* last track idx in playlist */
233  INST(int, PL_LastPlaylist); /* last Playlist id, where LastTrack has been played */
234  INST(QString, PL_EntryLook); /* formatting of playlist entry */
235  INST(int, PL_FontSize); /* current playlist font size */
236 
237  INST(PlaylistMode, PL_Mode); /* playlist mode: rep1, repAll, shuffle... */
238  INST(bool, PL_ShowNumbers); /* show numbers in playlist */
239 
240  INST(bool, Notification_Show); /* show notifications */
241  INST(int, Notification_Timeout); /* notification timeout */
242  INST(QString, Notification_Name); /* type of notifications: libnotify or empty for native baloons :( */
243 
244  INST(QString, Engine_Name); /* Deprecated: Engine name */
245  INST(int, Engine_Vol); /* Volume */
246  INST(bool, Engine_Mute); /* Muted/unmuted */
247  INST(int, Engine_CurTrackPos_s); /* position of track (used to load old position) */
248  INST(int, Engine_ConvertQuality); /* Convert quality, 1-10 for variable, > 64 for fixed bitrate */
249  INST(QString, Engine_CovertTargetPath); /* last convert path */
250  INST(bool, Engine_Gapless); /* gapless playback */
251  INST(bool, Engine_ShowSpectrum); /* show spectrum */
252  INST(bool, Engine_ShowLevel); /* show level */
253 
254 
255  INST(bool, Engine_SR_Active); /* Streamripper active */
256  INST(bool, Engine_SR_Warning); /* streamripper warnings */
257  INST(QString, Engine_SR_Path); /* streamripper paths */
258  INST(bool, Engine_SR_SessionPath); /* streamripper session path */
259 
260  INST(int, Spectrum_Style); /* index of spectrum style */
261  INST(int, Level_Style); /* index of level style */
262  INST(bool, Broadcast_Active); /* is broadcast active? */
263  INST(bool, Broadcast_Prompt); /* prompt when new connection arrives? */
264  INST(int, Broadcast_Port); /* broadcast port */
265 
266  INST(bool, Remote_Active); /* Remote control activated */
267  INST(int, Remote_Port); /* Remote control port */
268 
269 
270 
271 }
272 
273 namespace SetNoDB{
274 
275  INST(bool, MP3enc_found);
276  INST(bool, Player_Quit);
277 
278 }
279 
280 
281 
282 #endif // SETTINGKEY_H
Definition: Sorting.h:75
#define INST(type, settingkey)
MACRO INST use this macro to declare a setting: INST(boo, LFM_Active) is expanded to typedef Setting...
Definition: SettingKey.h:167
Definition: SettingKey.h:147
Definition: PlaylistMode.h:34
Set namespace defines the setting: Which key and which type.
Definition: SettingKey.h:173
The SK namespace is used to access setting keys.
Definition: SettingKey.h:47
Definition: SettingKey.h:273
The RawShortcutMap struct consisting of a specifier writable into database and a shortcut. This class is used for converting a shortcut map into its database representation.
Definition: RawShortcutMap.h:35
Definition: EqualizerPresets.h:29