asset drag/drop to viewers, bluebanana bug, listbox fontlist highlight
[goodguy/history.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 "shbtnprefs.inc"
33 #include "videoconfig.inc"
34
35
36 class Preferences
37 {
38 public:
39         Preferences();
40         ~Preferences();
41
42         Preferences& operator=(Preferences &that);
43         void copy_from(Preferences *that);
44         int load_defaults(BC_Hash *defaults);
45         int save_defaults(BC_Hash *defaults);
46         void boundaries();
47
48         static void print_channels(char *string,
49                 int *channel_positions,
50                 int channels);
51         static void scan_channels(char *string,
52                 int *channel_positions,
53                 int channels);
54
55         void add_node(const char *text, int port, int enabled, float rate);
56         void delete_node(int number);
57         void delete_nodes();
58         void reset_rates();
59 // Get average frame rate or 1.0
60         float get_avg_rate(int use_master_node);
61         void sort_nodes();
62         void edit_node(int number, const char *new_text, int port, int enabled);
63         int get_enabled_nodes();
64         const char* get_node_hostname(int number);
65         int get_node_port(int number);
66         int get_asset_file_path(Asset *asset, char *path);
67 // Copy frame rates.  Always used where the argument is the renderfarm and this is
68 // the master preferences.  This way, the value for master node is properly
69 // translated from a unix socket to the local_rate.
70         void copy_rates_from(Preferences *preferences);
71 // Set frame rate for a node.  Node -1 is the master node.
72 // The node number is relative to the enabled nodes.
73         void set_rate(float rate, int node);
74         float get_rate(int node);
75 // Calculate the number of cpus to use.
76 // Determined by /proc/cpuinfo and force_uniprocessor.
77 // interactive forces it to ignore force_uniprocessor
78         int calculate_processors(int interactive = 0);
79
80 // ================================= Performance ================================
81 // directory to look in for indexes
82         char index_directory[BCTEXTLEN];
83 // size of index file in bytes
84         int64_t index_size;
85         int index_count;
86 // Use thumbnails in AWindow assets.
87         int use_thumbnails;
88         int keyframe_reticle;
89         int trap_sigsegv;
90         int trap_sigintr;
91 // Title of theme
92         char theme[BCTEXTLEN];
93         double render_preroll;
94         int brender_preroll;
95         int force_uniprocessor;
96         int project_smp;
97 // The number of cpus to use when rendering.
98 // Determined by /proc/cpuinfo and force_uniprocessor
99         int processors;
100 // Number of processors for interactive operations.
101         int real_processors;
102 // ffmpeg probes early/late during File::open_file read
103         int ffmpeg_early_probe;
104 // ffmpeg builds marker indexes as it builds idx files
105         int ffmpeg_marker_indexes;
106 // warning
107         int warn_indexes;
108         int warn_version;
109         int bd_warn_root;
110 // popup menus activate on button release
111         int popupmenu_btnup;
112 // textbox focus policy: click, leave
113         int textbox_focus_policy;
114 // use dvd yuv420p interlace format
115         int dvd_yuv420p_interlace;
116
117 // Default positions for channels
118         int channel_positions[MAXCHANNELS * MAXCHANNELS];
119
120         Asset *brender_asset;
121         int use_brender;
122 // Number of frames in a brender job.
123         int brender_fragment;
124 // Size of cache in bytes.
125 // Several caches of cache_size exist so multiply by 4.
126 // rendering, playback, timeline, preview
127         int64_t cache_size;
128
129         int use_renderfarm;
130         int renderfarm_port;
131 // If the node starts with a / it's on the localhost using a path as the socket.
132         ArrayList<char*> renderfarm_nodes;
133         ArrayList<int>   renderfarm_ports;
134         ArrayList<int>   renderfarm_enabled;
135         ArrayList<float> renderfarm_rate;
136 // Rate of master node
137         float local_rate;
138         char renderfarm_mountpoint[BCTEXTLEN];
139 // Use virtual filesystem
140         int renderfarm_vfs;
141 // Jobs per node
142         int renderfarm_job_count;
143 // Consolidate output files
144         int renderfarm_consolidate;
145
146 // Tip of the day
147         int use_tipwindow;
148 // Scan for commercials
149         int scan_commercials;
150 // Android remote control
151         int android_remote;
152         int android_port;
153         char android_pin[BCSTRLEN];
154 // shell cmd line menu ops
155         ArrayList<ShBtnPref *> shbtn_prefs;
156
157 // ====================================== Plugin Set ==============================
158         char plugin_dir[BCTEXTLEN];
159
160 // Required when updating renderfarm rates
161         Mutex *preferences_lock;
162 };
163
164 #endif