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=cbdf27cd9353a5648987a45cf358cce1d4cc5770;hb=3ac8199743f244669cc87ceef9c3cd23710552f3;hpb=8b3b351f3703224915cf26d1b01d1d8ee632a178 diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index cbdf27cd..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; @@ -75,11 +77,15 @@ Preferences::Preferences() renderfarm_mountpoint[0] = 0; renderfarm_vfs = 0; renderfarm_job_count = 20; - processors = calculate_processors(0); + project_smp = processors = calculate_processors(0); real_processors = calculate_processors(1); - ffmpeg_early_probe = 0; ffmpeg_marker_indexes = 1; warn_indexes = 1; + warn_version = 1; + bd_warn_root = 1; + popupmenu_btnup = 1; + textbox_focus_policy = 0; + dvd_yuv420p_interlace = 0; // Default brender asset brender_asset = new Asset; @@ -115,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; } @@ -166,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; @@ -175,15 +183,23 @@ 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; trap_sigsegv = that->trap_sigsegv; 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; + bd_warn_root = that->bd_warn_root; + popupmenu_btnup = that->popupmenu_btnup; + textbox_focus_policy = that->textbox_focus_policy; + dvd_yuv420p_interlace = that->dvd_yuv420p_interlace; renderfarm_nodes.remove_all_objects(); renderfarm_ports.remove_all(); renderfarm_enabled.remove_all(); @@ -300,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++) { @@ -326,10 +344,15 @@ 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); + bd_warn_root = defaults->get("BD_WARN_ROOT", bd_warn_root); + popupmenu_btnup = defaults->get("POPUPMENU_BTNUP", popupmenu_btnup); + textbox_focus_policy = defaults->get("TEXTBOX_FOCUS_POLICY", textbox_focus_policy); + dvd_yuv420p_interlace = defaults->get("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace); use_brender = defaults->get("USE_BRENDER", use_brender); brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment); cache_size = defaults->get("CACHE_SIZE", cache_size); @@ -373,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(); @@ -414,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++) @@ -426,17 +472,16 @@ int Preferences::save_defaults(BC_Hash *defaults) defaults->update(string, string2); } + 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); - brender_asset->save_defaults(defaults, - "BRENDER_", - 1, - 1, - 1, - 0, - 0); + defaults->update("WARN_VERSION", warn_version); + defaults->update("BD_WARN_ROOT", bd_warn_root); + defaults->update("POPUPMENU_BTNUP", popupmenu_btnup); + defaults->update("TEXTBOX_FOCUS_POLICY", textbox_focus_policy); + defaults->update("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace); + brender_asset->save_defaults(defaults, "BRENDER_", 1, 1, 1, 0, 0); defaults->update("USE_BRENDER", use_brender); defaults->update("BRENDER_FRAGMENT", brender_fragment); defaults->update("USE_RENDERFARM", use_renderfarm); @@ -470,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; } @@ -702,7 +755,7 @@ int Preferences::get_asset_file_path(Asset *asset, char *path) { strcpy(path, asset->path); int result = !access(path, R_OK) ? 0 : -1; - if( !result && ( asset->format == FILE_MPEG || + if( !result && ( asset->format == FILE_MPEG || asset->format == FILE_AC3 || asset->format == FILE_VMPEG || asset->format == FILE_AMPEG ) ) { char source_filename[BCTEXTLEN], index_filename[BCTEXTLEN]; IndexFile::get_index_filename(source_filename, @@ -722,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; +} +