1 /***************************************************************************
2 * Copyright (C) 2008-2016 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 ***************************************************************************/
21 #ifndef NCMPCPP_SETTINGS_H
22 #define NCMPCPP_SETTINGS_H
24 #include <boost/date_time/posix_time/posix_time_types.hpp>
25 #include <boost/optional.hpp>
26 #include <boost/regex.hpp>
29 #include <mpd/client.h>
33 #include "lyrics_fetcher.h"
34 #include "screen_type.h"
35 #include "strbuffer.h"
39 Column() : stretch_limit(-1), right_alignment(0), display_empty_tag(1) { }
48 bool display_empty_tag
;
54 : playlist_disable_highlight_delay(0), visualizer_sync_interval(0)
57 bool read(const std::vector
<std::string
> &config_paths
, bool ignore_errors
);
59 std::string ncmpcpp_directory
;
60 std::string lyrics_directory
;
62 std::string mpd_music_dir
;
63 std::string visualizer_fifo_path
;
64 std::string visualizer_output_name
;
65 std::string empty_tag
;
67 Format::AST
<char> song_list_format
;
68 Format::AST
<char> song_window_title_format
;
69 Format::AST
<char> song_library_format
;
70 Format::AST
<char> song_columns_mode_format
;
71 Format::AST
<char> browser_sort_format
;
72 Format::AST
<char> song_status_format
;
73 Format::AST
<wchar_t> song_status_wformat
;
74 Format::AST
<wchar_t> new_header_first_line
;
75 Format::AST
<wchar_t> new_header_second_line
;
77 std::string external_editor
;
78 std::string system_encoding
;
79 std::string execute_on_song_change
;
80 std::string execute_on_player_state_change
;
81 std::string lastfm_preferred_language
;
82 std::wstring progressbar
;
83 std::wstring visualizer_chars
;
87 std::vector
<Column
> columns
;
89 DisplayMode playlist_display_mode
;
90 DisplayMode browser_display_mode
;
91 DisplayMode search_engine_display_mode
;
92 DisplayMode playlist_editor_display_mode
;
94 NC::Buffer browser_playlist_prefix
;
95 NC::Buffer selected_item_prefix
;
96 NC::Buffer selected_item_suffix
;
97 NC::Buffer now_playing_prefix
;
98 NC::Buffer now_playing_suffix
;
99 NC::Buffer modified_item_prefix
;
103 NC::Color empty_tags_color
;
104 NC::Color header_color
;
105 NC::Color volume_color
;
106 NC::Color state_line_color
;
107 NC::Color state_flags_color
;
108 NC::Color main_color
;
109 NC::Color main_highlight_color
;
110 NC::Color progressbar_color
;
111 NC::Color progressbar_elapsed_color
;
112 NC::Color statusbar_color
;
113 NC::Color alternative_ui_separator_color
;
114 NC::Color active_column_color
;
116 std::vector
<NC::Color
> visualizer_colors
;
117 VisualizerType visualizer_type
;
119 NC::Border window_border
;
120 NC::Border active_window_border
;
124 SpaceAddMode space_add_mode
;
126 mpd_tag_type media_lib_primary_tag
;
129 bool playlist_show_mpd_host
;
130 bool playlist_show_remaining_time
;
131 bool playlist_shorten_total_times
;
132 bool playlist_separate_albums
;
133 bool set_window_title
;
134 bool header_visibility
;
135 bool header_text_scrolling
;
136 bool statusbar_visibility
;
137 bool titles_visibility
;
138 bool centered_cursor
;
139 bool screen_switcher_previous
;
140 bool autocenter_mode
;
142 bool incremental_seeking
;
143 bool now_playing_lyrics
;
144 bool fetch_lyrics_in_background
;
145 bool local_browser_show_hidden_files
;
147 bool jump_to_now_playing_song_at_start
;
148 bool clock_display_seconds
;
149 bool display_volume_level
;
150 bool display_bitrate
;
151 bool display_remaining_time
;
152 bool ignore_leading_the
;
153 bool block_search_constraints_change
;
154 bool use_console_editor
;
155 bool use_cyclic_scrolling
;
156 bool ask_before_clearing_playlists
;
157 bool ask_before_shuffling_playlists
;
159 bool mouse_list_scroll_whole_page
;
160 bool visualizer_in_stereo
;
161 bool data_fetching_delay
;
162 bool media_library_sort_by_mtime
;
163 bool tag_editor_extended_numeration
;
164 bool discard_colors_if_item_is_selected
;
165 bool store_lyrics_in_song_dir
;
166 bool generate_win32_compatible_filenames
;
167 bool ask_for_locked_screen_width_part
;
168 bool allow_for_physical_item_deletion
;
169 bool progressbar_boldness
;
170 bool startup_slave_screen_focus
;
172 unsigned mpd_connection_timeout
;
173 unsigned crossfade_time
;
175 unsigned volume_change_step
;
176 unsigned message_delay_time
;
178 unsigned lines_scrolled
;
179 unsigned search_engine_default_search_mode
;
181 boost::regex::flag_type regex_type
;
183 boost::posix_time::seconds playlist_disable_highlight_delay
;
184 boost::posix_time::seconds visualizer_sync_interval
;
186 double visualizer_sample_multiplier
;
187 double locked_screen_width_part
;
189 size_t selected_item_prefix_length
;
190 size_t selected_item_suffix_length
;
191 size_t now_playing_prefix_length
;
192 size_t now_playing_suffix_length
;
194 ScreenType startup_screen_type
;
195 boost::optional
<ScreenType
> startup_slave_screen_type
;
196 std::vector
<ScreenType
> screen_sequence
;
198 SortMode browser_sort_mode
;
200 LyricsFetchers lyrics_fetchers
;
203 extern Configuration Config
;
205 #endif // NCMPCPP_SETTINGS_H