4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
26 #include "audioconfig.inc"
29 #include "maxchannels.h"
31 #include "preferences.inc"
32 #include "probeprefs.inc"
33 #include "shbtnprefs.inc"
34 #include "videoconfig.inc"
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);
49 static void print_channels(char *string,
50 int *channel_positions,
52 static void scan_channels(char *string,
53 int *channel_positions,
56 void add_node(const char *text, int port, int enabled, float rate);
57 void delete_node(int number);
60 // Get average frame rate or 1.0
61 float get_avg_rate(int use_master_node);
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);
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
89 // Use thumbnails in AWindow assets.
95 char theme[BCTEXTLEN];
97 char plugin_icons[BCTEXTLEN];
98 double render_preroll;
100 int force_uniprocessor;
102 // The number of cpus to use when rendering.
103 // Determined by /proc/cpuinfo and force_uniprocessor
105 // Number of processors for interactive operations.
107 // ffmpeg builds marker indexes as it builds idx files
108 int ffmpeg_marker_indexes;
113 // popup menus activate on button release
115 // textbox focus policy: click, leave
116 int textbox_focus_policy;
117 // use dvd yuv420p interlace format
118 int dvd_yuv420p_interlace;
120 // Default positions for channels
121 int channel_positions[MAXCHANNELS * MAXCHANNELS];
123 Asset *brender_asset;
125 // Number of frames in a brender job.
126 int brender_fragment;
127 // Size of cache in bytes.
128 // Several caches of cache_size exist so multiply by 4.
129 // rendering, playback, timeline, preview
134 // If the node starts with a / it's on the localhost using a path as the socket.
135 ArrayList<char*> renderfarm_nodes;
136 ArrayList<int> renderfarm_ports;
137 ArrayList<int> renderfarm_enabled;
138 ArrayList<float> renderfarm_rate;
139 // Rate of master node
141 char renderfarm_mountpoint[BCTEXTLEN];
142 // Use virtual filesystem
145 int renderfarm_job_count;
146 // Consolidate output files
147 int renderfarm_consolidate;
151 // Scan for commercials
152 int scan_commercials;
153 // Android remote control
156 char android_pin[BCSTRLEN];
157 // shell cmd line menu ops
158 ArrayList<ShBtnPref *> shbtn_prefs;
159 // file open probe order
160 ArrayList<ProbePref *> file_probes;
162 // ====================================== Plugin Set ==============================
163 char plugin_dir[BCTEXTLEN];
165 // Required when updating renderfarm rates
166 Mutex *preferences_lock;