X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Flocalsession.C;h=bb95fafa1c40aeadb6739bb8dc8d491005e54d80;hb=a95193c3fd88733d184f2d460eca1fe6ddf8af28;hp=56a1f92291d772672108b140392e80f8cb0a2fda;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/localsession.C b/cinelerra-5.1/cinelerra/localsession.C index 56a1f922..bb95fafa 100644 --- a/cinelerra-5.1/cinelerra/localsession.C +++ b/cinelerra-5.1/cinelerra/localsession.C @@ -20,9 +20,11 @@ */ #include "automation.h" +#include "awindowgui.h" #include "clip.h" #include "bchash.h" #include "edl.h" +#include "filesystem.h" #include "filexml.h" #include "floatauto.h" #include "language.h" @@ -34,6 +36,7 @@ static const char *xml_autogrouptypes_titlesmax[] = "AUTOGROUPTYPE_AUDIO_FADE_MAX", "AUTOGROUPTYPE_VIDEO_FADE_MAX", "AUTOGROUPTYPE_ZOOM_MAX", + "AUTOGROUPTYPE_SPEED_MAX", "AUTOGROUPTYPE_X_MAX", "AUTOGROUPTYPE_Y_MAX", "AUTOGROUPTYPE_INT255_MAX" @@ -44,6 +47,7 @@ static const char *xml_autogrouptypes_titlesmin[] = "AUTOGROUPTYPE_AUDIO_FADE_MIN", "AUTOGROUPTYPE_VIDEO_FADE_MIN", "AUTOGROUPTYPE_ZOOM_MIN", + "AUTOGROUPTYPE_SPEED_MIN", "AUTOGROUPTYPE_X_MIN", "AUTOGROUPTYPE_Y_MIN", "AUTOGROUPTYPE_INT255_MIN" @@ -56,15 +60,16 @@ LocalSession::LocalSession(EDL *edl) selectionstart = selectionend = 0; in_point = out_point = -1; - strcpy(folder, CLIP_FOLDER); + folder = AW_CLIP_FOLDER; sprintf(clip_title, _("Program")); strcpy(clip_notes, _("Hello world")); + strcpy(clip_icon, ""); clipboard_length = 0; loop_playback = 0; loop_start = loop_end = 0; playback_start = -1; playback_end = 0; - preview_start = preview_end = 0; + preview_start = 0; preview_end = -1; zoom_sample = DEFAULT_ZOOM_TIME; zoom_y = 0; zoom_track = 0; @@ -81,8 +86,11 @@ LocalSession::LocalSession(EDL *edl) automation_mins[AUTOGROUPTYPE_VIDEO_FADE] = 0; automation_maxs[AUTOGROUPTYPE_VIDEO_FADE] = 100; - automation_mins[AUTOGROUPTYPE_ZOOM] = 0.001; - automation_maxs[AUTOGROUPTYPE_ZOOM] = 4; + automation_mins[AUTOGROUPTYPE_ZOOM] = 0.005; + automation_maxs[AUTOGROUPTYPE_ZOOM] = 5.000; + + automation_mins[AUTOGROUPTYPE_SPEED] = 0.005; + automation_maxs[AUTOGROUPTYPE_SPEED] = 5.000; automation_mins[AUTOGROUPTYPE_X] = -100; automation_maxs[AUTOGROUPTYPE_X] = 100; @@ -98,6 +106,8 @@ LocalSession::LocalSession(EDL *edl) floatauto_type = FloatAuto::SMOOTH; red = green = blue = 0; + red_max = green_max = blue_max = 0; + use_max = 0; } LocalSession::~LocalSession() @@ -108,7 +118,8 @@ void LocalSession::copy_from(LocalSession *that) { strcpy(clip_title, that->clip_title); strcpy(clip_notes, that->clip_notes); - strcpy(folder, that->folder); + strcpy(clip_icon, that->clip_icon); + folder = that->folder; in_point = that->in_point; loop_playback = that->loop_playback; loop_start = that->loop_start; @@ -132,14 +143,17 @@ void LocalSession::copy_from(LocalSession *that) preview_end = that->preview_end; red = that->red; green = that->green; + blue = that->blue; + red_max = that->red_max; + green_max = that->green_max; + blue_max = that->blue_max; + use_max = that->use_max; for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) { automation_mins[i] = that->automation_mins[i]; automation_maxs[i] = that->automation_maxs[i]; } floatauto_type = that->floatauto_type; - - blue = that->blue; } void LocalSession::save_xml(FileXML *file, double start) @@ -154,7 +168,7 @@ void LocalSession::save_xml(FileXML *file, double start) file->tag.set_property("SELECTION_START", selectionstart - start); file->tag.set_property("SELECTION_END", selectionend - start); file->tag.set_property("CLIP_TITLE", clip_title); - file->tag.set_property("CLIP_NOTES", clip_notes); + file->tag.set_property("CLIP_ICON", clip_icon); file->tag.set_property("FOLDER", folder); file->tag.set_property("X_PANE", x_pane); file->tag.set_property("Y_PANE", y_pane); @@ -175,10 +189,9 @@ void LocalSession::save_xml(FileXML *file, double start) file->tag.set_property("ZOOM_TRACK", zoom_track); double preview_start = this->preview_start - start; - if(preview_start < 0) preview_start = 0; + if( preview_start < 0 ) preview_start = 0; double preview_end = this->preview_end - start; - if(preview_end < 0) preview_end = 0; - + if( preview_end < preview_start ) preview_end = -1; file->tag.set_property("PREVIEW_START", preview_start); file->tag.set_property("PREVIEW_END", preview_end); file->tag.set_property("FLOATAUTO_TYPE", floatauto_type); @@ -186,6 +199,10 @@ void LocalSession::save_xml(FileXML *file, double start) file->tag.set_property("RED", red); file->tag.set_property("GREEN", green); file->tag.set_property("BLUE", blue); + file->tag.set_property("RED_MAX", red_max); + file->tag.set_property("GREEN_MAX", green_max); + file->tag.set_property("BLUE_MAX", blue_max); + file->tag.set_property("USE_MAX", use_max); for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) { if (!Automation::autogrouptypes_fixedrange[i]) { @@ -194,6 +211,14 @@ void LocalSession::save_xml(FileXML *file, double start) } } file->append_tag(); + file->append_newline(); + +//this used to be a property, now used as tag member +// file->tag.set_property("CLIP_NOTES", clip_notes); + file->tag.set_title("CLIP_NOTES"); file->append_tag(); + file->append_text(clip_notes); + file->tag.set_title("/CLIP_NOTES"); file->append_tag(); + file->append_newline(); file->tag.set_title("/LOCALSESSION"); file->append_tag(); @@ -211,6 +236,9 @@ void LocalSession::synchronize_params(LocalSession *that) red = that->red; green = that->green; blue = that->blue; + red_max = that->red_max; + green_max = that->green_max; + blue_max = that->blue_max; } @@ -222,8 +250,25 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags) // clipboard_length = 0; // Overwritten by MWindow::load_filenames file->tag.get_property("CLIP_TITLE", clip_title); + clip_notes[0] = 0; file->tag.get_property("CLIP_NOTES", clip_notes); - file->tag.get_property("FOLDER", folder); + clip_icon[0] = 0; + file->tag.get_property("CLIP_ICON", clip_icon); +// kludge if possible + if( !clip_icon[0] ) { + char *cp = clip_notes; + int year, mon, mday, hour, min, sec; + while( *cp && *cp++ != ':' ); + if( *cp && sscanf(cp, "%d/%02d/%02d %02d:%02d:%02d,", + &year, &mon, &mday, &hour, &min, &sec) == 6 ) { + sprintf(clip_icon, "clip_%02d%02d%02d-%02d%02d%02d.png", + year, mon, mday, hour, min, sec); + } + } + int awindow_folder = file->tag.get_property("AWINDOW_FOLDER", -1); + folder = awindow_folder >= 0 ? awindow_folder : + file->tag.get_property("FOLDER", + edl->parent_edl ? AW_CLIP_FOLDER : AW_MEDIA_FOLDER); loop_playback = file->tag.get_property("LOOP_PLAYBACK", 0); loop_start = file->tag.get_property("LOOP_START", (double)0); loop_end = file->tag.get_property("LOOP_END", (double)0); @@ -250,7 +295,10 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags) red = file->tag.get_property("RED", red); green = file->tag.get_property("GREEN", green); blue = file->tag.get_property("BLUE", blue); - + red_max = file->tag.get_property("RED_MAX", red_max); + green_max = file->tag.get_property("GREEN_MAX", green_max); + blue_max = file->tag.get_property("BLUE_MAX", blue_max); + use_max = file->tag.get_property("USE_MAX", use_max); for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) { if (!Automation::autogrouptypes_fixedrange[i]) { @@ -277,6 +325,14 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags) in_point = file->tag.get_property("IN_POINT", (double)-1); out_point = file->tag.get_property("OUT_POINT", (double)-1); } + + while( !file->read_tag() ) { + if( file->tag.title_is("/LOCALSESSION") ) break; + if( file->tag.title_is("CLIP_NOTES") ) { + file->read_text_until("/CLIP_NOTES", + clip_notes, sizeof(clip_notes)-1, 1); + } + } } void LocalSession::boundaries() @@ -299,6 +355,10 @@ int LocalSession::load_defaults(BC_Hash *defaults) red = defaults->get("RED", 0.0); green = defaults->get("GREEN", 0.0); blue = defaults->get("BLUE", 0.0); + red_max = defaults->get("RED_MAX", 0.0); + green_max = defaults->get("GREEN_MAX", 0.0); + blue_max = defaults->get("BLUE_MAX", 0.0); + use_max = defaults->get("USE_MAX", 0); for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) { if (!Automation::autogrouptypes_fixedrange[i]) { @@ -329,6 +389,10 @@ int LocalSession::save_defaults(BC_Hash *defaults) defaults->update("RED", red); defaults->update("GREEN", green); defaults->update("BLUE", blue); + defaults->update("RED_MAX", red_max); + defaults->update("GREEN_MAX", green_max); + defaults->update("BLUE_MAX", blue_max); + defaults->update("USE_MAX", use_max); for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) { if (!Automation::autogrouptypes_fixedrange[i]) { @@ -440,6 +504,3 @@ int LocalSession::outpoint_valid() return out_point >= 0; } - - -