X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpreferences.C;h=27269e231cfc43bb2c624c0e008a6ebbdf8fd5fa;hp=f69ab3e847898b9e5520b194df0174b0fb0b529c;hb=3ac8199743f244669cc87ceef9c3cd23710552f3;hpb=51fdff4109828a112ac1006a92bdbdd1ba9b18a5 diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index f69ab3e8..27269e23 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -33,6 +33,7 @@ #include "indexfile.h" #include "mutex.h" #include "preferences.h" +#include "probeprefs.h" #include "shbtnprefs.h" #include "theme.h" #include "videoconfig.h" @@ -67,6 +68,7 @@ Preferences::Preferences() trap_sigsegv = 1; trap_sigintr = 1; theme[0] = 0; + plugin_icons[0] = 0; use_renderfarm = 0; force_uniprocessor = 0; renderfarm_port = DEAMON_PORT; @@ -77,7 +79,6 @@ Preferences::Preferences() renderfarm_job_count = 20; project_smp = processors = calculate_processors(0); real_processors = calculate_processors(1); - ffmpeg_early_probe = 1; ffmpeg_marker_indexes = 1; warn_indexes = 1; warn_version = 1; @@ -120,6 +121,7 @@ Preferences::~Preferences() { brender_asset->Garbage::remove_user(); shbtn_prefs.remove_all_objects(); + file_probes.remove_all_objects(); renderfarm_nodes.remove_all_objects(); delete preferences_lock; } @@ -171,6 +173,7 @@ void Preferences::copy_from(Preferences *that) use_thumbnails = that->use_thumbnails; keyframe_reticle = that->keyframe_reticle; strcpy(theme, that->theme); + strcpy(plugin_icons, that->plugin_icons); use_tipwindow = that->use_tipwindow; scan_commercials = that->scan_commercials; @@ -180,6 +183,9 @@ void Preferences::copy_from(Preferences *that) this->shbtn_prefs.remove_all_objects(); for( int i=0; ishbtn_prefs.size(); ++i ) this->shbtn_prefs.append(new ShBtnPref(*that->shbtn_prefs[i])); + this->file_probes.remove_all_objects(); + for( int i=0; ifile_probes.size(); ++i ) + this->file_probes.append(new ProbePref(*that->file_probes[i])); cache_size = that->cache_size; project_smp = that->project_smp; force_uniprocessor = that->force_uniprocessor; @@ -187,7 +193,6 @@ void Preferences::copy_from(Preferences *that) trap_sigintr = that->trap_sigintr; processors = that->processors; real_processors = that->real_processors; - ffmpeg_early_probe = that->ffmpeg_early_probe; ffmpeg_marker_indexes = that->ffmpeg_marker_indexes; warn_indexes = that->warn_indexes; warn_version = that->warn_version; @@ -311,6 +316,8 @@ int Preferences::load_defaults(BC_Hash *defaults) strcpy(theme, DEFAULT_THEME); defaults->get("THEME", theme); + strcpy(plugin_icons, DEFAULT_PICON); + defaults->get("PLUGIN_ICONS", plugin_icons); for(int i = 0; i < MAXCHANNELS; i++) { @@ -339,7 +346,6 @@ int Preferences::load_defaults(BC_Hash *defaults) project_smp = defaults->get("PROJECT_SMP", project_smp); force_uniprocessor = defaults->get("FORCE_UNIPROCESSOR", force_uniprocessor); - ffmpeg_early_probe = defaults->get("FFMPEG_EARLY_PROBE", ffmpeg_early_probe); ffmpeg_marker_indexes = defaults->get("FFMPEG_MARKER_INDEXES", ffmpeg_marker_indexes); warn_indexes = defaults->get("WARN_INDEXES", warn_indexes); warn_version = defaults->get("WARN_VERSION", warn_version); @@ -390,9 +396,10 @@ 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("Features5", "firefox file://$CIN_DAT/doc/Features5.pdf", 0)); - shbtn_prefs.append(new ShBtnPref("Online Help", "firefox https://cinelerra-cv.org/docs.php", 0)); - shbtn_prefs.append(new ShBtnPref("Orignal Manual", "firefox file://$CIN_DAT/doc/cinelerra.html", 0)); + shbtn_prefs.append(new ShBtnPref(_("Features5"), "$CIN_BROWSER file://$CIN_DAT/doc/Features5.pdf", 0)); + shbtn_prefs.append(new ShBtnPref(_("Online Help"), "$CIN_BROWSER https://cinelerra-cv.org/docs.php", 0)); + shbtn_prefs.append(new ShBtnPref(_("Original Manual"), "$CIN_BROWSER file://$CIN_DAT/doc/cinelerra.html", 0)); + shbtn_prefs.append(new ShBtnPref(_("Setting Shell Commands"), "$CIN_BROWSER file://$CIN_DAT/doc/ShellCmds.html", 0)); shbtns_total = 0; } for( int i=0; iget("FILE_PROBE_TOTAL", 0); + for( int i=0; iget(string, name); + sprintf(string, "FILE_PROBE%d_ARMED", i); + int armed = defaults->get(string, 1); + file_probes.append(new ProbePref(name, armed)); + } + // append any missing probes + for( int i=0; i=0 && strcmp(nm, file_probes[k]->name) ); + if( k >= 0 ) continue; + int armed = 1; + if( !strcmp(nm, "FFMPEG_Late") || + !strcmp(nm, "CR2") ) armed = 0; + file_probes.append(new ProbePref(nm, armed)); + } + // Redo with the proper value of force_uniprocessor processors = calculate_processors(0); boundaries(); @@ -431,8 +460,8 @@ int Preferences::save_defaults(BC_Hash *defaults) defaults->update("KEYFRAME_RETICLE", keyframe_reticle); defaults->update("TRAP_SIGSEGV", trap_sigsegv); defaults->update("TRAP_SIGINTR", trap_sigintr); -// defaults->update("GLOBAL_PLUGIN_DIR", global_plugin_dir); defaults->update("THEME", theme); + defaults->update("PLUGIN_ICONS", plugin_icons); for(int i = 0; i < MAXCHANNELS; i++) @@ -445,7 +474,6 @@ int Preferences::save_defaults(BC_Hash *defaults) defaults->update("PROJECT_SMP", project_smp); defaults->update("FORCE_UNIPROCESSOR", force_uniprocessor); - defaults->update("FFMPEG_EARLY_PROBE", ffmpeg_early_probe); defaults->update("FFMPEG_MARKER_INDEXES", ffmpeg_marker_indexes); defaults->update("WARN_INDEXES", warn_indexes); defaults->update("WARN_VERSION", warn_version); @@ -487,6 +515,14 @@ int Preferences::save_defaults(BC_Hash *defaults) sprintf(string, "SHBTN%d_WARN", i); defaults->update(string, pref->warn); } + defaults->update("FILE_PROBE_TOTAL", file_probes.size()); + for( int i=0; iupdate(string, pref->name); + sprintf(string, "FILE_PROBE%d_ARMED", i); + defaults->update(string, pref->armed); + } return 0; } @@ -739,3 +775,19 @@ int Preferences::calculate_processors(int interactive) return BC_WindowBase::get_resources()->machine_cpus; } +int Preferences::get_file_probe_armed(const char *nm) +{ + int k = file_probes.size(); + while( --k>=0 && strcmp(nm, file_probes[k]->name) ); + if( k < 0 ) return -1; + return file_probes[k]->armed; +} + +void Preferences::set_file_probe_armed(const char *nm, int v) +{ + int k = file_probes.size(); + while( --k>=0 && strcmp(nm, file_probes[k]->name) ); + if( k < 0 ) return; + file_probes[k]->armed = v; +} +