update copyright notices
[ncmpcpp.git] / src / settings.h
blob8c1adf07d41a54bb350b84043e664879f25ede05
1 /***************************************************************************
2 * Copyright (C) 2008-2010 by Andrzej Rybczak *
3 * electricityispower@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 *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef _SETTINGS_H
22 #define _SETTINGS_H
24 #include <limits>
25 #include <vector>
27 #include <mpd/client.h>
29 #include "home.h"
30 #include "ncmpcpp.h"
32 #ifdef WIN32
33 # define HOME_FOLDER "\\ncmpcpp\\"
34 #else
35 # define HOME_FOLDER "/.ncmpcpp/"
36 #endif // WIN32
38 const std::string config_dir = home_path + HOME_FOLDER;
39 const int null_key = std::numeric_limits<int>::max();
41 class BasicScreen; // forward declaration for screens sequence
43 struct Column
45 Column() : right_alignment(0), display_empty_tag(1) { }
47 unsigned width;
48 Color color;
49 char type;
50 bool fixed;
51 bool right_alignment;
52 bool display_empty_tag;
55 struct ncmpcpp_keys
57 int Up[2];
58 int Down[2];
59 int PageUp[2];
60 int PageDown[2];
61 int Home[2];
62 int End[2];
63 int Space[2];
64 int Enter[2];
65 int Delete[2];
66 int VolumeUp[2];
67 int VolumeDown[2];
68 int ScreenSwitcher[2];
69 int Help[2];
70 int Playlist[2];
71 int Browser[2];
72 int SearchEngine[2];
73 int MediaLibrary[2];
74 int PlaylistEditor[2];
75 int TagEditor[2];
76 int Outputs[2];
77 int Visualizer[2];
78 int Clock[2];
79 int ServerInfo[2];
80 int Stop[2];
81 int Pause[2];
82 int Next[2];
83 int Prev[2];
84 int SeekForward[2];
85 int SeekBackward[2];
86 int ToggleRepeat[2];
87 int ToggleRandom[2];
88 int ToggleSingle[2];
89 int ToggleConsume[2];
90 int ToggleReplayGainMode[2];
91 int ToggleSpaceMode[2];
92 int ToggleAddMode[2];
93 int ToggleMouse[2];
94 int Shuffle[2];
95 int ToggleCrossfade[2];
96 int SetCrossfade[2];
97 int UpdateDB[2];
98 int SortPlaylist[2];
99 int ApplyFilter[2];
100 int FindForward[2];
101 int FindBackward[2];
102 int NextFoundPosition[2];
103 int PrevFoundPosition[2];
104 int ToggleFindMode[2];
105 int EditTags[2];
106 int SongInfo[2];
107 int ArtistInfo[2];
108 int GoToPosition[2];
109 int Lyrics[2];
110 int ReverseSelection[2];
111 int DeselectAll[2];
112 int AddSelected[2];
113 int Clear[2];
114 int Crop[2];
115 int MvSongUp[2];
116 int MvSongDown[2];
117 int MoveTo[2];
118 int Add[2];
119 int SavePlaylist[2];
120 int GoToNowPlaying[2];
121 int GoToContainingDir[2];
122 int GoToMediaLibrary[2];
123 int ToggleAutoCenter[2];
124 int ToggleDisplayMode[2];
125 int ToggleInterface[2];
126 int ToggleLyricsDB[2];
127 int GoToParentDir[2];
128 int SwitchTagTypeList[2];
129 int Quit[2];
132 struct ncmpcpp_config
134 std::string mpd_host;
135 std::string mpd_music_dir;
136 std::string visualizer_fifo_path;
137 std::string visualizer_output_name;
138 std::string empty_tag;
139 std::string song_list_columns_format;
140 std::string song_list_format;
141 std::string song_status_format;
142 std::string song_status_format_no_colors;
143 std::string song_window_title_format;
144 std::string song_library_format;
145 std::string tag_editor_album_format;
146 std::string external_editor;
147 std::string system_encoding;
148 std::string execute_on_song_change;
149 std::string new_header_first_line;
150 std::string new_header_second_line;
151 std::basic_string<my_char_t> progressbar;
153 std::string pattern;
155 std::vector<Column> columns;
157 Buffer browser_playlist_prefix;
158 Buffer selected_item_prefix;
159 Buffer selected_item_suffix;
160 Buffer now_playing_prefix;
161 basic_buffer<my_char_t> now_playing_suffix;
163 Color color1;
164 Color color2;
165 Color empty_tags_color;
166 Color header_color;
167 Color volume_color;
168 Color state_line_color;
169 Color state_flags_color;
170 Color main_color;
171 Color main_highlight_color;
172 Color progressbar_color;
173 Color statusbar_color;
174 Color alternative_ui_separator_color;
175 Color active_column_color;
177 Border window_border;
178 Border active_window_border;
180 mpd_tag_type media_lib_primary_tag;
182 bool enable_idle_notifications;
183 bool colors_enabled;
184 bool fancy_scrolling;
185 bool playlist_show_remaining_time;
186 bool columns_in_playlist;
187 bool columns_in_browser;
188 bool columns_in_search_engine;
189 bool set_window_title;
190 bool header_visibility;
191 bool header_text_scrolling;
192 bool statusbar_visibility;
193 bool centered_cursor;
194 bool screen_switcher_previous;
195 bool autocenter_mode;
196 bool wrapped_search;
197 bool space_selects;
198 bool ncmpc_like_songs_adding;
199 bool albums_in_tag_editor;
200 bool incremental_seeking;
201 bool now_playing_lyrics;
202 bool local_browser_show_hidden_files;
203 bool search_in_db;
204 bool display_screens_numbers_on_start;
205 bool jump_to_now_playing_song_at_start;
206 bool clock_display_seconds;
207 bool display_bitrate;
208 bool display_remaining_time;
209 bool ignore_leading_the;
210 bool block_search_constraints_change;
211 bool use_console_editor;
212 bool use_cyclic_scrolling;
213 bool allow_physical_files_deletion;
214 bool allow_physical_directories_deletion;
215 bool ask_before_clearing_main_playlist;
216 bool mouse_support;
217 bool mouse_list_scroll_whole_page;
218 bool new_design;
219 bool visualizer_use_wave;
220 bool browser_sort_by_mtime;
221 bool tag_editor_extended_numeration;
222 bool media_library_display_date;
223 bool discard_column_colors_if_item_is_selected;
225 int mpd_port;
226 int mpd_connection_timeout;
227 int crossfade_time;
228 int seek_time;
229 int playlist_disable_highlight_delay;
230 int message_delay_time;
231 int lyrics_db;
232 int regex_type;
234 unsigned lines_scrolled;
235 unsigned search_engine_default_search_mode;
237 size_t selected_item_suffix_length;
239 std::list<BasicScreen *> screens_seq;
242 extern ncmpcpp_config Config;
243 extern ncmpcpp_keys Key;
245 void CreateConfigDir();
246 void SetWindowsDimensions(size_t &header_height, size_t &footer_start_y, size_t &footer_height);
247 void DefaultKeys(ncmpcpp_keys &);
248 void DefaultConfiguration(ncmpcpp_config &);
249 void ReadKeys(ncmpcpp_keys &);
250 void ReadConfiguration(ncmpcpp_config &);
252 #endif