X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowedit.C;h=2366c3884cb17aa3b1b1739ecd3228fde98d56a6;hb=86bd203ac1fc29d93f63d13e2979468f06bdc3a2;hp=7b06f5efb4e5f8f5726a55a97fb15b410e9d10ee;hpb=4a90ef3ae46465c0634f81916b79e279e4bd9961;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 7b06f5ef..2366c388 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -1058,12 +1058,14 @@ void MWindow::mute_selection() } -void MWindow::overwrite(EDL *source) +void MWindow::overwrite(EDL *source, int all) { FileXML file; - double src_start = source->local_session->get_selectionstart(); - double overwrite_len = source->local_session->get_selectionend() - src_start; + double src_start = all ? 0 : + source->local_session->get_selectionstart(); + double overwrite_len = all ? source->tracks->total_length() : + source->local_session->get_selectionend() - src_start; double dst_start = edl->local_session->get_selectionstart(); double dst_len = edl->local_session->get_selectionend() - dst_start; @@ -1989,13 +1991,15 @@ void MWindow::unset_inoutpoint(int is_mwindow) } } -void MWindow::splice(EDL *source) +void MWindow::splice(EDL *source, int all) { FileXML file; undo->update_undo_before(); - double source_start = source->local_session->get_selectionstart(); - double source_end = source->local_session->get_selectionend(); + double source_start = all ? 0 : + source->local_session->get_selectionstart(); + double source_end = all ? source->tracks->total_length() : + source->local_session->get_selectionend(); source->copy(source_start, source_end, 1, &file, "", 1); //file.dump(); double start = edl->local_session->get_selectionstart(); @@ -2043,7 +2047,7 @@ void MWindow::save_clip(EDL *new_edl, const char *txt) } time_t now; time(&now); - struct tm *tm = localtime(&now); + struct tm dtm; localtime_r(&now, &dtm); char *cp = new_edl->local_session->clip_notes; int n, sz = sizeof(new_edl->local_session->clip_notes)-1; if( txt && *txt ) { @@ -2052,8 +2056,8 @@ void MWindow::save_clip(EDL *new_edl, const char *txt) } n = snprintf(cp, sz, "%02d/%02d/%02d %02d:%02d:%02d, +%s\n", - tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec, duration); + dtm.tm_year+1900, dtm.tm_mon+1, dtm.tm_mday, + dtm.tm_hour, dtm.tm_min, dtm.tm_sec, duration); cp += n; sz -= n; if( path && *path ) { FileSystem fs; @@ -2063,7 +2067,10 @@ void MWindow::save_clip(EDL *new_edl, const char *txt) cp += n; sz -= n; } cp[n] = 0; - + sprintf(new_edl->local_session->clip_icon, + "clip_%02d%02d%02d-%02d%02d%02d.png", + dtm.tm_year+1900, dtm.tm_mon+1, dtm.tm_mday, + dtm.tm_hour, dtm.tm_min, dtm.tm_sec); edl->update_assets(new_edl); int cur_x, cur_y; gui->get_abs_cursor(cur_x, cur_y, 0); @@ -2076,14 +2083,16 @@ void MWindow::save_clip(EDL *new_edl, const char *txt) save_backup(); } -void MWindow::to_clip(EDL *edl, const char *txt) +void MWindow::to_clip(EDL *edl, const char *txt, int all) { FileXML file; double start, end; gui->lock_window("MWindow::to_clip 1"); - start = edl->local_session->get_selectionstart(); - end = edl->local_session->get_selectionend(); + start = all ? 0 : + edl->local_session->get_selectionstart(); + end = all ? edl->tracks->total_length() : + edl->local_session->get_selectionend(); if( EQUIV(end, start) ) { start = 0; @@ -2371,6 +2380,18 @@ void MWindow::set_proxy(int use_scaler, int new_scale, int auto_scale, } } } + for( int j=0,m=edl->clips.size(); jclips[j]; + for( Track *track=clip->tracks->first; track; track=track->next ) { + if( track->data_type != TRACK_VIDEO ) continue; + for( Edit *edit=track->edits->first; edit; edit=edit->next ) { + if( !edit->asset ) continue; + if( !strcmp(edit->asset->path, orig_assets->get(i)->path) ) { + edit->asset = proxy_asset; + } + } + } + } } }