From: Good Guy Date: Sun, 24 Apr 2016 21:43:40 +0000 (-0600) Subject: transition at beginning/end, shape xtion fixes X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=05bf5047966713579bd8e7a692fda3b49bc43450;p=goodguy%2Fhistory.git transition at beginning/end, shape xtion fixes --- diff --git a/cinelerra-5.1/cinelerra/apluginarray.C b/cinelerra-5.1/cinelerra/apluginarray.C index b265d12c..a2be5514 100644 --- a/cinelerra-5.1/cinelerra/apluginarray.C +++ b/cinelerra-5.1/cinelerra/apluginarray.C @@ -19,6 +19,7 @@ * */ +#include "asset.h" #include "amodule.h" #include "apluginarray.h" #include "atrack.h" @@ -81,7 +82,8 @@ void APluginArray::create_modules() void APluginArray::process_realtime(int module, int64_t input_position, int64_t len) { - values[module]->process_buffer(realtime_buffers + module, + int ibfr = module % file->asset->channels; + values[module]->process_buffer(realtime_buffers + ibfr, input_position, len, edl->session->sample_rate, @@ -92,7 +94,8 @@ void APluginArray::process_realtime(int module, int64_t input_position, int64_t int APluginArray::process_loop(int module, int64_t &write_length) { if(!realtime_buffers) realtime_buffers = file->get_audio_buffer(); - int result = values[module]->process_loop(&realtime_buffers[module], + int ibfr = module % file->asset->channels; + int result = values[module]->process_loop(&realtime_buffers[ibfr], write_length); return result; } diff --git a/cinelerra-5.1/cinelerra/edit.C b/cinelerra-5.1/cinelerra/edit.C index 0ede9b9e..0792fa44 100644 --- a/cinelerra-5.1/cinelerra/edit.C +++ b/cinelerra-5.1/cinelerra/edit.C @@ -213,10 +213,8 @@ int64_t Edit::get_source_end(int64_t default_) void Edit::insert_transition(char *title) { //printf("Edit::insert_transition this=%p title=%p title=%s\n", this, title, title); - detach_transition(); - transition = new Transition(edl, - this, - title, + delete transition; + transition = new Transition(edl, this, title, track->to_units(edl->session->default_transition_length, 1)); } @@ -228,10 +226,7 @@ void Edit::detach_transition() int Edit::silence() { - if(asset || nested_edl) - return 0; - else - return 1; + return asset || nested_edl ? 0 : 1; } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 98736302..890aaac6 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -2871,11 +2871,9 @@ void MWindow::rebuild_indices() void MWindow::save_backup() { FileXML file; + edl->optimize(); edl->set_path(session->filename); - edl->save_xml(&file, - BACKUP_PATH, - 0, - 0); + edl->save_xml(&file, BACKUP_PATH, 0, 0); file.terminate_string(); char path[BCTEXTLEN]; FileSystem fs; diff --git a/cinelerra-5.1/cinelerra/track.C b/cinelerra-5.1/cinelerra/track.C index ec243b28..10460c0c 100644 --- a/cinelerra-5.1/cinelerra/track.C +++ b/cinelerra-5.1/cinelerra/track.C @@ -245,7 +245,8 @@ double Track::get_length() for(int i = 0; i < plugin_set.total; i++) { if( !plugin_set.values[i]->last ) continue; - length = from_units(plugin_set.values[i]->last->startproject); + length = from_units(plugin_set.values[i]->last->startproject + + plugin_set.values[i]->last->length); if(length > total_length) total_length = length; } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index e9511d2d..2a64845a 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -203,25 +203,24 @@ int TrackCanvas::drag_motion(Track **over_track, { int64_t edit_x, edit_y, edit_w, edit_h; edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h); - - if( cursor_x >= edit_x && cursor_x < edit_x + edit_w && - cursor_y >= edit_y && cursor_y < edit_y + edit_h ) { + if( cursor_y < edit_y || cursor_y >= edit_y + edit_h ) continue; + if( cursor_x >= edit_x && cursor_x < edit_x + edit_w ) { *over_edit = edit; break; } if( edit != track->edits->last ) continue; - if( edit->silence() ) continue; if( mwindow->session->current_operation != DRAG_ATRANSITION && mwindow->session->current_operation != DRAG_VTRANSITION ) continue; - if( cursor_x >= edit_x + edit_w && - cursor_y >= edit_y && cursor_y < edit_y + edit_h ) { + if( !edit->silence() ) { // add silence to allow drag transition past last edit // will be deleted by Edits::optimize if not used double length = mwindow->edl->session->default_transition_length; int64_t start = edit->startproject+edit->length; int64_t units = track->to_units(length, 1); track->edits->create_silence(start, start+units); + continue; } + if( cursor_x >= edit_x ) { *over_edit = edit; break; } } for(int i = 0; i < track->plugin_set.total; i++) diff --git a/cinelerra-5.1/cinelerra/tracksedit.C b/cinelerra-5.1/cinelerra/tracksedit.C index 77f31e5c..4f83fff0 100644 --- a/cinelerra-5.1/cinelerra/tracksedit.C +++ b/cinelerra-5.1/cinelerra/tracksedit.C @@ -361,6 +361,10 @@ void Tracks::set_transition_length(double start, double end, double length) { current_edit->transition->length = current_track->to_units(length, 1); + if( current_edit == current_track->edits->last && + current_edit->silence() ) { + current_edit->length = current_edit->transition->length; + } } } } @@ -383,6 +387,10 @@ void Tracks::set_transition_length(Transition *transition, double length) if(current_edit->transition == transition) { transition->length = current_track->to_units(length, 1); + if( current_edit == current_track->edits->last && + current_edit->silence() ) { + current_edit->length = current_edit->transition->length; + } done = 1; } } @@ -399,22 +407,32 @@ void Tracks::paste_transitions(double start, double end, int track_type, char* t { int64_t start_units = current_track->to_units(start, 0); int64_t end_units = current_track->to_units(end, 0); - - for(Edit *current_edit = current_track->edits->first; - current_edit; - current_edit = current_edit->next) - { - if(current_edit->startproject > 0 && - ((end_units > start_units && - current_edit->startproject >= start_units && - current_edit->startproject < end_units) || - (end_units == start_units && - current_edit->startproject <= start_units && - current_edit->startproject + current_edit->length > start_units))) - { + if( start_units == end_units ) { + for( Edit *current_edit = current_track->edits->first; + current_edit; current_edit = current_edit->next) { + int64_t edit_start = current_edit->startproject; + int64_t edit_end = edit_start + current_edit->length; + if( edit_start > start_units ) continue; + if( start_units == current_track->edits->length() ) { + double length = edl->session->default_transition_length; + int64_t units = current_track->to_units(length, 1); + current_edit = current_track->edits-> + create_silence(start_units, start_units+units); + } + else if( start_units >= edit_end ) continue; current_edit->insert_transition(title); } } + else { + for( Edit *current_edit = current_track->edits->first; + current_edit; current_edit = current_edit->next) { + int64_t edit_start = current_edit->startproject; + if( !edit_start ) continue; + if( edit_start >= start_units && edit_start < end_units ) { + current_edit->insert_transition(title); + } + } + } } } } @@ -978,6 +996,11 @@ void Tracks::paste_audio_transition(PluginServer *server) Edit *current_edit = current->edits->editof(position, PLAY_FORWARD, 0); + if( !current_edit && position == current->edits->length() ) { + double length = edl->session->default_transition_length; + int64_t units = current->to_units(length, 1); + current_edit = current->edits->create_silence(position, position+units); + } if(current_edit) { paste_transition(server, current_edit); @@ -1127,6 +1150,11 @@ void Tracks::paste_video_transition(PluginServer *server, int first_track) Edit *current_edit = current->edits->editof(position, PLAY_FORWARD, 0); + if( !current_edit && position == current->edits->length() ) { + double length = edl->session->default_transition_length; + int64_t units = current->to_units(length, 1); + current_edit = current->edits->create_silence(position, position+units); + } if(current_edit) { paste_transition(server, current_edit); diff --git a/cinelerra-5.1/cinelerra/vpluginarray.C b/cinelerra-5.1/cinelerra/vpluginarray.C index bfb57271..b5118ce9 100644 --- a/cinelerra-5.1/cinelerra/vpluginarray.C +++ b/cinelerra-5.1/cinelerra/vpluginarray.C @@ -19,6 +19,7 @@ * */ +#include "asset.h" #include "bcsignals.h" #include "cache.h" #include "edl.h" @@ -97,7 +98,8 @@ void VPluginArray::process_realtime(int module, int64_t input_position, int64_t len) { - values[module]->process_buffer(realtime_buffers[module], + int ibfr = module % file->asset->layers; + values[module]->process_buffer(realtime_buffers[ibfr], input_position, edl->session->frame_rate, end - start, @@ -109,15 +111,16 @@ int VPluginArray::process_loop(int module, int64_t &write_length) if(!realtime_buffers) realtime_buffers = file->get_video_buffer(); // Convert from array of frames to array of tracks - VFrame **temp_buffer; - temp_buffer = new VFrame*[total_tracks()]; - for(int i = 0; i < total_tracks(); i++) - { - temp_buffer[i] = realtime_buffers[i][0]; - } - - int result = values[module]->process_loop(realtime_buffers[module], write_length); - delete [] temp_buffer; +// VFrame **temp_buffer; +// temp_buffer = new VFrame*[total_tracks()]; +// for(int i = 0; i < total_tracks(); i++) +// { +// temp_buffer[i] = realtime_buffers[i][0]; +// } + + int ibfr = module % file->asset->layers; + int result = values[module]->process_loop(realtime_buffers[ibfr], write_length); +// delete [] temp_buffer; return result; } diff --git a/cinelerra-5.1/plugins/shapes/circle.png b/cinelerra-5.1/plugins/shapes/circle.png index 5707e287..610fe6cb 100644 Binary files a/cinelerra-5.1/plugins/shapes/circle.png and b/cinelerra-5.1/plugins/shapes/circle.png differ diff --git a/cinelerra-5.1/plugins/shapes/clock.png b/cinelerra-5.1/plugins/shapes/clock.png index 229d0095..0a3f1411 100644 Binary files a/cinelerra-5.1/plugins/shapes/clock.png and b/cinelerra-5.1/plugins/shapes/clock.png differ diff --git a/cinelerra-5.1/plugins/shapes/heart.png b/cinelerra-5.1/plugins/shapes/heart.png index d36fe1c8..76793239 100644 Binary files a/cinelerra-5.1/plugins/shapes/heart.png and b/cinelerra-5.1/plugins/shapes/heart.png differ diff --git a/cinelerra-5.1/plugins/shapes/tile2x2h.png b/cinelerra-5.1/plugins/shapes/tile2x2h.png index 2f44841e..b1066717 100644 Binary files a/cinelerra-5.1/plugins/shapes/tile2x2h.png and b/cinelerra-5.1/plugins/shapes/tile2x2h.png differ diff --git a/cinelerra-5.1/plugins/shapes/tile2x2v.png b/cinelerra-5.1/plugins/shapes/tile2x2v.png index 7b83149b..7734f59c 100644 Binary files a/cinelerra-5.1/plugins/shapes/tile2x2v.png and b/cinelerra-5.1/plugins/shapes/tile2x2v.png differ