X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fvwindowgui.C;h=d6ab939d0e6376ec0461c0a765dd61fa036e83d1;hb=a88121d876acc81c5a28dbd2cc71e7c6856e2ac0;hp=4dbdff28fefc77e1c37b5b791b39dd7ac9eaf63c;hpb=a4de4732339bf38b5b225c533be1bdf60748f04a;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 4dbdff28..d6ab939d 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -614,8 +614,7 @@ void VWindowEditing::next_label() double VWindowEditing::get_position() { EDL *edl = vwindow->get_edl(); - double position = !edl ? 0 : edl->local_session->get_selectionstart(1) + - edl->session->get_frame_offset() / edl->session->frame_rate; + double position = !edl ? 0 : edl->local_session->get_selectionstart(1); return position; } @@ -624,7 +623,6 @@ void VWindowEditing::set_position(double position) EDL *edl = vwindow->get_edl(); if( !edl ) return; if( get_position() != position ) { - position -= edl->session->get_frame_offset() / edl->session->frame_rate; if( position < 0 ) position = 0; edl->local_session->set_selectionstart(position); edl->local_session->set_selectionend(position); @@ -642,73 +640,19 @@ void VWindowEditing::set_outpoint() vwindow->set_outpoint(); } -void VWindowEditing::clear_inpoint() +void VWindowEditing::unset_inoutpoint() { - vwindow->clear_inpoint(); + vwindow->unset_inoutpoint(); } -void VWindowEditing::clear_outpoint() -{ - vwindow->clear_outpoint(); -} void VWindowEditing::to_clip() { - if(vwindow->get_edl()) - { - FileXML file; - EDL *edl = vwindow->get_edl(); - double start = edl->local_session->get_selectionstart(); - double end = edl->local_session->get_selectionend(); - - if(EQUIV(start, end)) - { - end = edl->tracks->total_length(); - start = 0; - } - - - - edl->copy(start, - end, - 1, - 0, - 0, - &file, - "", - 1); - - - - - EDL *new_edl = new EDL(mwindow->edl); - new_edl->create_objects(); - new_edl->load_xml(&file, LOAD_ALL); - sprintf(new_edl->local_session->clip_title, - _("Clip %d"), mwindow->session->clip_number++); - char string[BCTEXTLEN]; - Units::totext(string, - end - start, - edl->session->time_format, - edl->session->sample_rate, - edl->session->frame_rate, - edl->session->frames_per_foot); - - sprintf(new_edl->local_session->clip_notes, - _("%s\n Created from:\n%s"), string, vwindow->gui->loaded_title); - - new_edl->local_session->set_selectionstart(0); - new_edl->local_session->set_selectionend(0); - - -//printf("VWindowEditing::to_clip 1 %s\n", edl->local_session->clip_title); - new_edl->local_session->set_selectionstart(0.0); - new_edl->local_session->set_selectionend(0.0); - vwindow->clip_edit->create_clip(new_edl); - } + EDL *edl = vwindow->get_edl(); + if( !edl ) return; + mwindow->to_clip(edl, _("viewer window: ")); } - VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y) : BC_PopupTextBox(vwindow, &vwindow->sources, @@ -931,7 +875,7 @@ void VWindowGUI::update_points() //printf("VWindowGUI::update_points 2\n"); long pixel = (long)((double)edl->local_session->in_point / - edl->tracks->total_playable_length() * + edl->tracks->total_length() * (mwindow->theme->vtimebar_w - 2 * mwindow->theme->in_point[0]->get_w())) + @@ -983,7 +927,7 @@ void VWindowGUI::update_points() //printf("VWindowGUI::update_points 10\n"); pixel = (long)((double)edl->local_session->out_point / - (edl->tracks->total_playable_length() + 0.5) * + (edl->tracks->total_length() + 0.5) * (mwindow->theme->vtimebar_w - 2 * mwindow->theme->in_point[0]->get_w())) +