X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fcinelerra%2Fpreferences.C;h=cbdf27cd9353a5648987a45cf358cce1d4cc5770;hb=0b78779e9e75131eee81d2e4689b98df0e91c092;hp=0eca68eb76919e43390d05f09904159a449efc16;hpb=87141f1b454130848c34efdea9cf832d17463830;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index 0eca68eb..cbdf27cd 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -27,7 +27,7 @@ #include "cache.inc" #include "clip.h" #include "bchash.h" -#include "file.inc" +#include "file.h" #include "filesystem.h" #include "guicast.h" #include "indexfile.h" @@ -54,17 +54,16 @@ Preferences::Preferences() preferences_lock = new Mutex("Preferences::preferences_lock"); - - get_exe_path(plugin_dir); - strcat(plugin_dir,"/plugins"); - - sprintf(index_directory, BCASTDIR); +// initial plugin path from build -DPLUGIN_DIR="..." + sprintf(plugin_dir, "%s/", File::get_plugin_path()); + sprintf(index_directory, "%s/", File::get_config_path()); if(strlen(index_directory)) fs.complete_path(index_directory); cache_size = 0x1000000; index_size = 0x400000; index_count = 500; use_thumbnails = 1; + keyframe_reticle = HAIRLINE_DRAGGING; trap_sigsegv = 1; trap_sigintr = 1; theme[0] = 0; @@ -165,6 +164,7 @@ void Preferences::copy_from(Preferences *that) index_size = that->index_size; index_count = that->index_count; use_thumbnails = that->use_thumbnails; + keyframe_reticle = that->keyframe_reticle; strcpy(theme, that->theme); use_tipwindow = that->use_tipwindow; @@ -294,6 +294,7 @@ int Preferences::load_defaults(BC_Hash *defaults) index_size = defaults->get("INDEX_SIZE", index_size); index_count = defaults->get("INDEX_COUNT", index_count); use_thumbnails = defaults->get("USE_THUMBNAILS", use_thumbnails); + keyframe_reticle = defaults->get("KEYFRAME_RETICLE", keyframe_reticle); trap_sigsegv = defaults->get("TRAP_SIGSEGV", trap_sigsegv); trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr); @@ -372,8 +373,9 @@ 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 https://cinelerra-cv.org/docs/cinelerra_cv_manual_en.html", 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)); shbtns_total = 0; } for( int i=0; iupdate("INDEX_SIZE", index_size); defaults->update("INDEX_COUNT", index_count); defaults->update("USE_THUMBNAILS", use_thumbnails); + 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); @@ -698,18 +701,17 @@ int Preferences::get_node_port(int number) int Preferences::get_asset_file_path(Asset *asset, char *path) { strcpy(path, asset->path); - int result = access(path, R_OK); - if( !result && asset->format == FILE_MPEG ) { - char source_filename[BCTEXTLEN]; - char index_filename[BCTEXTLEN]; + int result = !access(path, R_OK) ? 0 : -1; + if( !result && ( asset->format == FILE_MPEG || + asset->format == FILE_VMPEG || asset->format == FILE_AMPEG ) ) { + char source_filename[BCTEXTLEN], index_filename[BCTEXTLEN]; IndexFile::get_index_filename(source_filename, - index_directory, index_filename, - asset->path, ".toc"); - struct stat st; - if( !access(index_filename, R_OK) && - !stat(index_filename,&st) && st.st_size > 0 ) + index_directory, index_filename, asset->path, ".toc"); strcpy(path, index_filename); + if( access(path, R_OK) ) + result = 1; } +// result = 0, asset->path/toc exist, -1 no asset, 1 no toc return result; }