X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ftracksedit.C;h=4a836b96a1fb15755d52c498c290ada63c858c65;hp=4f83fff0e949bb8f9ff4a9ef1f9f1ae2ff02c300;hb=2e48b660e37eb5c661264d601211e16cb6cd6e89;hpb=05bf5047966713579bd8e7a692fda3b49bc43450 diff --git a/cinelerra-5.1/cinelerra/tracksedit.C b/cinelerra-5.1/cinelerra/tracksedit.C index 4f83fff0..4a836b96 100644 --- a/cinelerra-5.1/cinelerra/tracksedit.C +++ b/cinelerra-5.1/cinelerra/tracksedit.C @@ -47,6 +47,15 @@ #include "vtrack.h" #include +int Tracks::blade(double position) +{ + for( Track *track=first; track!=0; track=track->next ) { + if( !track->record ) continue; + track->blade(position); + } + return 0; +} + int Tracks::clear(double start, double end, int clear_plugins, int edit_autos) { Track *current_track; @@ -61,10 +70,10 @@ int Tracks::clear(double start, double end, int clear_plugins, int edit_autos) end, 1, // edits 1, // labels - clear_plugins, + clear_plugins, // edit_plugins edit_autos, - 1, - 0); + 1, // convert_units + 0); // trim_edits } } return 0; @@ -560,7 +569,7 @@ int Tracks::delete_tracks() return total_deleted; } -void Tracks::move_edits(ArrayList *edits, +void Tracks::move_edits(ArrayList *edits, Track *track, double position, int edit_labels, // Ignored @@ -623,15 +632,18 @@ void Tracks::move_edits(ArrayList *edits, { // This works like this: CUT edit, INSERT edit at final position, keyframes also follow // FIXME: there should be a GUI way to tell whenever user also wants to move autos or not +// this is all screwed up +// inserts defaults/bogus everywhere +#if 0 // Copy keyframes FileXML temp; AutoConf temp_autoconf; temp_autoconf.set_all(1); - source_track->automation->copy(source_edit->startproject, - source_edit->startproject + source_edit->length, - &temp, + source_track->automation->copy(source_edit->startproject, + source_edit->startproject + source_edit->length, + &temp, 0, 0); temp.terminate_string(); @@ -639,7 +651,7 @@ void Tracks::move_edits(ArrayList *edits, // Insert new keyframes //printf("Tracks::move_edits 2 %d %p\n", result->startproject, result->asset); source_track->automation->clear(source_edit->startproject, - source_edit->startproject + source_edit->length, + source_edit->startproject + source_edit->length, &temp_autoconf, 1); int64_t position_a = position_i; @@ -647,45 +659,45 @@ void Tracks::move_edits(ArrayList *edits, { if (position_a > source_edit->startproject) position_a -= source_length; - } + } - dest_track->automation->paste_silence(position_a, + dest_track->automation->paste_silence(position_a, position_a + source_length); while(!temp.read_tag()) - dest_track->automation->paste(position_a, + dest_track->automation->paste(position_a, source_length, 1.0, &temp, 0, 1, &temp_autoconf); - +#endif // Insert new edit - Edit *dest_edit = dest_track->edits->shift(position_i, + Edit *dest_edit = dest_track->edits->shift(position_i, source_length); - Edit *result = dest_track->edits->insert_before(dest_edit, + Edit *result = dest_track->edits->insert_before(dest_edit, dest_track->edits->create_edit()); result->copy_from(source_edit); result->startproject = position_i; result->length = source_length; // Clear source - source_track->edits->clear(source_edit->startproject, + source_track->edits->clear(source_edit->startproject, source_edit->startproject + source_length); /* //this is outline for future thinking how it is supposed to be done trough C&P mechanisms temp.reset_tag(); - source_track->cut(source_edit->startproject, - source_edit->startproject + source_edit->length, - &temp, + source_track->cut(source_edit->startproject, + source_edit->startproject + source_edit->length, + &temp, NULL); temp.terminate_string(); temp.rewind(); - dest_track->paste_silence(position_a, + dest_track->paste_silence(position_a, position_a + source_length, edit_plugins); while(!temp.read_tag()) - dest_track->paste(position_a, // MISSING PIECE OF FUNCTIONALITY - source_length, - 1.0, - &temp, + dest_track->paste(position_a, // MISSING PIECE OF FUNCTIONALITY + source_length, + 1.0, + &temp, 0, &temp_autoconf); */ @@ -696,18 +708,18 @@ void Tracks::move_edits(ArrayList *edits, // ONLY edit is moved, all other edits stay where they are { // Copy edit to temp, delete the edit, insert the edit - Edit *temp_edit = dest_track->edits->create_edit(); + Edit *temp_edit = dest_track->edits->create_edit(); temp_edit->copy_from(source_edit); // we call the edits directly since we do not want to move keyframes or anything else - source_track->edits->clear(source_startproject, + source_track->edits->clear(source_startproject, + source_startproject + source_length); + source_track->edits->paste_silence(source_startproject, source_startproject + source_length); - source_track->edits->paste_silence(source_startproject, - source_startproject + source_length); - dest_track->edits->clear(position_i, + dest_track->edits->clear(position_i, position_i + source_length); Edit *dest_edit = dest_track->edits->shift(position_i, source_length); - Edit *result = dest_track->edits->insert_before(dest_edit, + Edit *result = dest_track->edits->insert_before(dest_edit, dest_track->edits->create_edit()); result->copy_from(temp_edit); result->startproject = position_i; @@ -763,6 +775,7 @@ void Tracks::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position // update plugin position plugin->startproject = position; plugin->plugin_set = plugin_set; + plugin->edits = plugin_set; src_plugin_set->track->optimize(); }