X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Flabels.C;h=ad3626bf13608f1c7b3bac7c217d6b66fa82d41c;hp=933985e5297dd984b99c38de10da3515e360808a;hb=1db0dacec8f9d7f5687e582bd282d9bf83bd58f0;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/labels.C b/cinelerra-5.1/cinelerra/labels.C index 933985e5..ad3626bf 100644 --- a/cinelerra-5.1/cinelerra/labels.C +++ b/cinelerra-5.1/cinelerra/labels.C @@ -272,7 +272,9 @@ void Labels::copy_from(Labels *labels) for(Label *current = labels->first; current; current = NEXT) { - append(new Label(edl, this, current->position, current->textstr)); + Label *new_label = new Label(edl, this, current->position, current->textstr); + new_label->orig_id = current->orig_id; + append(new_label); } } @@ -460,6 +462,13 @@ Label* Labels::next_label(double position) return current; } +Label* Labels::get_label(int id) +{ + Label *current = first; + while( current && current->orig_id != id ) current = NEXT; + return current; +} + int Labels::insert(double start, double length) { // shift every label including the first one back Label *current; @@ -478,37 +487,19 @@ int Labels::paste_silence(double start, double end) return 0; } -int Labels::modify_handles(double oldposition, - double newposition, - int currentend, - int handle_mode, - int edit_labels) +int Labels::modify_handles(double oldposition, double newposition, int currentend) { - if(edit_labels && - handle_mode == MOVE_ALL_EDITS) - { - if(currentend == 0) // left handle - { - if(newposition < oldposition) - { - insert(oldposition, oldposition - newposition); // shift all labels right - } - else - { - clear(oldposition, newposition); // clear selection - } - } + if( !currentend ) { // left handle + if( newposition < oldposition ) + insert(oldposition, oldposition - newposition); // shift all labels right else - { // right handle - if(newposition < oldposition) - { - clear(newposition, oldposition); - } - else - { - insert(oldposition, newposition - oldposition); - } - } + clear(oldposition, newposition); // clear selection + } + else { // right handle + if( newposition < oldposition ) + clear(newposition, oldposition); + else + insert(oldposition, newposition - oldposition); } return 0; } @@ -559,6 +550,8 @@ Label* Labels::label_of(double position) Label::Label() : ListItem