7dd3871c961d162c8b93215af9b80826eabdae80
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / preferences.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef PREFERENCES_H
23 #define PREFERENCES_H
24
25 #include "asset.inc"
26 #include "audioconfig.inc"
27 #include "bchash.inc"
28 #include "guicast.h"
29 #include "maxchannels.h"
30 #include "mutex.inc"
31 #include "preferences.inc"
32 #include "probeprefs.inc"
33 #include "shbtnprefs.inc"
34 #include "videoconfig.inc"
35
36 // for MAX_COLOR_SPACE
37 #include "appearanceprefs.h"
38
39 class Preferences
40 {
41 public:
42         Preferences();
43         ~Preferences();
44
45         Preferences& operator=(Preferences &that);
46         void copy_from(Preferences *that);
47         int load_defaults(BC_Hash *defaults);
48         int save_defaults(BC_Hash *defaults);
49         void boundaries();
50
51         static void print_channels(char *string,
52                 int *channel_positions,
53                 int channels);
54         static void scan_channels(char *string,
55                 int *channel_positions,
56                 int channels);
57
58         void add_node(const char *text, int port, int enabled, float rate);
59         void delete_node(int number);
60         void delete_nodes();
61         void reset_rates();
62 // Get average frame rate or 1.0
63         float get_avg_rate(int use_master_node);
64         void sort_nodes();
65         void edit_node(int number, const char *new_text, int port, int enabled);
66         int get_enabled_nodes();
67         const char* get_node_hostname(int number);
68         int get_node_port(int number);
69         int get_asset_file_path(Asset *asset, char *path);
70 // Copy frame rates.  Always used where the argument is the renderfarm and this is
71 // the master preferences.  This way, the value for master node is properly
72 // translated from a unix socket to the local_rate.
73         void copy_rates_from(Preferences *preferences);
74 // Set frame rate for a node.  Node -1 is the master node.
75 // The node number is relative to the enabled nodes.
76         void set_rate(float rate, int node);
77         float get_rate(int node);
78 // Calculate the number of cpus to use.
79 // Determined by /proc/cpuinfo and force_uniprocessor.
80 // interactive forces it to ignore force_uniprocessor
81         int calculate_processors(int interactive = 0);
82 // file probe armed
83         int get_file_probe_armed(const char *nm);
84         void set_file_probe_armed(const char *nm, int v);
85 // ================================= Performance ================================
86 // directory to look in for indexes
87         char index_directory[BCTEXTLEN];
88 // size of index file in bytes
89         int64_t index_size;
90         int index_count;
91 // Use thumbnails in AWindow assets.
92         int use_thumbnails;
93         int keyframe_reticle;
94         int perpetual_session;
95         int trap_sigsegv;
96         int trap_sigintr;
97 // media thumbnail size
98         int awindow_picon_h;
99         int vicon_size, vicon_color_mode;
100         float layout_scale;
101 // Title of theme
102         char theme[BCSTRLEN];
103         char locale[BCSTRLEN];
104 // plugin icon set
105         char plugin_icons[BCSTRLEN];
106 // snapshot directory path
107         char snapshot_path[BCTEXTLEN];
108         double render_preroll;
109         int brender_preroll;
110         int force_uniprocessor;
111         int project_smp;
112 // The number of cpus to use when rendering.
113 // Determined by /proc/cpuinfo and force_uniprocessor
114         int processors;
115 // Number of processors for interactive operations.
116         int real_processors;
117 // ffmpeg builds marker indexes as it builds idx files
118         int ffmpeg_marker_indexes;
119 // ffmpeg hw_dev driver probe name
120         char use_hw_dev[BCSTRLEN];
121 // warning
122         int warn_indexes;
123         int unsafe_gui;
124         int warn_stack;
125         int warn_fileref;
126         int bd_warn_root;
127 // grab input focus on enter notify
128         int grab_input_focus;
129 // popup menus activate on button release
130         int popupmenu_btnup;
131 // textbox focus policy: click, leave
132         int textbox_focus_policy;
133 // apply display_matrix rotation, ffmpeg only
134         int auto_rotate;
135 // forward playback starts next frame, not this frame
136         int forward_render_displacement;
137 // use dvd yuv420p interlace format
138         int dvd_yuv420p_interlace;
139 // highlight inversion color
140         int highlight_inverse;
141 // yuv color space/range
142         int yuv_color_space;
143         int yuv_color_range;
144 // autocolor asset edit title
145         int autocolor_assets;
146 // ongoing continuous backups
147         int ongoing_backups;
148 // ctrl_toggle && !ctrl_down() clears selection before toggle
149         int ctrl_toggle;
150 // rectify timeline audio waveform
151         int rectify_audio;
152 // Default positions for channels
153         int channel_positions[MAXCHANNELS][MAXCHANNELS];
154
155         Asset *brender_asset;
156         int use_brender;
157 // Number of frames in a brender job.
158         int brender_fragment;
159 // Size of cache in bytes.
160 // Several caches of cache_size exist so multiply by 4.
161 // rendering, playback, timeline, preview
162         int64_t cache_size;
163         int cache_transitions;
164
165         int use_renderfarm;
166         int renderfarm_port;
167 // If the node starts with a / it's on the localhost using a path as the socket.
168         ArrayList<char*> renderfarm_nodes;
169         ArrayList<int>   renderfarm_ports;
170         ArrayList<int>   renderfarm_enabled;
171         ArrayList<float> renderfarm_rate;
172 // Rate of master node
173         float local_rate;
174         char renderfarm_mountpoint[BCTEXTLEN];
175 // Use virtual filesystem
176         int renderfarm_vfs;
177 // Jobs per node
178         int renderfarm_job_count;
179 // Consolidate output files
180         int renderfarm_consolidate;
181 // watchdog timeout, zero disabled
182         int renderfarm_watchdog_timeout;
183
184 // Tip of the day
185         int use_tipwindow;
186 // Scan for commercials
187         int scan_commercials;
188 // Android remote control
189         int android_remote;
190         int android_port;
191         char android_pin[BCSTRLEN];
192 // shell cmd line menu ops
193         ArrayList<ShBtnPref *> shbtn_prefs;
194 // file open probe order
195         ArrayList<ProbePref *> file_probes;
196
197 // ====================================== Plugin Set ==============================
198         char plugin_dir[BCTEXTLEN];
199         char lv2_path[BCTEXTLEN];
200         int autostart_lv2ui;
201         char nested_proxy_path[BCTEXTLEN];
202
203 // Required when updating renderfarm rates
204         Mutex *preferences_lock;
205 };
206
207 #endif