Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / cwindowgui.C
index beac0f8184b22e87b9538b2781b7573a56c03a44..d9738c2cbe8c93b5989d85fd9487c6178d6604d2 100644 (file)
@@ -58,6 +58,7 @@
 #include "tracks.h"
 #include "transportque.h"
 #include "vtrack.h"
+#include "zoombar.h"
 
 
 static double my_zoom_table[] =
@@ -112,6 +113,8 @@ CWindowGUI::CWindowGUI(MWindow *mwindow, CWindow *cwindow)
        control_out_x = control_out_y = 0;
        translating_zoom = 0;
        highlighted = 0;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Compositor Window");
 }
 
 CWindowGUI::~CWindowGUI()
@@ -591,6 +594,9 @@ int CWindowGUI::keypress_event()
        if( !result )
                result = transport->keypress_event();
 
+       if( !result )
+               result = context_help_check_and_show();
+
        return result;
 }
 
@@ -759,7 +765,9 @@ CWindowEditing::CWindowEditing(MWindow *mwindow, CWindow *cwindow)
                0, // use_commerical
                0, // use_goto
                1, // use_clk2play
-               1) // use_scope
+               1, // use_scope
+               0, // use_gang_tracks
+               0) // use_timecode
 {
        this->mwindow = mwindow;
        this->cwindow = cwindow;
@@ -824,6 +832,7 @@ void panel_btn(set_editing_mode,(int mode), set_editing_mode(mode))
 void panel_btn(set_auto_keyframes,(int v), set_auto_keyframes(v))
 void panel_btn(set_span_keyframes,(int v), set_span_keyframes(v))
 void panel_btn(set_labels_follow_edits,(int v), set_labels_follow_edits(v))
+void panel_btn(set_gang_tracks,(int v), set_gang_tracks(v))
 
 
 CWindowMeters::CWindowMeters(MWindow *mwindow,
@@ -1094,14 +1103,21 @@ int CWindowCanvas::do_scroll(EDL *edl, float cursor_x, float cursor_y)
 
 int CWindowCanvas::scope_on()
 {
-       return !gui->edit_panel->scope_dialog ? 0 :
-               gui->edit_panel->scope_dialog->running();
+       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 CWindowCanvas::draw_scope(VFrame *output)
+void CWindowCanvas::draw_scope(VFrame *output, int refresh)
 {
-       if( gui->edit_panel->scope_dialog && output )
-               gui->edit_panel->scope_dialog->process(output);
+       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);
 }
 
 void CWindowCanvas::draw_refresh(int flush)
@@ -2632,6 +2648,12 @@ void CWindowCanvas::reset_keyframe(int do_camera)
                z_keyframe->set_value(1);
 
                gui->sync_parameters(CHANGE_PARAMS, 1, 1);
+               MWindowGUI *mgui = mwindow->gui;
+               mgui->lock_window("CWindowCanvas::reset_keyframe");
+               gui->mwindow->edl->local_session->reset_view_limits();
+               gui->mwindow->gui->zoombar->update_autozoom();
+               mgui->unlock_window();
+               mwindow->save_backup();
        }
 }
 
@@ -3038,9 +3060,13 @@ int CWindowCanvas::test_bezier(int button_press,
                                redraw = 1;
                        }
 
-                       float x_val = gui->affected_x->get_value();
-                       float y_val = gui->affected_y->get_value();
-                       float z_val = gui->affected_z->get_value();
+                       CWindowToolGUI *tool_gui = !gui->tool_panel ? 0 : gui->tool_panel->tool_gui;
+                       int edge = tool_gui ? tool_gui->edge : 0;
+                       int span = tool_gui ? tool_gui->span : 0;
+
+                       float x_val = gui->affected_x->get_value(edge);
+                       float y_val = gui->affected_y->get_value(edge);
+                       float z_val = gui->affected_z->get_value(edge);
 
                        if( gui->translating_zoom ) {
                                float z = gui->center_z + (cursor_y - gui->y_origin) / yS(128);
@@ -3050,7 +3076,7 @@ int CWindowCanvas::test_bezier(int button_press,
                                        redraw = 1;
                                        redraw_canvas = 1;
                                }
-                               gui->affected_z->set_value(z);
+                               gui->affected_z->bump_value(z, edge, span);
                        }
                        else {
                                float dx = cursor_x - gui->x_origin;
@@ -3061,8 +3087,8 @@ int CWindowCanvas::test_bezier(int button_press,
                                }
                                float x = gui->center_x + dx;
                                float y = gui->center_y + dy;
-                               gui->affected_x->set_value(x);
-                               gui->affected_y->set_value(y);
+                               gui->affected_x->bump_value(x, edge, span);
+                               gui->affected_y->bump_value(y, edge, span);
                                if( !EQUIV(x_val, x) || !EQUIV(y_val, y) ) {
                                        rerender = 1;
                                        redraw = 1;
@@ -3331,6 +3357,9 @@ int CWindowCanvas::button_release_event()
 {
        int result = 0;
        const char *undo_label = 0;
+       BC_WindowBase *window = get_canvas();
+       if( window && !window->get_video_on() )
+               draw_scope(refresh_frame, -1);
 
        switch( gui->current_operation ) {
        case CWINDOW_SCROLL: