add configure with-clang, fix segv on asset_info nested edl, single frame preview...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vwindowgui.C
index e1524d6dd269adbadd1a6b276b09a4dbbb769070..062989a2523de2ed498ae69db891f6d4b36f15c6 100644 (file)
@@ -31,6 +31,7 @@
 #include "edl.h"
 #include "edlsession.h"
 #include "filesystem.h"
+#include "file.h"
 #include "filexml.h"
 #include "fonts.h"
 #include "keys.h"
@@ -241,8 +242,18 @@ 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());
+       VFrame *vsplash = VFramePng::vframe_png(vsplash_path);
+       if( vsplash ) {
+               BC_WindowBase *vcanvas = canvas->get_canvas();
+               vcanvas->draw_vframe(vsplash,
+                       0,0, vcanvas->get_w(), vcanvas->get_h(),
+                       0,0, vsplash->get_w(), vsplash->get_h(), 0);
+               vcanvas->flash(1);
+               delete vsplash;
+       }
 //printf("VWindowGUI::create_objects 1\n");
        add_subwindow(timebar = new VTimeBar(mwindow,
                this,
@@ -701,6 +712,7 @@ void VWindowEditing::panel_fit_selection() {}
 void VWindowEditing::panel_fit_autos(int all) {}
 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) {}
 
 
@@ -823,37 +835,30 @@ void VWindowCanvas::draw_refresh(int flush)
 {
        EDL *edl = gui->vwindow->get_edl();
 
-       if(!get_canvas()->get_video_on()) get_canvas()->clear_box(0, 0, get_canvas()->get_w(), get_canvas()->get_h());
-       if(!get_canvas()->get_video_on() && refresh_frame && edl)
-       {
-               float in_x1, in_y1, in_x2, in_y2;
-               float out_x1, out_y1, out_x2, out_y2;
-               get_transfers(edl,
-                       in_x1, in_y1, in_x2, in_y2,
-                       out_x1, out_y1, out_x2, out_y2);
+       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);
+               int ow = get_output_w(edl), oh = get_output_h(edl);
+               if( ow > 0 && oh > 0 && refresh_frame && edl ) {
+                       float in_x1, in_y1, in_x2, in_y2;
+                       float out_x1, out_y1, out_x2, out_y2;
+                       get_transfers(edl,
+                               in_x1, in_y1, in_x2, in_y2,
+                               out_x1, out_y1, out_x2, out_y2);
 // input scaled from session to refresh frame coordinates
-               int ow = get_output_w(edl);
-               int oh = get_output_h(edl);
-               int rw = refresh_frame->get_w();
-               int rh = refresh_frame->get_h();
-               float xs = (float)rw / ow;
-               float ys = (float)rh / oh;
-               in_x1 *= xs;  in_x2 *= xs;
-               in_y1 *= ys;  in_y2 *= ys;
-               get_canvas()->draw_vframe(refresh_frame,
-                               (int)out_x1,
-                               (int)out_y1,
-                               (int)(out_x2 - out_x1),
-                               (int)(out_y2 - out_y1),
-                               (int)in_x1,
-                               (int)in_y1,
-                               (int)(in_x2 - in_x1),
-                               (int)(in_y2 - in_y1),
+                       int rw = refresh_frame->get_w();
+                       int rh = refresh_frame->get_h();
+                       float xs = (float)rw / ow;
+                       float ys = (float)rh / oh;
+                       in_x1 *= xs;  in_x2 *= xs;
+                       in_y1 *= ys;  in_y2 *= ys;
+                       get_canvas()->draw_vframe(refresh_frame,
+                               (int)out_x1, (int)out_y1,
+                               (int)(out_x2 - out_x1), (int)(out_y2 - out_y1),
+                               (int)in_x1, (int)in_y1,
+                               (int)(in_x2 - in_x1), (int)(in_y2 - in_y1),
                                0);
-       }
-
-       if(!get_canvas()->get_video_on())
-       {
+               }
                draw_overlays();
                get_canvas()->flash(flush);
        }