1 /***************************************************************************
2 * Copyright (C) 2008-2010 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();
41 class BasicScreen
; // forward declaration for screens sequence
45 Column() : right_alignment(0), display_empty_tag(1) { }
52 bool display_empty_tag
;
68 int ScreenSwitcher
[2];
74 int PlaylistEditor
[2];
90 int ToggleReplayGainMode
[2];
91 int ToggleSpaceMode
[2];
95 int ToggleCrossfade
[2];
102 int NextFoundPosition
[2];
103 int PrevFoundPosition
[2];
104 int ToggleFindMode
[2];
110 int ReverseSelection
[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];
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
;
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
;
165 Color empty_tags_color
;
168 Color state_line_color
;
169 Color state_flags_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
;
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
;
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
;
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
;
217 bool mouse_list_scroll_whole_page
;
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
;
226 int mpd_connection_timeout
;
229 int playlist_disable_highlight_delay
;
230 int message_delay_time
;
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
&);