X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fpreferences.C;h=670f1abd9592597043b23e99a1226e200cd26f27;hb=6c0c8bd0e577001d1cc18c6c27d58e62f58a6bff;hp=afdcb50ed26a0c9f746cb2809a341b531d7e9455;hpb=2d99bb8ce591f05a31464b517d85dc2bc35b2abe;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/preferences.C b/cinelerra-5.0/cinelerra/preferences.C index afdcb50e..670f1abd 100644 --- a/cinelerra-5.0/cinelerra/preferences.C +++ b/cinelerra-5.0/cinelerra/preferences.C @@ -33,6 +33,7 @@ #include "indexfile.h" #include "mutex.h" #include "preferences.h" +#include "shbtnprefs.h" #include "theme.h" #include "videoconfig.h" #include "videodevice.inc" @@ -50,8 +51,6 @@ -extern void get_exe_path(char *result); - @@ -71,12 +70,12 @@ Preferences::Preferences() sprintf(index_directory, BCASTDIR); if(strlen(index_directory)) fs.complete_path(index_directory); - cache_size = 0xa00000; - index_size = 0x300000; + cache_size = 0x1000000; + index_size = 0x400000; index_count = 100; use_thumbnails = 1; - trap_sigsegv = 0; - trap_sigintr = 0; + trap_sigsegv = 1; + trap_sigintr = 1; theme[0] = 0; use_renderfarm = 0; force_uniprocessor = 0; @@ -88,8 +87,9 @@ Preferences::Preferences() renderfarm_job_count = 20; processors = calculate_processors(0); real_processors = calculate_processors(1); - file_forking = 1; ffmpeg_early_probe = 0; + ffmpeg_marker_indecies = 1; + warn_indecies = 1; // Default brender asset brender_asset = new Asset; @@ -124,6 +124,8 @@ Preferences::Preferences() Preferences::~Preferences() { brender_asset->Garbage::remove_user(); + shbtn_prefs.remove_all_objects(); + renderfarm_nodes.remove_all_objects(); delete preferences_lock; } @@ -179,14 +181,18 @@ void Preferences::copy_from(Preferences *that) android_remote = that->android_remote; android_port = that->android_port; strcpy(android_pin, that->android_pin); + this->shbtn_prefs.remove_all_objects(); + for( int i=0; ishbtn_prefs.size(); ++i ) + this->shbtn_prefs.append(new ShBtnPref(*that->shbtn_prefs[i])); cache_size = that->cache_size; force_uniprocessor = that->force_uniprocessor; trap_sigsegv = that->trap_sigsegv; trap_sigintr = that->trap_sigintr; processors = that->processors; real_processors = that->real_processors; - file_forking = that->file_forking; ffmpeg_early_probe = that->ffmpeg_early_probe; + ffmpeg_marker_indecies = that->ffmpeg_marker_indecies; + warn_indecies = that->warn_indecies; renderfarm_nodes.remove_all_objects(); renderfarm_ports.remove_all(); renderfarm_enabled.remove_all(); @@ -335,9 +341,10 @@ int Preferences::load_defaults(BC_Hash *defaults) - force_uniprocessor = defaults->get("FORCE_UNIPROCESSOR", 0); - file_forking = defaults->get("FILE_FORKING", 1); - ffmpeg_early_probe = defaults->get("FFMPEG_EARLY_PROBE", 0); + force_uniprocessor = defaults->get("FORCE_UNIPROCESSOR", force_uniprocessor); + ffmpeg_early_probe = defaults->get("FFMPEG_EARLY_PROBE", ffmpeg_early_probe); + ffmpeg_marker_indecies = defaults->get("FFMPEG_MARKER_INDECIES", ffmpeg_marker_indecies); + warn_indecies = defaults->get("WARN_INDECIES", warn_indecies); use_brender = defaults->get("USE_BRENDER", use_brender); brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment); cache_size = defaults->get("CACHE_SIZE", cache_size); @@ -378,6 +385,24 @@ int Preferences::load_defaults(BC_Hash *defaults) } } + shbtn_prefs.remove_all_objects(); + int shbtns_total = defaults->get("SHBTNS_TOTAL", -1); + if( shbtns_total < 0 ) { + shbtn_prefs.append(new ShBtnPref("manual", "firefox file:///$CINELERRA_PATH/manual.pdf", 0)); + shbtn_prefs.append(new ShBtnPref("online help", "firefox http://cinelerra.org/help.php/", 0)); + shbtns_total = 0; + } + for( int i=0; iget(string, name); + sprintf(string, "SHBTN%d_COMMANDS", i); + defaults->get(string, commands); + sprintf(string, "SHBTN%d_WARN", i); + int warn = defaults->get(string, 0); + shbtn_prefs.append(new ShBtnPref(name, commands, warn)); + } + // Redo with the proper value of force_uniprocessor processors = calculate_processors(0); boundaries(); @@ -415,8 +440,9 @@ int Preferences::save_defaults(BC_Hash *defaults) } defaults->update("FORCE_UNIPROCESSOR", force_uniprocessor); - defaults->update("FILE_FORKING", file_forking); defaults->update("FFMPEG_EARLY_PROBE", ffmpeg_early_probe); + defaults->update("FFMPEG_MARKER_INDECIES", ffmpeg_marker_indecies); + defaults->update("WARN_INDECIES", warn_indecies); brender_asset->save_defaults(defaults, "BRENDER_", 1, @@ -447,6 +473,16 @@ int Preferences::save_defaults(BC_Hash *defaults) sprintf(string, "RENDERFARM_RATE%d", i); defaults->update(string, renderfarm_rate.values[i]); } + defaults->update("SHBTNS_TOTAL", shbtn_prefs.size()); + for( int i=0; iupdate(string, pref->name); + sprintf(string, "SHBTN%d_COMMANDS", i); + defaults->update(string, pref->commands); + sprintf(string, "SHBTN%d_WARN", i); + defaults->update(string, pref->warn); + } return 0; }