1 /***************************************************************************
2 * Copyright (C) 2008-2017 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>
31 #include "curses/formatted_color.h"
32 #include "curses/strbuffer.h"
35 #include "lyrics_fetcher.h"
36 #include "screens/screen_type.h"
40 Column() : stretch_limit(-1), right_alignment(0), display_empty_tag(1) { }
49 bool display_empty_tag
;
55 : playlist_disable_highlight_delay(0), visualizer_sync_interval(0)
58 bool read(const std::vector
<std::string
> &config_paths
, bool ignore_errors
);
60 std::string ncmpcpp_directory
;
61 std::string lyrics_directory
;
63 std::string mpd_music_dir
;
64 std::string visualizer_fifo_path
;
65 std::string visualizer_output_name
;
66 std::string empty_tag
;
68 Format::AST
<char> song_list_format
;
69 Format::AST
<char> song_window_title_format
;
70 Format::AST
<char> song_library_format
;
71 Format::AST
<char> song_columns_mode_format
;
72 Format::AST
<char> browser_sort_format
;
73 Format::AST
<char> song_status_format
;
74 Format::AST
<wchar_t> song_status_wformat
;
75 Format::AST
<wchar_t> new_header_first_line
;
76 Format::AST
<wchar_t> new_header_second_line
;
78 std::string external_editor
;
79 std::string system_encoding
;
80 std::string execute_on_song_change
;
81 std::string execute_on_player_state_change
;
82 std::string lastfm_preferred_language
;
83 std::wstring progressbar
;
84 std::wstring visualizer_chars
;
88 std::vector
<Column
> columns
;
90 DisplayMode playlist_display_mode
;
91 DisplayMode browser_display_mode
;
92 DisplayMode search_engine_display_mode
;
93 DisplayMode playlist_editor_display_mode
;
95 NC::Buffer browser_playlist_prefix
;
96 NC::Buffer selected_item_prefix
;
97 NC::Buffer selected_item_suffix
;
98 NC::Buffer now_playing_prefix
;
99 NC::Buffer now_playing_suffix
;
100 NC::Buffer modified_item_prefix
;
101 NC::Buffer current_item_prefix
;
102 NC::Buffer current_item_suffix
;
103 NC::Buffer current_item_inactive_column_prefix
;
104 NC::Buffer current_item_inactive_column_suffix
;
106 NC::Color header_color
;
107 NC::Color main_color
;
108 NC::Color statusbar_color
;
110 NC::FormattedColor color1
;
111 NC::FormattedColor color2
;
112 NC::FormattedColor empty_tags_color
;
113 NC::FormattedColor volume_color
;
114 NC::FormattedColor state_line_color
;
115 NC::FormattedColor state_flags_color
;
116 NC::FormattedColor progressbar_color
;
117 NC::FormattedColor progressbar_elapsed_color
;
118 NC::FormattedColor player_state_color
;
119 NC::FormattedColor statusbar_time_color
;
120 NC::FormattedColor alternative_ui_separator_color
;
122 std::vector
<NC::FormattedColor
> visualizer_colors
;
123 VisualizerType visualizer_type
;
125 NC::Border window_border
;
126 NC::Border active_window_border
;
130 SpaceAddMode space_add_mode
;
132 mpd_tag_type media_lib_primary_tag
;
135 bool playlist_show_mpd_host
;
136 bool playlist_show_remaining_time
;
137 bool playlist_shorten_total_times
;
138 bool playlist_separate_albums
;
139 bool set_window_title
;
140 bool header_visibility
;
141 bool header_text_scrolling
;
142 bool statusbar_visibility
;
143 bool titles_visibility
;
144 bool centered_cursor
;
145 bool screen_switcher_previous
;
146 bool autocenter_mode
;
148 bool incremental_seeking
;
149 bool now_playing_lyrics
;
150 bool fetch_lyrics_in_background
;
151 bool local_browser_show_hidden_files
;
153 bool jump_to_now_playing_song_at_start
;
154 bool clock_display_seconds
;
155 bool display_volume_level
;
156 bool display_bitrate
;
157 bool display_remaining_time
;
158 bool ignore_leading_the
;
159 bool ignore_diacritics
;
160 bool block_search_constraints_change
;
161 bool use_console_editor
;
162 bool use_cyclic_scrolling
;
163 bool ask_before_clearing_playlists
;
164 bool ask_before_shuffling_playlists
;
166 bool mouse_list_scroll_whole_page
;
167 bool visualizer_in_stereo
;
168 bool data_fetching_delay
;
169 bool media_library_sort_by_mtime
;
170 bool tag_editor_extended_numeration
;
171 bool discard_colors_if_item_is_selected
;
172 bool store_lyrics_in_song_dir
;
173 bool generate_win32_compatible_filenames
;
174 bool ask_for_locked_screen_width_part
;
175 bool allow_for_physical_item_deletion
;
176 bool media_library_albums_split_by_date
;
177 bool startup_slave_screen_focus
;
179 unsigned mpd_connection_timeout
;
180 unsigned crossfade_time
;
182 unsigned volume_change_step
;
183 unsigned message_delay_time
;
185 unsigned lines_scrolled
;
186 unsigned search_engine_default_search_mode
;
188 boost::regex::flag_type regex_type
;
190 boost::posix_time::seconds playlist_disable_highlight_delay
;
191 boost::posix_time::seconds visualizer_sync_interval
;
193 double locked_screen_width_part
;
195 size_t selected_item_prefix_length
;
196 size_t selected_item_suffix_length
;
197 size_t now_playing_prefix_length
;
198 size_t now_playing_suffix_length
;
199 size_t current_item_prefix_length
;
200 size_t current_item_suffix_length
;
201 size_t current_item_inactive_column_prefix_length
;
202 size_t current_item_inactive_column_suffix_length
;
204 ScreenType startup_screen_type
;
205 boost::optional
<ScreenType
> startup_slave_screen_type
;
206 std::vector
<ScreenType
> screen_sequence
;
208 SortMode browser_sort_mode
;
210 LyricsFetchers lyrics_fetchers
;
213 extern Configuration Config
;
215 #endif // NCMPCPP_SETTINGS_H