From: Good Guy Date: Fri, 16 Mar 2018 20:01:55 +0000 (-0600) Subject: add proxy index builds, perperual session, backup.prev, disarmed track indication... X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=214bd0ba9e21635e03d0c0e2b2ae1a7e9170583c;p=goodguy%2Fhistory.git add proxy index builds, perperual session, backup.prev, disarmed track indication, libvpx1.7.0, edl copy fix, segv image cache stale ptr fix --- diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.C b/cinelerra-5.1/cinelerra/appearanceprefs.C index 0960bb30..15e61cdf 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.C +++ b/cinelerra-5.1/cinelerra/appearanceprefs.C @@ -190,6 +190,8 @@ void AppearancePrefs::create_objects() add_subwindow(displacement); y1 += displacement->get_h() + 5; add_subwindow(thumbnails = new ViewThumbnails(x1, y1, pwindow)); + y1 += thumbnails->get_h() + 5; + add_subwindow(perpetual = new PerpetualSession(x1, y1, pwindow)); if( y < y1 ) y = y1; } @@ -628,3 +630,17 @@ int YuvColorRangeItem::handle_event() return popup->handle_event(); } + +PerpetualSession::PerpetualSession(int x, int y, PreferencesWindow *pwindow) + : BC_CheckBox(x, y, + pwindow->thread->preferences->perpetual_session, _("Perpetual session")) +{ + this->pwindow = pwindow; +} + +int PerpetualSession::handle_event() +{ + pwindow->thread->preferences->perpetual_session = get_value(); + return 1; +} + diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.h b/cinelerra-5.1/cinelerra/appearanceprefs.h index 600b8270..392650cf 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.h +++ b/cinelerra-5.1/cinelerra/appearanceprefs.h @@ -49,6 +49,7 @@ public: ViewThumbnails *thumbnails; YuvColorSpace *yuv_color_space; YuvColorRange *yuv_color_range; + PerpetualSession *perpetual; }; @@ -297,4 +298,12 @@ public: int id; }; +class PerpetualSession : public BC_CheckBox +{ +public: + PerpetualSession(int x, int y, PreferencesWindow *pwindow); + int handle_event(); + PreferencesWindow *pwindow; +}; + #endif diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.inc b/cinelerra-5.1/cinelerra/appearanceprefs.inc index 69f617ce..128194ad 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.inc +++ b/cinelerra-5.1/cinelerra/appearanceprefs.inc @@ -49,5 +49,6 @@ class YuvColorSpace; class YuvColorSpaceItem; class YuvColorRange; class YuvColorRangeItem; +class PerpetualSession; #endif diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index 55ca9a29..55b2caf4 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -339,7 +339,7 @@ int EDL::read_xml(FileXML *file, uint32_t load_flags) // The string is not terminated in this call. int EDL::save_xml(FileXML *file, const char *output_path) { - copy(0, tracks->total_length(), 1, file, output_path, 0); + copy(1, file, output_path, 0); return 0; } @@ -472,6 +472,10 @@ int EDL::copy(double start, double end, int all, return copy(start, end, all, "/EDL", file, output_path, rewind_it); } +int EDL::copy(int all, FileXML *file, const char *output_path, int rewind_it) +{ + return copy(0, tracks->total_length(), all, file, output_path, rewind_it); +} int EDL::copy_clip(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it) @@ -480,6 +484,11 @@ int EDL::copy_clip(double start, double end, int all, return copy(start, end, all, "/CLIP_EDL", file, output_path, rewind_it); } +int EDL::copy_clip(int all, FileXML *file, const char *output_path, int rewind_it) +{ + return copy_clip(0, tracks->total_length(), all, file, output_path, rewind_it); +} + int EDL::copy_nested_edl(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it) { @@ -488,6 +497,11 @@ int EDL::copy_nested_edl(double start, double end, int all, return copy(start, end, all, "/NESTED_EDL", file, output_path, rewind_it); } +int EDL::copy_nested_edl(int all, FileXML *file, const char *output_path, int rewind_it) +{ + return copy_nested_edl(0, tracks->total_length(), all, file, output_path, rewind_it); +} + int EDL::copy_vwindow_edl(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it) { @@ -495,6 +509,11 @@ int EDL::copy_vwindow_edl(double start, double end, int all, return copy(start, end, all, "/VWINDOW_EDL", file, output_path, rewind_it); } +int EDL::copy_vwindow_edl(int all, FileXML *file, const char *output_path, int rewind_it) +{ + return copy_vwindow_edl(0, tracks->total_length(), all, file, output_path, rewind_it); +} + int EDL::copy(double start, double end, int all, const char *closer, FileXML *file, @@ -549,12 +568,10 @@ int EDL::copy(double start, double end, int all, // Don't want this if using clipboard if( all ) { for( int i=0; icopy_vwindow_edl(0, tracks->total_length(), 1, - file, output_path, 0); + get_vwindow_edl(i)->copy_vwindow_edl(1, file, output_path, 0); for( int i=0; icopy_clip(0, tracks->total_length(), 1, - file, output_path, 0); + clips[i]->copy_clip(1, file, output_path, 0); mixers.save(file); } diff --git a/cinelerra-5.1/cinelerra/edl.h b/cinelerra-5.1/cinelerra/edl.h index d523779b..77b7bfd8 100644 --- a/cinelerra-5.1/cinelerra/edl.h +++ b/cinelerra-5.1/cinelerra/edl.h @@ -102,14 +102,22 @@ public: // Scale all sample values since everything is locked to audio void rechannel(); void resample(double old_rate, double new_rate, int data_type); + int copy(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it); + int copy(int all, FileXML *file, const char *output_path, int rewind_it); + int copy_clip(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it); + int copy_clip(int all, FileXML *file, const char *output_path, int rewind_it); + int copy_nested_edl(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it); + int copy_nested_edl(int all, FileXML *file, const char *output_path, int rewind_it); + int copy_vwindow_edl(double start, double end, int all, FileXML *file, const char *output_path, int rewind_it); + int copy_vwindow_edl(int all, FileXML *file, const char *output_path, int rewind_it); void copy_tracks(EDL *edl); // Copies project path, folders, EDLSession, and LocalSession from edl argument. diff --git a/cinelerra-5.1/cinelerra/main.C b/cinelerra-5.1/cinelerra/main.C index 92a6a821..e67dd2f4 100644 --- a/cinelerra-5.1/cinelerra/main.C +++ b/cinelerra-5.1/cinelerra/main.C @@ -89,7 +89,7 @@ public: //PRINT_TRACE mwindow->load_filenames(filenames, LOADMODE_REPLACE); //PRINT_TRACE - if(filenames->size() == 1) + if( filenames->size() == 1 ) mwindow->gui->mainmenu->add_load(filenames->get(0)); //PRINT_TRACE mwindow->gui->unlock_window(); @@ -115,6 +115,7 @@ int main(int argc, char *argv[]) char config_path[BCTEXTLEN]; char batch_path[BCTEXTLEN]; int nice_value = 20; + int load_perpetual = 1; config_path[0] = 0; batch_path[0] = 0; deamon_path[0] = 0; @@ -137,24 +138,24 @@ int main(int argc, char *argv[]) // Extract from locale language & region char locbuf[32], *p; locbuf[0] = 0; - if((p = strchr(loc, '.')) != 0 && (p - loc) < (int)sizeof(locbuf)-1) { + if( (p = strchr(loc, '.')) != 0 && (p - loc) < (int)sizeof(locbuf)-1 ) { strncpy(locbuf, loc, p - loc); locbuf[p - loc] = 0; } - else if(strlen(loc) < sizeof(locbuf)-1) + else if( strlen(loc) < sizeof(locbuf)-1 ) strcpy(locbuf, loc); // Locale 'C' does not give useful language info - assume en - if(!locbuf[0] || locbuf[0] == 'C') + if( !locbuf[0] || locbuf[0] == 'C' ) strcpy(locbuf, "en"); - if((p = strchr(locbuf, '_')) && p - locbuf < LEN_LANG) { + if( (p = strchr(locbuf, '_')) && p - locbuf < LEN_LANG ) { *p++ = 0; strcpy(BC_Resources::language, locbuf); - if(strlen(p) < LEN_LANG) + if( strlen(p) < LEN_LANG ) strcpy(BC_Resources::region, p); } - else if(strlen(locbuf) < LEN_LANG) + else if( strlen(locbuf) < LEN_LANG ) strcpy(BC_Resources::language, locbuf); } else @@ -167,88 +168,62 @@ int main(int argc, char *argv[]) int load_backup = 0; int start_remote_control = 0; - for(int i = 1; i < argc; i++) - { - if(!strcmp(argv[i], "-h")) - { + for( int i = 1; i < argc; i++ ) { + if( !strcmp(argv[i], "-h") ) { operation = DO_USAGE; } - else - if(!strcmp(argv[i], "-z")) - { + else if( !strcmp(argv[i], "-z") ) { start_remote_control = 1; } - else - if(!strcmp(argv[i], "-r")) - { + else if( !strcmp(argv[i], "-r") ) { operation = DO_BATCHRENDER; - if(argc > i + 1) - { - if(argv[i + 1][0] != '-') - { + if( argc > i + 1 ) { + if( argv[i + 1][0] != '-' ) { strcpy(batch_path, argv[i + 1]); i++; } } } - else - if(!strcmp(argv[i], "-c")) - { - if(argc > i + 1) - { + else if( !strcmp(argv[i], "-c") ) { + if( argc > i + 1 ) { strcpy(config_path, argv[i + 1]); i++; } - else - { + else { fprintf(stderr, _("%s: -c needs a filename.\n"), argv[0]); } } - else - if(!strcmp(argv[i], "-d") || !strcmp(argv[i], "-f")) - { - if(!strcmp(argv[i], "-d")) - operation = DO_DEAMON; - else - operation = DO_DEAMON_FG; - - if(argc > i + 1) - { - if(atol(argv[i + 1]) > 0) - { + else if( !strcmp(argv[i], "-d") || !strcmp(argv[i], "-f") ) { + operation = !strcmp(argv[i], "-d") ? DO_DEAMON : DO_DEAMON_FG; + if( argc > i + 1 ) { + if( atol(argv[i + 1]) > 0 ) { deamon_port = atol(argv[i + 1]); i++; } } } - else - if(!strcmp(argv[i], "-b")) - { + else if( !strcmp(argv[i], "-b") ) { operation = DO_BRENDER; - if(i > argc - 2) - { + if( i > argc - 2 ) { fprintf(stderr, _("-b may not be used by the user.\n")); exit(1); } else strcpy(deamon_path, argv[i + 1]); } - else - if(!strcmp(argv[i], "-n")) - { - if(argc > i + 1) - { + else if( !strcmp(argv[i], "-n") ) { + if( argc > i + 1 ) { nice_value = atol(argv[i + 1]); i++; } } - else - if(!strcmp(argv[i], "-x")) - { + else if( !strcmp(argv[i], "-x") ) { load_backup = 1; } - else - { + else if( !strcmp(argv[i], "-S") ) { + load_perpetual = 0; + } + else { char *new_filename; new_filename = new char[BCTEXTLEN]; strcpy(new_filename, argv[i]); @@ -259,11 +234,9 @@ int main(int argc, char *argv[]) - if(operation == DO_GUI || - operation == DO_DEAMON || - operation == DO_DEAMON_FG || - operation == DO_USAGE || - operation == DO_BATCHRENDER) { + if( operation == DO_GUI || + operation == DO_DEAMON || operation == DO_DEAMON_FG || + operation == DO_USAGE || operation == DO_BATCHRENDER) { #ifndef REPOMAINTXT #define REPOMAINTXT "" @@ -283,8 +256,7 @@ int main(int argc, char *argv[]) PROGRAM_NAME, PROGRAM_NAME); } - switch(operation) - { + switch( operation ) { case DO_USAGE: printf(_("\nUsage:\n")); printf(_("%s [-f] [-c configuration] [-d port] [-n nice] [-r batch file] [filenames]\n\n"), argv[0]); @@ -295,19 +267,18 @@ int main(int argc, char *argv[]) File::get_config_path(), CONFIG_FILE); printf(_("-r = batch render the contents of the batch file (%s/%s) with no GUI. batch file is optional.\n"), File::get_config_path(), BATCH_PATH); + printf(_("-S = do not reload perpetual session\n")); + printf(_("-x = reload from backup\n")); printf(_("filenames = files to load\n\n\n")); exit(0); break; case DO_DEAMON: - case DO_DEAMON_FG: - { - if(operation == DO_DEAMON) - { + case DO_DEAMON_FG: { + if( operation == DO_DEAMON ) { int pid = fork(); - if(pid) - { + if( pid ) { // Redhat 9 requires _exit instead of exit here. _exit(0); } @@ -318,36 +289,32 @@ int main(int argc, char *argv[]) nice_value, config_path); client.main_loop(); - break; - } + break; } // Same thing without detachment - case DO_BRENDER: - { + case DO_BRENDER: { RenderFarmClient client(0, deamon_path, 20, config_path); client.main_loop(); - break; - } + break; } - case DO_BATCHRENDER: - { + case DO_BATCHRENDER: { BatchRenderThread *thread = new BatchRenderThread; thread->start_rendering(config_path, batch_path); - break; - } + break; } - case DO_GUI: - { + case DO_GUI: { int restart = 0, done = 0; while( !done ) { BC_WindowBase::get_resources()->vframe_shm = 0; MWindow mwindow; mwindow.create_objects(1, !filenames.total, config_path); CommandLineThread *thread = 0; + if( mwindow.preferences->perpetual_session && load_perpetual ) + mwindow.load_undo_data(); //SET_TRACE // load the initial files on seperate tracks // use a new thread so it doesn't block the GUI @@ -382,6 +349,8 @@ int main(int argc, char *argv[]) done = 1; mwindow.save_defaults(); + if( mwindow.preferences->perpetual_session ) + mwindow.save_undo_data(); //PRINT_TRACE filenames.remove_all_objects(); delete thread; @@ -399,10 +368,9 @@ int main(int argc, char *argv[]) av[ac++] = 0; execv(exe_path, av); } - } //SET_TRACE DISABLE_BUFFER - break; + break; } } filenames.remove_all_objects(); diff --git a/cinelerra-5.1/cinelerra/mainundo.C b/cinelerra-5.1/cinelerra/mainundo.C index 3bc8d7cf..9cd3562e 100644 --- a/cinelerra-5.1/cinelerra/mainundo.C +++ b/cinelerra-5.1/cinelerra/mainundo.C @@ -292,3 +292,30 @@ void MainUndo::dump(FILE *fp) undo_stack->dump(fp); } +void MainUndo::save(FILE *fp) +{ + undo_stack->save(fp); +} + +void MainUndo::load(FILE *fp) +{ + undo_stack->load(fp); + UndoStackItem *current = undo_stack->current; + char *current_data = current ? current->get_data() : 0; + if( !current_data ) return; + mwindow->gui->lock_window("MainUndo::load"); + UndoStackItem *next = current->next; + mwindow->gui->mainmenu->redo-> + update_caption(next ? next->get_description() : ""); + mwindow->set_filename(current->get_filename()); + FileXML file; + file.read_from_string(current_data); + load_from_undo(&file, LOAD_ALL); + delete [] current_data; + UndoStackItem *prev = current->previous; + mwindow->gui->mainmenu->undo-> + update_caption(prev ? prev->get_description() : ""); + mwindow->update_project(LOADMODE_REPLACE); + mwindow->gui->unlock_window(); +} + diff --git a/cinelerra-5.1/cinelerra/mainundo.h b/cinelerra-5.1/cinelerra/mainundo.h index a0d3006d..d622adcf 100644 --- a/cinelerra-5.1/cinelerra/mainundo.h +++ b/cinelerra-5.1/cinelerra/mainundo.h @@ -57,6 +57,9 @@ public: int undo_load_flags(); int redo_load_flags(); void dump(FILE *fp=stdout); + + void save(FILE *fp); + void load(FILE *fp); private: // Entry point for all update commands void update_undo_entry(const char *description, diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 56059c67..a69af4e7 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -3349,9 +3349,12 @@ void MWindow::save_backup() FileXML file; edl->optimize(); edl->set_path(session->filename); - char backup_path[BCTEXTLEN]; + char backup_path[BCTEXTLEN], backup_path1[BCTEXTLEN]; snprintf(backup_path, sizeof(backup_path), "%s/%s", File::get_config_path(), BACKUP_FILE); + snprintf(backup_path1, sizeof(backup_path1), "%s/%s", + File::get_config_path(), BACKUP_FILE1); + rename(backup_path, backup_path1); edl->save_xml(&file, backup_path); file.terminate_string(); FileSystem fs; @@ -3388,6 +3391,29 @@ void MWindow::load_backup() save_backup(); } + +void MWindow::save_undo_data() +{ + char perpetual_path[BCTEXTLEN]; + snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s", + File::get_config_path(), PERPETUAL_FILE); + FILE *fp = fopen(perpetual_path,"w"); + if( !fp ) return; + undo->save(fp); + fclose(fp); +} + +void MWindow::load_undo_data() +{ + char perpetual_path[BCTEXTLEN]; + snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s", + File::get_config_path(), PERPETUAL_FILE); + FILE *fp = fopen(perpetual_path,"r"); + if( !fp ) return; + undo->load(fp); + fclose(fp); +} + static inline int gcd(int m, int n) { int r; diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index 0dfd24ce..252f96db 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -484,7 +484,8 @@ public: int toggle_label(int is_mwindow); void undo_entry(BC_WindowBase *calling_window_gui); void redo_entry(BC_WindowBase *calling_window_gui); - + void save_undo_data(); + void load_undo_data(); int cut_automation(); int copy_automation(); diff --git a/cinelerra-5.1/cinelerra/mwindow.inc b/cinelerra-5.1/cinelerra/mwindow.inc index 804842c3..ee6b8ab0 100644 --- a/cinelerra-5.1/cinelerra/mwindow.inc +++ b/cinelerra-5.1/cinelerra/mwindow.inc @@ -28,6 +28,7 @@ #define CONFIG_FILE "Cinelerra_rc" // user presets #define PRESETS_FILE "Cinelerra_presets" +#define PERPETUAL_FILE "perpetual.dat" // factory presets #define FACTORY_FILE "Cinelerra_factory" #define PICTURE_FILE "Cinelerra_picture" diff --git a/cinelerra-5.1/cinelerra/patchgui.C b/cinelerra-5.1/cinelerra/patchgui.C index a2a19864..9ae8c4ef 100644 --- a/cinelerra-5.1/cinelerra/patchgui.C +++ b/cinelerra-5.1/cinelerra/patchgui.C @@ -425,6 +425,10 @@ int RecordPatch::button_press_event() get_value(), this, &patch->track->record); + patch->title->set_back_color(patch->track->record ? + get_resources()->text_background : + get_resources()->text_background_disarmed); + patch->title->set_text_row(0); return 1; } return 0; @@ -658,19 +662,23 @@ int ExpandPatch::button_release_event() } - - - TitlePatch::TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y) - : BC_TextBox(x, - y, - patch->patchbay->get_w() - 10, - 1, - patch->track->title, - 1, MEDIUMFONT, 1) + : BC_TextBox(x, y, patch->patchbay->get_w() - 10, 1, + patch->track->title, 1, MEDIUMFONT, 1) { this->mwindow = mwindow; this->patch = patch; + set_back_color(patch->track->record ? + get_resources()->text_background : + get_resources()->text_background_disarmed); +} + +void TitlePatch::update(const char *text) +{ + set_back_color(patch->track->record ? + get_resources()->text_background : + get_resources()->text_background_disarmed); + BC_TextBox::update(text); } int TitlePatch::handle_event() @@ -684,13 +692,6 @@ int TitlePatch::handle_event() } - - - - - - - NudgePatch::NudgePatch(MWindow *mwindow, PatchGUI *patch, int x, diff --git a/cinelerra-5.1/cinelerra/patchgui.h b/cinelerra-5.1/cinelerra/patchgui.h index 126b0666..da415bb9 100644 --- a/cinelerra-5.1/cinelerra/patchgui.h +++ b/cinelerra-5.1/cinelerra/patchgui.h @@ -115,6 +115,7 @@ class TitlePatch : public BC_TextBox public: TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y); int handle_event(); + void update(const char *text); MWindow *mwindow; PatchGUI *patch; }; diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index b950b374..4e13c584 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -63,6 +63,7 @@ Preferences::Preferences() index_count = 500; use_thumbnails = 1; keyframe_reticle = HAIRLINE_DRAGGING; + perpetual_session = 0; trap_sigsegv = 1; trap_sigintr = 1; theme[0] = 0; @@ -168,6 +169,7 @@ void Preferences::copy_from(Preferences *that) index_count = that->index_count; use_thumbnails = that->use_thumbnails; keyframe_reticle = that->keyframe_reticle; + perpetual_session = that->perpetual_session; strcpy(theme, that->theme); strcpy(plugin_icons, that->plugin_icons); strcpy(snapshot_path, that->snapshot_path); @@ -299,8 +301,8 @@ int Preferences::load_defaults(BC_Hash *defaults) defaults->get("INDEX_DIRECTORY", index_directory); 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); + perpetual_session = defaults->get("PERPETUAL_SESSION", perpetual_session); trap_sigsegv = defaults->get("TRAP_SIGSEGV", trap_sigsegv); trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr); @@ -440,6 +442,7 @@ int Preferences::save_defaults(BC_Hash *defaults) defaults->update("INDEX_COUNT", index_count); defaults->update("USE_THUMBNAILS", use_thumbnails); defaults->update("KEYFRAME_RETICLE", keyframe_reticle); + defaults->update("PERPETUAL_SESSION", perpetual_session); defaults->update("TRAP_SIGSEGV", trap_sigsegv); defaults->update("TRAP_SIGINTR", trap_sigintr); defaults->update("THEME", theme); diff --git a/cinelerra-5.1/cinelerra/preferences.h b/cinelerra-5.1/cinelerra/preferences.h index d7f449ef..aab5c810 100644 --- a/cinelerra-5.1/cinelerra/preferences.h +++ b/cinelerra-5.1/cinelerra/preferences.h @@ -89,6 +89,7 @@ public: // Use thumbnails in AWindow assets. int use_thumbnails; int keyframe_reticle; + int perpetual_session; int trap_sigsegv; int trap_sigintr; // Title of theme diff --git a/cinelerra-5.1/cinelerra/preferences.inc b/cinelerra-5.1/cinelerra/preferences.inc index d05d201e..69e4a7a8 100644 --- a/cinelerra-5.1/cinelerra/preferences.inc +++ b/cinelerra-5.1/cinelerra/preferences.inc @@ -25,6 +25,7 @@ // Run-time configuration directory #define DEAMON_PORT 400 #define BACKUP_FILE "backup.xml" +#define BACKUP_FILE1 "backup.prev" #define FFMPEG_EARLY_TIP _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last") #define FFMPEG_LATE_TIP _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first") diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index 5aff535a..02eb20fa 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -33,6 +33,7 @@ #include "formattools.h" #include "language.h" #include "mainerror.h" +#include "mainindexes.h" #include "mainprogress.h" #include "mainundo.h" #include "mutex.h" @@ -759,6 +760,11 @@ void ProxyClient::process_package(LoadPackage *ptr) } proxy_render->update_progress(); } + if( !proxy_render->failed && !proxy_render->is_canceled() ) { + Asset *asset = mwindow->edl->assets->update(proxy); + mwindow->mainindexes->add_next_asset(0, asset); + mwindow->mainindexes->start_build(); + } } diff --git a/cinelerra-5.1/cinelerra/quit.C b/cinelerra-5.1/cinelerra/quit.C index 68e7817f..35be0f44 100644 --- a/cinelerra-5.1/cinelerra/quit.C +++ b/cinelerra-5.1/cinelerra/quit.C @@ -30,6 +30,7 @@ #include "mwindow.h" #include "mwindowgui.h" #include "playback3d.h" +#include "preferences.h" #include "quit.h" #include "record.h" #include "render.h" @@ -55,8 +56,9 @@ int Quit::handle_event() //printf("Quit::handle_event 1 %d\n", mwindow->session->changes_made); Record *record = mwindow->gui->record; - if( mwindow->session->changes_made || mwindow->render->in_progress || - record->capturing || record->recording || record->writing_file ) { + if( !mwindow->preferences->perpetual_session && + ( mwindow->session->changes_made || mwindow->render->in_progress || + record->capturing || record->recording || record->writing_file ) ) { start(); } else diff --git a/cinelerra-5.1/cinelerra/undostack.C b/cinelerra-5.1/cinelerra/undostack.C index 0c49981b..4adef936 100644 --- a/cinelerra-5.1/cinelerra/undostack.C +++ b/cinelerra-5.1/cinelerra/undostack.C @@ -482,3 +482,58 @@ void* UndoStackItem::get_creator() return creator; } +void UndoStackItem::save(FILE *fp) +{ + fwrite(&key,1,sizeof(key),fp); + fwrite(&load_flags,1,sizeof(load_flags),fp); + fwrite(&data_size,1,sizeof(data_size),fp); + fwrite(data,1,data_size,fp); + for( char *bp=session_filename; *bp; ++bp ) fputc(*bp, fp); + fputc(0, fp); + for( char *bp=description; *bp; ++bp ) fputc(*bp, fp); + fputc(0, fp); +} + +void UndoStackItem::load(FILE *fp) +{ + fread(&key,1,sizeof(key),fp); + fread(&load_flags,1,sizeof(load_flags),fp); + fread(&data_size,1,sizeof(data_size),fp); + fread(data=new char[data_size],1,data_size,fp); + char filename[BCTEXTLEN], descr[BCTEXTLEN]; + char *bp = filename, *ep = bp+sizeof(filename)-1; + for( int ch; bp0; ++bp ) *bp = ch; + *bp = 0; + session_filename = cstrdup(filename); + bp = descr; ep = bp+sizeof(descr)-1; + for( int ch; bp0; ++bp ) *bp = ch; + *bp = 0; + description = cstrdup(descr); +//printf("read undo key=%d,flags=%jx,data_size=%d,data=%p,file=%s,descr=%s\n", +// key, load_flags, data_size, data, session_filename, description); +} + +void UndoStack::save(FILE *fp) +{ + for( UndoStackItem *item=first; item; item=item->next ) { + int is_current = item == current ? 1 : 0; + fwrite(&is_current,1,sizeof(is_current),fp); + item->save(fp); +// if( item == current ) break; // stop at current + } +} + +void UndoStack::load(FILE *fp) +{ + while( last ) delete last; + current = 0; + UndoStackItem *current_item = 0; + int is_current = 0; + while( fread(&is_current,1,sizeof(is_current),fp) == sizeof(is_current) ) { + UndoStackItem *item = push(); + item->load(fp); + if( is_current ) current_item = item; + } + if( current_item ) current = current_item; +} + diff --git a/cinelerra-5.1/cinelerra/undostack.h b/cinelerra-5.1/cinelerra/undostack.h index e6791d0a..17bf1284 100644 --- a/cinelerra-5.1/cinelerra/undostack.h +++ b/cinelerra-5.1/cinelerra/undostack.h @@ -108,6 +108,8 @@ public: void set_creator(void *creator); void* get_creator(); + void save(FILE *fp); + void load(FILE *fp); private: // command description for the menu item char *description; @@ -147,6 +149,8 @@ public: // move to the next undo entry for a redo UndoStackItem* pull_next(); + void save(FILE *fp); + void load(FILE *fp); void dump(FILE *fp=stdout); UndoStackItem* current; diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 557aae3c..9159b78d 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -319,7 +319,7 @@ PKG_3RD([x265],[auto], [ . source ]) PKG_3RD([libvpx],[auto], - [libvpx-1.6.1], + [libvpx-1.7.0], [ libvpx.a ], [ . ]) diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index 2c8950e6..8ed4e6f4 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -759,6 +759,7 @@ new_vframes(20,default_medium_7segment, text_default = BLACK; highlight_inverse = WHITE ^ BLUE; text_background = WHITE; + text_background_disarmed = 0xc08080; text_background_hi = LTYELLOW; text_background_noborder_hi = LTGREY; text_background_noborder = -1; diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index e22327fe..feca1095 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -165,6 +165,7 @@ public: int text_border2; int text_border2_hi; int text_background; + int text_background_disarmed; int text_background_hi; int text_background_noborder_hi; int text_border3; diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index 2a34c180..da7afa0f 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -166,6 +166,8 @@ int BC_TextBox::reset_parameters(int rows, int has_border, int font, int size) text_x = 0; enabled = 1; highlighted = 0; + back_color = -1; + high_color = -1; precision = 4; if (!skip_cursor) skip_cursor = new Timer; @@ -281,13 +283,13 @@ int BC_TextBox::initialize() BC_Resources *resources = get_resources(); if(has_border) { - back_color = resources->text_background; - high_color = resources->text_background_hi; + if( back_color < 0 ) back_color = resources->text_background; + if( high_color < 0 ) high_color = resources->text_background_hi; } else { - high_color = resources->text_background_noborder_hi; - back_color = bg_color; + if( back_color < 0 ) back_color = bg_color; + if( high_color < 0 ) high_color = resources->text_background_noborder_hi; } draw(0); @@ -456,7 +458,8 @@ int BC_TextBox::update(const char *text) { //printf("BC_TextBox::update 1 %d %s %s\n", tstrcmp(text), text, this->text); // Don't update if contents are the same - if(!tstrcmp(text)) return 0; + int bg_color = has_border || !highlighted ? back_color : high_color; + if( bg_color == background_color && !tstrcmp(text)) return 0; tstrcpy(text); int wtext_len = wtext_update(); if(highlight_letter1 > wtext_len) highlight_letter1 = wtext_len; @@ -519,6 +522,8 @@ int BC_TextBox::get_text_x() { return text_x; } int BC_TextBox::get_text_y() { return text_y; } void BC_TextBox::set_text_x(int v) { text_x = v; } void BC_TextBox::set_text_y(int v) { text_y = v; } +int BC_TextBox::get_back_color() { return back_color; } +void BC_TextBox::set_back_color(int v) { back_color = v; } int BC_TextBox::pixels_to_rows(BC_WindowBase *window, int font, int pixels) { @@ -655,12 +660,7 @@ void BC_TextBox::draw(int flush) //printf("BC_TextBox::draw %d %s\n", __LINE__, text); // Background - if(has_border) - background_color = resources->text_background; - else if(highlighted) - background_color = high_color; - else - background_color = back_color; + background_color = has_border || !highlighted ? back_color : high_color; set_color(background_color); draw_box(0, 0, w, h); diff --git a/cinelerra-5.1/guicast/bctextbox.h b/cinelerra-5.1/guicast/bctextbox.h index e461767e..425768bf 100644 --- a/cinelerra-5.1/guicast/bctextbox.h +++ b/cinelerra-5.1/guicast/bctextbox.h @@ -117,6 +117,8 @@ public: int get_text_y(); void set_text_x(int v); void set_text_y(int v); + int get_back_color(); + void set_back_color(int v); int reposition_window(int x, int y, int w = -1, int rows = -1); int uses_text(); diff --git a/cinelerra-5.1/guicast/bctheme.C b/cinelerra-5.1/guicast/bctheme.C index c587ed25..c206f258 100644 --- a/cinelerra-5.1/guicast/bctheme.C +++ b/cinelerra-5.1/guicast/bctheme.C @@ -106,6 +106,8 @@ VFrame** BC_Theme::new_image_set_images(const char *title, int total, ...) BC_ThemeSet *existing_image_set = title[0] ? get_image_set_object(title) : 0; if( existing_image_set ) { image_sets.remove_object(existing_image_set); + last_image_set = 0; + last_image_data = 0; } BC_ThemeSet *result = new BC_ThemeSet(total, 0, title); diff --git a/cinelerra-5.1/plugins/theme_blond/blondtheme.C b/cinelerra-5.1/plugins/theme_blond/blondtheme.C index dae82726..93f4da0b 100644 --- a/cinelerra-5.1/plugins/theme_blond/blondtheme.C +++ b/cinelerra-5.1/plugins/theme_blond/blondtheme.C @@ -108,6 +108,7 @@ void BlondTheme::initialize() resources->text_default = 0x000000; resources->text_background = 0xcecea2; + resources->text_background_disarmed = 0xefeddb; resources->text_border1 = 0x202020; resources->text_border2 = 0xcecea2; resources->text_border3 = 0xcecea2; diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C index be0e7a73..fdbffc8a 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C @@ -159,6 +159,7 @@ void BlondCVTheme::initialize() resources->text_default = 0x000000; resources->text_background = 0xffffff; + resources->text_background_disarmed = 0xff0000; resources->text_border1 = 0x4a484a; // (top outer) resources->text_border2 = 0x000000; // (top inner) resources->text_border3 = 0xacaeac; // (bottom inner) diff --git a/cinelerra-5.1/plugins/theme_blue/bluetheme.C b/cinelerra-5.1/plugins/theme_blue/bluetheme.C index 1e190855..fd8d270f 100644 --- a/cinelerra-5.1/plugins/theme_blue/bluetheme.C +++ b/cinelerra-5.1/plugins/theme_blue/bluetheme.C @@ -108,6 +108,7 @@ void BlueDotTheme::initialize() resources->text_default = 0xeeeeff; resources->text_background = 0x1a1447; + resources->text_background_disarmed = 0x7282d4; resources->text_border1 = 0x202020; resources->text_border2 = 0x1a1447; resources->text_border3 = 0x1a1447; diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C index 1eed422d..64c29f78 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C @@ -114,6 +114,7 @@ void BlueDotTheme::initialize() // COPIED FROM DEFAULT THEME 1>> resources->text_default = 0x000000; resources->text_background = 0xffffff; + resources->text_background_disarmed = 0xff3939; //listbox borders resources->text_border1 = 0x4a484a; // (top outer) resources->text_border2 = 0x000000; // (top inner) diff --git a/cinelerra-5.1/plugins/theme_bright/brighttheme.C b/cinelerra-5.1/plugins/theme_bright/brighttheme.C index 2ad0b127..30a6be94 100644 --- a/cinelerra-5.1/plugins/theme_bright/brighttheme.C +++ b/cinelerra-5.1/plugins/theme_bright/brighttheme.C @@ -106,6 +106,7 @@ void BrightTheme::initialize() resources->text_default = 0x000000; resources->text_background = 0xffffff; + resources->text_background_disarmed = 0xaaaaaa; resources->text_background_hi = 0xffffff; resources->text_border1 = 0x000000; resources->text_border2 = 0xffffff; diff --git a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C index 2309ff03..de88591f 100644 --- a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C +++ b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C @@ -109,6 +109,7 @@ void HULKTHEME::initialize() resources->text_default = 0x001000; resources->text_background = 0x75b697; + resources->text_background_disarmed = 0xce00ff; resources->text_border1 = 0x202020; resources->text_border2 = 0x75b697; resources->text_border3 = 0x75b697; diff --git a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C index 4007c355..f46efad7 100644 --- a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C +++ b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C @@ -94,6 +94,7 @@ void PINKLADY::initialize() resources->text_default = 0x1b0f11; resources->text_background = 0xffb1d0; + resources->text_background_disarmed = 0x0000ff; resources->text_border1 = 0x202020; resources->text_border2 = 0xffb1d0; resources->text_border3 = 0xffb1d0; diff --git a/cinelerra-5.1/plugins/theme_suv/suv.C b/cinelerra-5.1/plugins/theme_suv/suv.C index 55ab0f87..15a95b4c 100644 --- a/cinelerra-5.1/plugins/theme_suv/suv.C +++ b/cinelerra-5.1/plugins/theme_suv/suv.C @@ -105,6 +105,7 @@ void SUV::initialize() resources->text_default = 0xbfbfbf; resources->text_background = 0x373737; + resources->text_background_disarmed = 0xaf0000; resources->text_border1 = 0x202020; resources->text_border2 = 0x373737; resources->text_border3 = 0x373737; diff --git a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C index 5649253d..81c593ae 100644 --- a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C +++ b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C @@ -103,6 +103,7 @@ void UNFLATTHEME::initialize() resources->text_default = 0xbfbfbf; resources->text_background = 0x333333; + resources->text_background_disarmed = 0xaf0000; resources->text_border1 = 0x202020; resources->text_border2 = 0x333333; resources->text_border3 = 0x333333; diff --git a/cinelerra-5.1/thirdparty/downloads.txt b/cinelerra-5.1/thirdparty/downloads.txt index 47936c5f..39f64c1e 100644 --- a/cinelerra-5.1/thirdparty/downloads.txt +++ b/cinelerra-5.1/thirdparty/downloads.txt @@ -31,6 +31,6 @@ https://sourceforge.net/projects/libuuid/files/latest/download?source=directory ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170426-2245-stable.tar.bz2 https://bitbucket.org/multicoreware/x265/downloads/x265_2.4.tar.gz http://ffmpeg.org/releases/ffmpeg-3.3.tar.bz2 -https://chromium.googlesource.com/webm/libvpx/+archive/0c0a05046db1c0b59a7fcc29785a190fdbbe39c2.tar.gz = 1,6,1 +https://github.com/webmproject/libvpx/releases/tag/v1.7.0 https://github.com/swh/ladspa/releases/tag/v0.4.17, plugin.org.uk https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz diff --git a/cinelerra-5.1/thirdparty/src/libvpx-1.6.1.tar.xz b/cinelerra-5.1/thirdparty/src/libvpx-1.6.1.tar.xz deleted file mode 100644 index c9822581..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libvpx-1.6.1.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libvpx-1.7.0.tar.xz b/cinelerra-5.1/thirdparty/src/libvpx-1.7.0.tar.xz new file mode 100644 index 00000000..dbf89b3a Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libvpx-1.7.0.tar.xz differ