r870: Merge 2.1:
[cinelerra_cv.git] / cinelerra / preferences.h
blobc523428274e77530c86624e406fa4a82241f9134
1 #ifndef PREFERENCES_H
2 #define PREFERENCES_H
4 #include "asset.inc"
5 #include "audioconfig.inc"
6 #include "bchash.inc"
7 #include "guicast.h"
8 #include "maxchannels.h"
9 #include "mutex.inc"
10 #include "preferences.inc"
11 #include "videoconfig.inc"
14 class Preferences
16 public:
17 Preferences();
18 ~Preferences();
20 Preferences& operator=(Preferences &that);
21 void copy_from(Preferences *that);
22 int load_defaults(BC_Hash *defaults);
23 int save_defaults(BC_Hash *defaults);
24 void boundaries();
26 static void print_channels(char *string,
27 int *channel_positions,
28 int channels);
29 static void scan_channels(char *string,
30 int *channel_positions,
31 int channels);
33 void add_node(char *text, int port, int enabled, float rate);
34 void delete_node(int number);
35 void delete_nodes();
36 void reset_rates();
37 // Get average frame rate or 1.0
38 float get_avg_rate(int use_master_node);
39 void sort_nodes();
40 void edit_node(int number, char *new_text, int port, int enabled);
41 int get_enabled_nodes();
42 char* get_node_hostname(int number);
43 int get_node_port(int number);
44 // Copy frame rates. Always used where the argument is the renderfarm and this is
45 // the master preferences. This way, the value for master node is properly
46 // translated from a unix socket to the local_rate.
47 void copy_rates_from(Preferences *preferences);
48 // Set frame rate for a node. Node -1 is the master node.
49 // The node number is relative to the enabled nodes.
50 void set_rate(float rate, int node);
51 // Calculate the number of cpus to use.
52 // Determined by /proc/cpuinfo and force_uniprocessor.
53 // interactive forces it to ignore force_uniprocessor
54 int calculate_processors(int interactive = 0);
56 // ================================= Performance ================================
57 // directory to look in for indexes
58 char index_directory[BCTEXTLEN];
59 // size of index file in bytes
60 int64_t index_size;
61 int index_count;
62 // Use thumbnails in AWindow assets.
63 int use_thumbnails;
64 // Title of theme
65 char theme[BCTEXTLEN];
66 double render_preroll;
67 int brender_preroll;
68 int force_uniprocessor;
69 // The number of cpus to use when rendering.
70 // Determined by /proc/cpuinfo and force_uniprocessor
71 int processors;
72 // Number of processors for interactive operations.
73 int real_processors;
75 // Default positions for channels
76 int channel_positions[MAXCHANNELS * MAXCHANNELS];
78 Asset *brender_asset;
79 int use_brender;
80 // Number of frames in a brender job.
81 int brender_fragment;
82 // Size of cache in bytes.
83 // Several caches of cache_size exist so multiply by 4.
84 // rendering, playback, timeline, preview
85 int64_t cache_size;
87 int use_renderfarm;
88 int renderfarm_port;
89 // If the node starts with a / it's on the localhost using a path as the socket.
90 ArrayList<char*> renderfarm_nodes;
91 ArrayList<int> renderfarm_ports;
92 ArrayList<int> renderfarm_enabled;
93 ArrayList<float> renderfarm_rate;
94 // Rate of master node
95 float local_rate;
96 char renderfarm_mountpoint[BCTEXTLEN];
97 // Use virtual filesystem
98 int renderfarm_vfs;
99 // Jobs per node
100 int renderfarm_job_count;
101 // Consolidate output files
102 int renderfarm_consolidate;
104 // Tip of the day
105 int use_tipwindow;
107 // ====================================== Plugin Set ==============================
108 char global_plugin_dir[BCTEXTLEN];
109 char local_plugin_dir[BCTEXTLEN];
111 // Required when updating renderfarm rates
112 Mutex *preferences_lock;
115 #endif