X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fclipedit.C;h=a3f633aa6c5b44f86e689278748f20b4fd76dd91;hp=e30656737b0269820c19bcba4a2481aa51db62f4;hb=502b6f3b6fd04f6b01c6d70dcb81aa304dd0db1c;hpb=680d2000be2db33da1e2733461854158067f5862 diff --git a/cinelerra-5.1/cinelerra/clipedit.C b/cinelerra-5.1/cinelerra/clipedit.C index e3065673..a3f633aa 100644 --- a/cinelerra-5.1/cinelerra/clipedit.C +++ b/cinelerra-5.1/cinelerra/clipedit.C @@ -56,12 +56,11 @@ ClipEdit::~ClipEdit() // After the window is closed and deleted, this is called. void ClipEdit::handle_close_event(int result) { - if(!result) - { + if( !result ) { int name_ok = 1; - for( int i = 0; name_ok && i < mwindow->edl->clips.total; ++i ) { + for( int i=0; name_ok && iedl->clips.size(); ++i ) { if( !strcasecmp(clip->local_session->clip_title, - mwindow->edl->clips.values[i]->local_session->clip_title) && + mwindow->edl->clips[i]->local_session->clip_title) && (create_it || strcasecmp(clip->local_session->clip_title, original->local_session->clip_title)) ) name_ok = 0; @@ -72,10 +71,9 @@ void ClipEdit::handle_close_event(int result) } } - if(!result) - { + if( !result ) { // Add to EDL - if(create_it) + if( create_it ) mwindow->edl->add_clip(clip); else // Copy clip to existing clip in EDL original->copy_session(clip); @@ -84,21 +82,16 @@ void ClipEdit::handle_close_event(int result) // Change VWindow to it if vwindow was called // But this doesn't let you easily create a lot of clips. - if(vwindow && create_it) - { + if( vwindow && create_it ) { // vwindow->change_source(new_edl); } } - else - { + else { mwindow->session->clip_number--; } - - -// For creating new clips, the original was copied in add_clip. -// For editing old clips, the original was transferred to another variable. - if(!create_it) clip->remove_user(); +// always a copy from new_gui + clip->remove_user(); original = 0; clip = 0; create_it = 0; @@ -109,14 +102,9 @@ void ClipEdit::handle_close_event(int result) BC_Window* ClipEdit::new_gui() { original = clip; - - if(!create_it) - { - this->clip = new EDL(mwindow->edl); - clip->create_objects(); - clip->copy_all(original); - } - + this->clip = new EDL(mwindow->edl); + clip->create_objects(); + clip->copy_all(original); window = new ClipEditWindow(mwindow, this); window->create_objects(); @@ -125,47 +113,31 @@ BC_Window* ClipEdit::new_gui() -void ClipEdit::edit_clip(EDL *clip) +void ClipEdit::edit_clip(EDL *clip, int x, int y) { close_window(); -// Allow more than one window so we don't have to delete the clip in handle_event - if(!this->clip) - { - this->clip = clip; - this->create_it = 0; - start(); - } -} -void ClipEdit::create_clip(EDL *clip) -{ -// Allow more than one window so we don't have to delete the clip in handle_event - if(!this->clip) - { - this->clip = clip; - this->create_it = 1; - start(); - } + this->clip = clip; + this->create_it = 0; + this->x = x; this->y = y; + start(); } +void ClipEdit::create_clip(EDL *clip, int x, int y) +{ + close_window(); - - - - + this->clip = clip; + this->create_it = 1; + this->x = x; this->y = y; + start(); +} ClipEditWindow::ClipEditWindow(MWindow *mwindow, ClipEdit *thread) : BC_Window(_(PROGRAM_NAME ": Clip Info"), - mwindow->gui->get_abs_cursor_x(1) - 400 / 2, - mwindow->gui->get_abs_cursor_y(1) - 350 / 2, - 400, - 350, - 400, - 430, - 0, - 0, - 1) + thread->x -400/2, thread->y - 350/2, + 400, 350, 400, 430, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread;