1 /***************************************************************************
2 * Copyright (C) 2008-2009 by Andrzej Rybczak *
3 * electricityispower@gmail.com *
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. *
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. *
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 ***************************************************************************/
27 #include <mpd/client.h>
33 # define HOME_FOLDER "\\ncmpcpp\\"
35 # define HOME_FOLDER "/.ncmpcpp/"
38 const std::string config_dir
= home_path
+ HOME_FOLDER
;
39 const int null_key
= std::numeric_limits
<int>::max();
43 Column() : right_alignment(0), display_empty_tag(1) { }
50 bool display_empty_tag
;
66 int ScreenSwitcher
[2];
72 int PlaylistEditor
[2];
88 int ToggleReplayGainMode
[2];
89 int ToggleSpaceMode
[2];
93 int ToggleCrossfade
[2];
100 int NextFoundPosition
[2];
101 int PrevFoundPosition
[2];
102 int ToggleFindMode
[2];
108 int ReverseSelection
[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];
129 struct ncmpcpp_config
131 std::string mpd_host
;
132 std::string mpd_music_dir
;
133 std::string visualizer_fifo_path
;
134 std::string empty_tag
;
135 std::string song_list_columns_format
;
136 std::string song_list_format
;
137 std::string song_status_format
;
138 std::string song_status_format_no_colors
;
139 std::string song_window_title_format
;
140 std::string song_library_format
;
141 std::string tag_editor_album_format
;
142 std::string external_editor
;
143 std::string system_encoding
;
144 std::string execute_on_song_change
;
145 std::string new_header_first_line
;
146 std::string new_header_second_line
;
147 std::basic_string
<my_char_t
> progressbar
;
151 std::vector
<Column
> columns
;
153 Buffer browser_playlist_prefix
;
154 Buffer selected_item_prefix
;
155 Buffer selected_item_suffix
;
156 Buffer now_playing_prefix
;
157 basic_buffer
<my_char_t
> now_playing_suffix
;
161 Color empty_tags_color
;
164 Color state_line_color
;
165 Color state_flags_color
;
167 Color main_highlight_color
;
168 Color progressbar_color
;
169 Color statusbar_color
;
170 Color alternative_ui_separator_color
;
171 Color active_column_color
;
173 Border window_border
;
174 Border active_window_border
;
176 mpd_tag_type media_lib_primary_tag
;
179 bool fancy_scrolling
;
180 bool playlist_show_remaining_time
;
181 bool columns_in_playlist
;
182 bool columns_in_browser
;
183 bool columns_in_search_engine
;
184 bool set_window_title
;
185 bool header_visibility
;
186 bool header_text_scrolling
;
187 bool statusbar_visibility
;
188 bool autocenter_mode
;
191 bool ncmpc_like_songs_adding
;
192 bool albums_in_tag_editor
;
193 bool incremental_seeking
;
194 bool now_playing_lyrics
;
195 bool local_browser_show_hidden_files
;
197 bool display_screens_numbers_on_start
;
198 bool jump_to_now_playing_song_at_start
;
199 bool clock_display_seconds
;
200 bool display_bitrate
;
201 bool display_remaining_time
;
202 bool ignore_leading_the
;
203 bool block_search_constraints_change
;
204 bool use_console_editor
;
205 bool use_cyclic_scrolling
;
206 bool allow_physical_files_deletion
;
207 bool allow_physical_directories_deletion
;
208 bool ask_before_clearing_main_playlist
;
211 bool visualizer_use_wave
;
212 bool browser_sort_by_mtime
;
215 int mpd_connection_timeout
;
218 int playlist_disable_highlight_delay
;
219 int message_delay_time
;
223 unsigned lines_scrolled
;
226 extern ncmpcpp_config Config
;
227 extern ncmpcpp_keys Key
;
229 void CreateConfigDir();
230 void SetWindowsDimensions(size_t &header_height
, size_t &footer_start_y
, size_t &footer_height
);
231 void DefaultKeys(ncmpcpp_keys
&);
232 void DefaultConfiguration(ncmpcpp_config
&);
233 void ReadKeys(ncmpcpp_keys
&);
234 void ReadConfiguration(ncmpcpp_config
&);