port 7.2 mods: align_edits foreground plugin refresh_frame tweak, rework soundlevel...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vwindowgui.C
index 69ad7bbf2ea4ad1b0c8ef8983248857986a8fa18..1fb4ca21d64bafb76ed674f1d15659274ee7dbdc 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"
@@ -67,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;
@@ -241,8 +238,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,
@@ -356,19 +363,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:
@@ -701,17 +701,13 @@ 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) {}
 
 
 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;
@@ -812,6 +808,13 @@ 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);
@@ -821,13 +824,14 @@ void VWindowCanvas::close_source()
 
 void VWindowCanvas::draw_refresh(int flush)
 {
-       EDL *edl = gui->vwindow->get_edl();
-
        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,
@@ -847,6 +851,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);
        }