Improve detection for songs not in playlists
[ncmpcpp.git] / src / settings.h
blob508fd6e26cbd9ee69d0704017ddb7cffd5f44537
1 /***************************************************************************
2 * Copyright (C) 2008-2016 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 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>
27 #include <cassert>
28 #include <vector>
29 #include <mpd/client.h>
31 #include "curses/formatted_color.h"
32 #include "curses/strbuffer.h"
33 #include "enums.h"
34 #include "format.h"
35 #include "lyrics_fetcher.h"
36 #include "screens/screen_type.h"
38 struct Column
40 Column() : stretch_limit(-1), right_alignment(0), display_empty_tag(1) { }
42 std::wstring name;
43 std::string type;
44 int width;
45 int stretch_limit;
46 NC::Color color;
47 bool fixed;
48 bool right_alignment;
49 bool display_empty_tag;
52 struct Configuration
54 Configuration()
55 : playlist_disable_highlight_delay(0), visualizer_sync_interval(0)
56 { }
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;
86 std::string pattern;
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;
102 NC::Color header_color;
103 NC::Color main_color;
104 NC::Color statusbar_color;
105 NC::Color main_highlight_color;
106 NC::Color active_column_color;
108 NC::FormattedColor color1;
109 NC::FormattedColor color2;
110 NC::FormattedColor empty_tags_color;
111 NC::FormattedColor volume_color;
112 NC::FormattedColor state_line_color;
113 NC::FormattedColor state_flags_color;
114 NC::FormattedColor progressbar_color;
115 NC::FormattedColor progressbar_elapsed_color;
116 NC::FormattedColor player_state_color;
117 NC::FormattedColor statusbar_time_color;
118 NC::FormattedColor alternative_ui_separator_color;
120 std::vector<NC::FormattedColor> visualizer_colors;
121 VisualizerType visualizer_type;
123 NC::Border window_border;
124 NC::Border active_window_border;
126 Design design;
128 SpaceAddMode space_add_mode;
130 mpd_tag_type media_lib_primary_tag;
132 bool colors_enabled;
133 bool playlist_show_mpd_host;
134 bool playlist_show_remaining_time;
135 bool playlist_shorten_total_times;
136 bool playlist_separate_albums;
137 bool set_window_title;
138 bool header_visibility;
139 bool header_text_scrolling;
140 bool statusbar_visibility;
141 bool titles_visibility;
142 bool centered_cursor;
143 bool screen_switcher_previous;
144 bool autocenter_mode;
145 bool wrapped_search;
146 bool incremental_seeking;
147 bool now_playing_lyrics;
148 bool fetch_lyrics_in_background;
149 bool local_browser_show_hidden_files;
150 bool search_in_db;
151 bool jump_to_now_playing_song_at_start;
152 bool clock_display_seconds;
153 bool display_volume_level;
154 bool display_bitrate;
155 bool display_remaining_time;
156 bool ignore_leading_the;
157 bool block_search_constraints_change;
158 bool use_console_editor;
159 bool use_cyclic_scrolling;
160 bool ask_before_clearing_playlists;
161 bool ask_before_shuffling_playlists;
162 bool mouse_support;
163 bool mouse_list_scroll_whole_page;
164 bool visualizer_in_stereo;
165 bool data_fetching_delay;
166 bool media_library_sort_by_mtime;
167 bool tag_editor_extended_numeration;
168 bool discard_colors_if_item_is_selected;
169 bool store_lyrics_in_song_dir;
170 bool generate_win32_compatible_filenames;
171 bool ask_for_locked_screen_width_part;
172 bool allow_for_physical_item_deletion;
173 bool startup_slave_screen_focus;
175 unsigned mpd_connection_timeout;
176 unsigned crossfade_time;
177 unsigned seek_time;
178 unsigned volume_change_step;
179 unsigned message_delay_time;
180 unsigned lyrics_db;
181 unsigned lines_scrolled;
182 unsigned search_engine_default_search_mode;
184 boost::regex::flag_type regex_type;
186 boost::posix_time::seconds playlist_disable_highlight_delay;
187 boost::posix_time::seconds visualizer_sync_interval;
189 double locked_screen_width_part;
191 size_t selected_item_prefix_length;
192 size_t selected_item_suffix_length;
193 size_t now_playing_prefix_length;
194 size_t now_playing_suffix_length;
196 ScreenType startup_screen_type;
197 boost::optional<ScreenType> startup_slave_screen_type;
198 std::vector<ScreenType> screen_sequence;
200 SortMode browser_sort_mode;
202 LyricsFetchers lyrics_fetchers;
205 extern Configuration Config;
207 #endif // NCMPCPP_SETTINGS_H