pluginclient cr=apply in option value textbox, add loop_mode for vwdw
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vwindowgui.C
index 1fb4ca21d64bafb76ed674f1d15659274ee7dbdc..09d3e6f52b60cceb83ec8840625754ccaa1ecd14 100644 (file)
@@ -129,7 +129,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);
@@ -227,6 +227,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, ""));
@@ -237,7 +238,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());
@@ -558,7 +558,9 @@ 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
 {
        this->mwindow = mwindow;
        this->vwindow = vwindow;
@@ -703,6 +705,7 @@ 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)
@@ -774,6 +777,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();
@@ -821,6 +830,32 @@ void VWindowCanvas::close_source()
        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_scope(VFrame *output, int refresh)
+{
+       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)
 {