fix drawing selected_item_{prefix,suffix}
[ncmpcpp.git] / src / settings.h
blob7b755d037cb97fc7ceabe2b712b9028b3f174b0e
1 /***************************************************************************
2 * Copyright (C) 2008-2009 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 struct Column
43 Column() : right_alignment(0), display_empty_tag(1) { }
45 unsigned width;
46 Color color;
47 char type;
48 bool fixed;
49 bool right_alignment;
50 bool display_empty_tag;
53 struct ncmpcpp_keys
55 int Up[2];
56 int Down[2];
57 int PageUp[2];
58 int PageDown[2];
59 int Home[2];
60 int End[2];
61 int Space[2];
62 int Enter[2];
63 int Delete[2];
64 int VolumeUp[2];
65 int VolumeDown[2];
66 int ScreenSwitcher[2];
67 int Help[2];
68 int Playlist[2];
69 int Browser[2];
70 int SearchEngine[2];
71 int MediaLibrary[2];
72 int PlaylistEditor[2];
73 int TagEditor[2];
74 int Outputs[2];
75 int Visualizer[2];
76 int Clock[2];
77 int ServerInfo[2];
78 int Stop[2];
79 int Pause[2];
80 int Next[2];
81 int Prev[2];
82 int SeekForward[2];
83 int SeekBackward[2];
84 int ToggleRepeat[2];
85 int ToggleRandom[2];
86 int ToggleSingle[2];
87 int ToggleConsume[2];
88 int ToggleReplayGainMode[2];
89 int ToggleSpaceMode[2];
90 int ToggleAddMode[2];
91 int ToggleMouse[2];
92 int Shuffle[2];
93 int ToggleCrossfade[2];
94 int SetCrossfade[2];
95 int UpdateDB[2];
96 int SortPlaylist[2];
97 int ApplyFilter[2];
98 int FindForward[2];
99 int FindBackward[2];
100 int NextFoundPosition[2];
101 int PrevFoundPosition[2];
102 int ToggleFindMode[2];
103 int EditTags[2];
104 int SongInfo[2];
105 int ArtistInfo[2];
106 int GoToPosition[2];
107 int Lyrics[2];
108 int ReverseSelection[2];
109 int DeselectAll[2];
110 int AddSelected[2];
111 int Clear[2];
112 int Crop[2];
113 int MvSongUp[2];
114 int MvSongDown[2];
115 int MoveTo[2];
116 int Add[2];
117 int SavePlaylist[2];
118 int GoToNowPlaying[2];
119 int GoToContainingDir[2];
120 int ToggleAutoCenter[2];
121 int ToggleDisplayMode[2];
122 int ToggleInterface[2];
123 int ToggleLyricsDB[2];
124 int GoToParentDir[2];
125 int SwitchTagTypeList[2];
126 int Quit[2];
129 struct ncmpcpp_config
131 std::string mpd_host;
132 std::string mpd_music_dir;
133 std::string visualizer_fifo_path;
134 std::string visualizer_output_name;
135 std::string empty_tag;
136 std::string song_list_columns_format;
137 std::string song_list_format;
138 std::string song_status_format;
139 std::string song_status_format_no_colors;
140 std::string song_window_title_format;
141 std::string song_library_format;
142 std::string tag_editor_album_format;
143 std::string external_editor;
144 std::string system_encoding;
145 std::string execute_on_song_change;
146 std::string new_header_first_line;
147 std::string new_header_second_line;
148 std::basic_string<my_char_t> progressbar;
150 std::string pattern;
152 std::vector<Column> columns;
154 Buffer browser_playlist_prefix;
155 Buffer selected_item_prefix;
156 Buffer selected_item_suffix;
157 Buffer now_playing_prefix;
158 basic_buffer<my_char_t> now_playing_suffix;
160 Color color1;
161 Color color2;
162 Color empty_tags_color;
163 Color header_color;
164 Color volume_color;
165 Color state_line_color;
166 Color state_flags_color;
167 Color main_color;
168 Color main_highlight_color;
169 Color progressbar_color;
170 Color statusbar_color;
171 Color alternative_ui_separator_color;
172 Color active_column_color;
174 Border window_border;
175 Border active_window_border;
177 mpd_tag_type media_lib_primary_tag;
179 bool enable_idle_notifications;
180 bool colors_enabled;
181 bool fancy_scrolling;
182 bool playlist_show_remaining_time;
183 bool columns_in_playlist;
184 bool columns_in_browser;
185 bool columns_in_search_engine;
186 bool set_window_title;
187 bool header_visibility;
188 bool header_text_scrolling;
189 bool statusbar_visibility;
190 bool centered_cursor;
191 bool screen_switcher_browser_only;
192 bool autocenter_mode;
193 bool wrapped_search;
194 bool space_selects;
195 bool ncmpc_like_songs_adding;
196 bool albums_in_tag_editor;
197 bool incremental_seeking;
198 bool now_playing_lyrics;
199 bool local_browser_show_hidden_files;
200 bool search_in_db;
201 bool display_screens_numbers_on_start;
202 bool jump_to_now_playing_song_at_start;
203 bool clock_display_seconds;
204 bool display_bitrate;
205 bool display_remaining_time;
206 bool ignore_leading_the;
207 bool block_search_constraints_change;
208 bool use_console_editor;
209 bool use_cyclic_scrolling;
210 bool allow_physical_files_deletion;
211 bool allow_physical_directories_deletion;
212 bool ask_before_clearing_main_playlist;
213 bool mouse_support;
214 bool mouse_list_scroll_whole_page;
215 bool new_design;
216 bool visualizer_use_wave;
217 bool browser_sort_by_mtime;
218 bool tag_editor_extended_numeration;
220 int mpd_port;
221 int mpd_connection_timeout;
222 int crossfade_time;
223 int seek_time;
224 int playlist_disable_highlight_delay;
225 int message_delay_time;
226 int lyrics_db;
227 int regex_type;
229 unsigned lines_scrolled;
231 size_t selected_item_suffix_length;
234 extern ncmpcpp_config Config;
235 extern ncmpcpp_keys Key;
237 void CreateConfigDir();
238 void SetWindowsDimensions(size_t &header_height, size_t &footer_start_y, size_t &footer_height);
239 void DefaultKeys(ncmpcpp_keys &);
240 void DefaultConfiguration(ncmpcpp_config &);
241 void ReadKeys(ncmpcpp_keys &);
242 void ReadConfiguration(ncmpcpp_config &);
244 #endif