X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fvwindowgui.C;h=25404f32f2f597c1169fb0bbc31ad7a6a0ba2ae3;hp=062989a2523de2ed498ae69db891f6d4b36f15c6;hb=HEAD;hpb=281532ab870d8f6ded35d8e8555bf974014ace77 diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 062989a2..9b7f6ca8 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -68,11 +68,7 @@ VWindowGUI::VWindowGUI(MWindow *mwindow, VWindow *vwindow) mwindow->session->vwindow_y, mwindow->session->vwindow_w, mwindow->session->vwindow_h, - 100, - 100, - 1, - 1, - 0) // Hide it + xS(100), yS(100), 1, 1, 0) // Hide it { this->mwindow = mwindow; this->vwindow = vwindow; @@ -83,6 +79,8 @@ VWindowGUI::VWindowGUI(MWindow *mwindow, VWindow *vwindow) // source = 0; strcpy(loaded_title, ""); highlighted = 0; +// *** CONTEXT_HELP *** + context_help_set_keyword("Viewer Window"); } VWindowGUI::~VWindowGUI() @@ -99,7 +97,7 @@ VWindowGUI::~VWindowGUI() void VWindowGUI::draw_wave() { - TransportCommand command; + TransportCommand command(mwindow->preferences); command.command = NORMAL_FWD; command.get_edl()->copy_all(vwindow->get_edl()); command.change_type = CHANGE_ALL; @@ -133,7 +131,7 @@ void VWindowGUI::draw_wave() for( int i=channels; --i>=0; ) delete samples[i]; delete render_engine; - delete cache; + cache->remove_user(); delete canvas->refresh_frame; canvas->refresh_frame = vframe; canvas->refresh(1); @@ -231,6 +229,7 @@ void VWindowGUI::create_objects() mwindow->theme->vtransport_x, mwindow->theme->vtransport_y); transport->create_objects(); + transport->set_transport(LOOP_MODE); //printf("VWindowGUI::create_objects 1\n"); // add_subwindow(fps_title = new BC_Title(mwindow->theme->vedit_x, y, "")); @@ -241,7 +240,6 @@ void VWindowGUI::create_objects() canvas = new VWindowCanvas(mwindow, this); canvas->create_objects(mwindow->edl); - canvas->use_vwindow(); char vsplash_path[BCTEXTLEN]; int vsplash_len = sizeof(vsplash_path)-1; snprintf(vsplash_path, vsplash_len, "%s/vsplash.png", File::get_cindat_path()); @@ -367,19 +365,12 @@ int VWindowGUI::keypress_event() case 'Z': mwindow->redo_entry(this); break; - case 'f': - unlock_window(); - if( canvas->get_fullscreen() ) - canvas->stop_fullscreen(); - else - canvas->start_fullscreen(); - lock_window("VWindowGUI::keypress_event 1"); - break; + case 'f': { + int on = canvas->get_fullscreen() ? 0 : 1; + canvas->set_fullscreen(on, 1); + break; } case ESC: - unlock_window(); - if( canvas->get_fullscreen() ) - canvas->stop_fullscreen(); - lock_window("VWindowGUI::keypress_event 2"); + canvas->set_fullscreen(0, 1); break; case KEY_F1: case KEY_F2: @@ -393,6 +384,8 @@ int VWindowGUI::keypress_event() } if( !result ) result = transport->keypress_event(); + if( !result ) + result = context_help_check_and_show(); return result; } @@ -569,7 +562,10 @@ VWindowEditing::VWindowEditing(MWindow *mwindow, VWindow *vwindow) 0, // use_cut 0, // use_commerical 0, // use_goto - 1) // use_clk2play + 1, // use_clk2play + 1, // use_scope + 0, // use_gang_tracks + 0) // use_timecode { this->mwindow = mwindow; this->vwindow = vwindow; @@ -714,16 +710,12 @@ void VWindowEditing::panel_set_editing_mode(int mode) {} void VWindowEditing::panel_set_auto_keyframes(int v) {} void VWindowEditing::panel_set_span_keyframes(int v) {} void VWindowEditing::panel_set_labels_follow_edits(int v) {} +void VWindowEditing::panel_set_gang_tracks(int v) {} VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y) - : BC_PopupTextBox(vwindow, - &vwindow->sources, - "", - x, - y, - 200, - 200) + : BC_PopupTextBox(vwindow, &vwindow->sources, "", + x, y, xS(200), yS(200)) { this->mwindow = mwindow; this->vwindow = vwindow; @@ -790,6 +782,12 @@ VWindowCanvas::VWindowCanvas(MWindow *mwindow, VWindowGUI *gui) this->gui = gui; } +void VWindowCanvas::create_objects(EDL *edl) +{ + Canvas::create_objects(edl); + canvas_menu->add_item(new CanvasPopupRemoveSource(this)); +} + void VWindowCanvas::zoom_resize_window(float percentage) { EDL *edl = gui->vwindow->get_edl(); @@ -824,22 +822,56 @@ void VWindowCanvas::zoom_resize_window(float percentage) gui->resize_event(new_w, new_h); } +void VWindowCanvas::zoom_auto() +{ + EDL *edl = gui->vwindow->get_edl(); + if(!edl) edl = mwindow->edl; + set_zoom(edl, 0); +} + void VWindowCanvas::close_source() { gui->vwindow->interrupt_playback(1); gui->vwindow->delete_source(1, 1); } +int VWindowCanvas::scope_on() +{ + EditPanelScopeDialog *scope_dialog = gui->edit_panel->scope_dialog; + if( !scope_dialog || !scope_dialog->scope_gui ) return 0; + if( scope_dialog->scope_gui->use_refresh ) return 0; + if( scope_dialog->scope_gui->use_release ) return 0; + return scope_dialog->running(); +} -void VWindowCanvas::draw_refresh(int flush) +void VWindowCanvas::draw_scope(VFrame *output, int refresh) { - EDL *edl = gui->vwindow->get_edl(); + if( !output ) return; + EditPanelScopeDialog *scope_dialog = gui->edit_panel->scope_dialog; + if( !scope_dialog || !scope_dialog->scope_gui ) return; + if( scope_dialog->scope_gui->use_refresh && !refresh ) return; + if( scope_dialog->scope_gui->use_release && refresh >= 0 ) return; + scope_dialog->process(output); +} + +int VWindowCanvas::button_release_event() +{ + BC_WindowBase *window = get_canvas(); + if( window && !window->get_video_on() ) + draw_scope(refresh_frame, -1); + return Canvas::button_release_event(); +} +void VWindowCanvas::draw_refresh(int flush) +{ if( !get_canvas()->get_video_on() ) { int cw = get_canvas()->get_w(), ch = get_canvas()->get_h(); get_canvas()->clear_box(0, 0, cw, ch); + } + EDL *edl = gui->vwindow->get_edl(); + if( refresh_frame && edl ) { int ow = get_output_w(edl), oh = get_output_h(edl); - if( ow > 0 && oh > 0 && refresh_frame && edl ) { + if( ow > 0 && oh > 0 ) { float in_x1, in_y1, in_x2, in_y2; float out_x1, out_y1, out_x2, out_y2; get_transfers(edl, @@ -859,6 +891,8 @@ void VWindowCanvas::draw_refresh(int flush) (int)(in_x2 - in_x1), (int)(in_y2 - in_y1), 0); } + } + if( !get_canvas()->get_video_on() ) { draw_overlays(); get_canvas()->flash(flush); }