e814f4260f8f91d5a52a64af59d3ccedc15a4e22
[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
37 class Preferences
38 {
39 public:
40         Preferences();
41         ~Preferences();
42
43         Preferences& operator=(Preferences &that);
44         void copy_from(Preferences *that);
45         int load_defaults(BC_Hash *defaults);
46         int save_defaults(BC_Hash *defaults);
47         void boundaries();
48
49         static void print_channels(char *string,
50                 int *channel_positions,
51                 int channels);
52         static void scan_channels(char *string,
53                 int *channel_positions,
54                 int channels);
55
56         void add_node(const char *text, int port, int enabled, float rate);
57         void delete_node(int number);
58         void delete_nodes();
59         void reset_rates();
60 // Get average frame rate or 1.0
61         float get_avg_rate(int use_master_node);
62         void sort_nodes();
63         void edit_node(int number, const char *new_text, int port, int enabled);
64         int get_enabled_nodes();
65         const char* get_node_hostname(int number);
66         int get_node_port(int number);
67         int get_asset_file_path(Asset *asset, char *path);
68 // Copy frame rates.  Always used where the argument is the renderfarm and this is
69 // the master preferences.  This way, the value for master node is properly
70 // translated from a unix socket to the local_rate.
71         void copy_rates_from(Preferences *preferences);
72 // Set frame rate for a node.  Node -1 is the master node.
73 // The node number is relative to the enabled nodes.
74         void set_rate(float rate, int node);
75         float get_rate(int node);
76 // Calculate the number of cpus to use.
77 // Determined by /proc/cpuinfo and force_uniprocessor.
78 // interactive forces it to ignore force_uniprocessor
79         int calculate_processors(int interactive = 0);
80 // file probe armed
81         int get_file_probe_armed(const char *nm);
82         void set_file_probe_armed(const char *nm, int v);
83 // ================================= Performance ================================
84 // directory to look in for indexes
85         char index_directory[BCTEXTLEN];
86 // size of index file in bytes
87         int64_t index_size;
88         int index_count;
89 // Use thumbnails in AWindow assets.
90         int use_thumbnails;
91         int keyframe_reticle;
92         int perpetual_session;
93         int trap_sigsegv;
94         int trap_sigintr;
95 // media thumbnail size
96         int awindow_picon_h;
97         int vicon_size, vicon_color_mode;
98         float layout_scale;
99 // Title of theme
100         char theme[BCSTRLEN];
101         char locale[BCSTRLEN];
102 // plugin icon set
103         char plugin_icons[BCSTRLEN];
104 // snapshot directory path
105         char snapshot_path[BCTEXTLEN];
106         double render_preroll;
107         int brender_preroll;
108         int force_uniprocessor;
109         int project_smp;
110 // The number of cpus to use when rendering.
111 // Determined by /proc/cpuinfo and force_uniprocessor
112         int processors;
113 // Number of processors for interactive operations.
114         int real_processors;
115 // ffmpeg builds marker indexes as it builds idx files
116         int ffmpeg_marker_indexes;
117 // ffmpeg hw_dev driver probe name
118         char use_hw_dev[BCSTRLEN];
119 // warning
120         int warn_indexes;
121         int unsafe_gui;
122         int warn_stack;
123         int warn_fileref;
124         int bd_warn_root;
125 // grab input focus on enter notify
126         int grab_input_focus;
127 // popup menus activate on button release
128         int popupmenu_btnup;
129 // textbox focus policy: click, leave
130         int textbox_focus_policy;
131 // apply display_matrix rotation, ffmpeg only
132         int auto_rotate;
133 // forward playback starts next frame, not this frame
134         int forward_render_displacement;
135 // use dvd yuv420p interlace format
136         int dvd_yuv420p_interlace;
137 // highlight inversion color
138         int highlight_inverse;
139 // yuv color space/range
140         int yuv_color_space;
141         int yuv_color_range;
142 // autocolor asset edit title
143         int autocolor_assets;
144 // ongoing continuous backups
145         int ongoing_backups;
146 // ctrl_toggle && !ctrl_down() clears selection before toggle
147         int ctrl_toggle;
148 // rectify timeline audio waveform
149         int rectify_audio;
150 // Default positions for channels
151         int channel_positions[MAXCHANNELS][MAXCHANNELS];
152
153         Asset *brender_asset;
154         int use_brender;
155 // Number of frames in a brender job.
156         int brender_fragment;
157 // Size of cache in bytes.
158 // Several caches of cache_size exist so multiply by 4.
159 // rendering, playback, timeline, preview
160         int64_t cache_size;
161         int cache_transitions;
162
163         int use_renderfarm;
164         int renderfarm_port;
165 // If the node starts with a / it's on the localhost using a path as the socket.
166         ArrayList<char*> renderfarm_nodes;
167         ArrayList<int>   renderfarm_ports;
168         ArrayList<int>   renderfarm_enabled;
169         ArrayList<float> renderfarm_rate;
170 // Rate of master node
171         float local_rate;
172         char renderfarm_mountpoint[BCTEXTLEN];
173 // Use virtual filesystem
174         int renderfarm_vfs;
175 // Jobs per node
176         int renderfarm_job_count;
177 // Consolidate output files
178         int renderfarm_consolidate;
179 // watchdog timeout, zero disabled
180         int renderfarm_watchdog_timeout;
181
182 // Tip of the day
183         int use_tipwindow;
184 // Scan for commercials
185         int scan_commercials;
186 // Android remote control
187         int android_remote;
188         int android_port;
189         char android_pin[BCSTRLEN];
190 // shell cmd line menu ops
191         ArrayList<ShBtnPref *> shbtn_prefs;
192 // file open probe order
193         ArrayList<ProbePref *> file_probes;
194
195 // ====================================== Plugin Set ==============================
196         char plugin_dir[BCTEXTLEN];
197         char lv2_path[BCTEXTLEN];
198         int autostart_lv2ui;
199         char nested_proxy_path[BCTEXTLEN];
200
201 // Required when updating renderfarm rates
202         Mutex *preferences_lock;
203 };
204
205 #endif