X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpreferences.h;fp=cinelerra-5.1%2Fcinelerra%2Fpreferences.h;h=d18c7c69d8ea91f3edcb0be7af240ee9f7dd8bf9;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hp=0000000000000000000000000000000000000000;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/preferences.h b/cinelerra-5.1/cinelerra/preferences.h new file mode 100644 index 00000000..d18c7c69 --- /dev/null +++ b/cinelerra-5.1/cinelerra/preferences.h @@ -0,0 +1,153 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef PREFERENCES_H +#define PREFERENCES_H + +#include "asset.inc" +#include "audioconfig.inc" +#include "bchash.inc" +#include "guicast.h" +#include "maxchannels.h" +#include "mutex.inc" +#include "preferences.inc" +#include "shbtnprefs.inc" +#include "videoconfig.inc" + + +class Preferences +{ +public: + Preferences(); + ~Preferences(); + + Preferences& operator=(Preferences &that); + void copy_from(Preferences *that); + int load_defaults(BC_Hash *defaults); + int save_defaults(BC_Hash *defaults); + void boundaries(); + + static void print_channels(char *string, + int *channel_positions, + int channels); + static void scan_channels(char *string, + int *channel_positions, + int channels); + + void add_node(const char *text, int port, int enabled, float rate); + void delete_node(int number); + void delete_nodes(); + void reset_rates(); +// Get average frame rate or 1.0 + float get_avg_rate(int use_master_node); + void sort_nodes(); + void edit_node(int number, const char *new_text, int port, int enabled); + int get_enabled_nodes(); + const char* get_node_hostname(int number); + int get_node_port(int number); + int get_asset_file_path(Asset *asset, char *path); +// Copy frame rates. Always used where the argument is the renderfarm and this is +// the master preferences. This way, the value for master node is properly +// translated from a unix socket to the local_rate. + void copy_rates_from(Preferences *preferences); +// Set frame rate for a node. Node -1 is the master node. +// The node number is relative to the enabled nodes. + void set_rate(float rate, int node); + float get_rate(int node); +// Calculate the number of cpus to use. +// Determined by /proc/cpuinfo and force_uniprocessor. +// interactive forces it to ignore force_uniprocessor + int calculate_processors(int interactive = 0); + +// ================================= Performance ================================ +// directory to look in for indexes + char index_directory[BCTEXTLEN]; +// size of index file in bytes + int64_t index_size; + int index_count; +// Use thumbnails in AWindow assets. + int use_thumbnails; + int trap_sigsegv; + int trap_sigintr; +// Title of theme + char theme[BCTEXTLEN]; + double render_preroll; + int brender_preroll; + int force_uniprocessor; +// The number of cpus to use when rendering. +// Determined by /proc/cpuinfo and force_uniprocessor + int processors; +// Number of processors for interactive operations. + int real_processors; +// ffmpeg probes early/late during File::open_file read + int ffmpeg_early_probe; +// ffmpeg builds marker indexes as it builds idx files + int ffmpeg_marker_indexes; + int warn_indexes; + +// Default positions for channels + int channel_positions[MAXCHANNELS * MAXCHANNELS]; + + Asset *brender_asset; + int use_brender; +// Number of frames in a brender job. + int brender_fragment; +// Size of cache in bytes. +// Several caches of cache_size exist so multiply by 4. +// rendering, playback, timeline, preview + int64_t cache_size; + + int use_renderfarm; + int renderfarm_port; +// If the node starts with a / it's on the localhost using a path as the socket. + ArrayList renderfarm_nodes; + ArrayList renderfarm_ports; + ArrayList renderfarm_enabled; + ArrayList renderfarm_rate; +// Rate of master node + float local_rate; + char renderfarm_mountpoint[BCTEXTLEN]; +// Use virtual filesystem + int renderfarm_vfs; +// Jobs per node + int renderfarm_job_count; +// Consolidate output files + int renderfarm_consolidate; + +// Tip of the day + int use_tipwindow; +// Scan for commercials + int scan_commercials; +// Android remote control + int android_remote; + int android_port; + char android_pin[BCSTRLEN]; +// shell cmd line menu ops + ArrayList shbtn_prefs; + +// ====================================== Plugin Set ============================== + char plugin_dir[BCTEXTLEN]; + +// Required when updating renderfarm rates + Mutex *preferences_lock; +}; + +#endif