tweak zoom/fullscr to remember cwdw scale after fullscr
authorGood Guy <good1.2guy@gmail.com>
Sat, 30 Nov 2019 03:29:02 +0000 (20:29 -0700)
committerGood Guy <good1.2guy@gmail.com>
Sat, 30 Nov 2019 03:29:02 +0000 (20:29 -0700)
16 files changed:
cinelerra-5.1/cinelerra/canvas.C
cinelerra-5.1/cinelerra/canvas.h
cinelerra-5.1/cinelerra/cwindow.C
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/cwindowgui.h
cinelerra-5.1/cinelerra/dbwindow.C
cinelerra-5.1/cinelerra/dbwindow.h
cinelerra-5.1/cinelerra/record.C
cinelerra-5.1/cinelerra/recordmonitor.C
cinelerra-5.1/cinelerra/recordmonitor.h
cinelerra-5.1/cinelerra/resample.C
cinelerra-5.1/cinelerra/versioninfo.h
cinelerra-5.1/cinelerra/vwindowgui.C
cinelerra-5.1/cinelerra/vwindowgui.h
cinelerra-5.1/cinelerra/zwindowgui.C
cinelerra-5.1/msg/txt

index 410145f..e3e1b0f 100644 (file)
@@ -135,11 +135,6 @@ int Canvas::get_fullscreen()
        return is_fullscreen;
 }
 
-void Canvas::set_fullscreen(int value)
-{
-       is_fullscreen = value;
-}
-
 // Get dimensions given a zoom
 void Canvas::calculate_sizes(float aspect_ratio,
                int output_w, int output_h, float zoom,
@@ -576,29 +571,34 @@ void Canvas::stop_video()
        }
 }
 
-
-int Canvas::use_fullscreen(int on)
+int Canvas::set_fullscreen(int on, int unlock)
 {
+       int ret = 0;
+       BC_WindowBase *window = get_canvas();
+       if( unlock )
+               window->unlock_window();
        if( on && !get_fullscreen() ) {
                start_fullscreen();
-               return 1;
+               ret = 1;
        }
        if( !on && get_fullscreen() ) {
                stop_fullscreen();
-               return 1;
+               ret = 1;
        }
-       return 0;
+       if( unlock )
+               window->lock_window("Canvas::set_fullscreen");
+       return ret;
 }
 
 void Canvas::start_fullscreen()
 {
-       set_fullscreen(1);
+       is_fullscreen = 1;
        create_canvas();
 }
 
 void Canvas::stop_fullscreen()
 {
-       set_fullscreen(0);
+       is_fullscreen = 0;
        create_canvas();
 }
 
@@ -661,7 +661,6 @@ void Canvas::create_canvas()
 }
 
 
-
 int Canvas::cursor_leave_event_base(BC_WindowBase *caller)
 {
        int result = 0;
@@ -693,20 +692,19 @@ int Canvas::button_press_event_base(BC_WindowBase *caller)
 int Canvas::keypress_event(BC_WindowBase *caller)
 {
        int key = caller->get_keypress();
+       int on = -1;
        switch( key ) {
        case 'f':
-               caller->unlock_window();
-               use_fullscreen(get_fullscreen() ? 0 : 1);
-               caller->lock_window("Canvas::keypress_event 1");
+               on = get_fullscreen() ? 0 : 1;
                break;
        case ESC:
-               caller->unlock_window();
-               use_fullscreen(0);
-               caller->lock_window("Canvas::keypress_event 2");
+               on = 0;
                break;
        default:
                return 0;
        }
+       if( on >= 0 )
+               set_fullscreen(on);
        return 1;
 }
 
@@ -933,9 +931,7 @@ int CanvasSubWindowItem::handle_event()
 {
 // It isn't a problem to delete the canvas from in here because the event
 // dispatcher is the canvas subwindow.
-       canvas->subwindow->unlock_window();
-       canvas->use_fullscreen(0);
-       canvas->subwindow->lock_window("CanvasSubWindowItem::handle_event");
+       canvas->set_fullscreen(0);
        return 1;
 }
 
@@ -1108,18 +1104,10 @@ int CanvasToggleControls::handle_event()
 
 char* CanvasToggleControls::calculate_text(int cwindow_controls)
 {
-       if(!cwindow_controls)
-               return _("Show controls");
-       else
-               return _("Hide controls");
+       return !cwindow_controls ? _("Show controls") : _("Hide controls");
 }
 
 
-
-
-
-
-
 CanvasFullScreenItem::CanvasFullScreenItem(Canvas *canvas)
  : BC_MenuItem(_("Fullscreen"), "f", 'f')
 {
@@ -1127,20 +1115,11 @@ CanvasFullScreenItem::CanvasFullScreenItem(Canvas *canvas)
 }
 int CanvasFullScreenItem::handle_event()
 {
-       canvas->subwindow->unlock_window();
-       canvas->use_fullscreen(1);
-       canvas->subwindow->lock_window("CanvasFullScreenItem::handle_event");
+       canvas->set_fullscreen(1);
        return 1;
 }
 
 
-
-
-
-
-
-
-
 CanvasPopupRemoveSource::CanvasPopupRemoveSource(Canvas *canvas)
  : BC_MenuItem(_("Close source"))
 {
index 140f70f..1ea0444 100644 (file)
@@ -79,9 +79,8 @@ public:
        virtual void toggle_controls() {}
        virtual int get_cwindow_controls() { return 0; }
        virtual int get_fullscreen();
-       virtual void set_fullscreen(int value);
        virtual int get_clear_color();
-       virtual int use_fullscreen(int on);
+       virtual int set_fullscreen(int on, int unlock=1);
 
        int cursor_leave_event_base(BC_WindowBase *caller);
        int cursor_enter_event_base(BC_WindowBase *caller);
index d4047e3..0ba2530 100644 (file)
@@ -327,8 +327,9 @@ int CWindowRemoteHandler::remote_process_key(RemoteControl *remote_control, int
        case 'e':
                break;
        case 'f': {
-               Canvas *canvas = mwindow_gui->mwindow->cwindow->gui->canvas;
-               canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
+               CWindowCanvas *canvas = mwindow_gui->mwindow->cwindow->gui->canvas;
+               int on = canvas->get_fullscreen() ? 0 : 1;
+               canvas->Canvas::set_fullscreen(on, 0);
                return 1; }
        default:
                return -1;
index fb0cdd6..567c933 100644 (file)
@@ -443,9 +443,11 @@ int CWindowGUI::keypress_event()
                result = 1;
                break;
        case 'f':
-               unlock_window();
-               canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
-               lock_window("CWindowGUI::keypress_event 1");
+               canvas->set_fullscreen(canvas->get_fullscreen() ? 0 : 1);
+               result = 1;
+               break;
+       case ESC:
+               canvas->set_fullscreen(0);
                result = 1;
                break;
        case 'x':
@@ -465,12 +467,6 @@ int CWindowGUI::keypress_event()
                lock_window("CWindowGUI::keypress_event 3");
                result = 1;
                break;
-       case ESC:
-               unlock_window();
-               canvas->use_fullscreen(0);
-               lock_window("CWindowGUI::keypress_event 4");
-               result = 1;
-               break;
        case LEFT:
                if( !ctrl_down() ) {
                        int alt_down = this->alt_down();
@@ -984,6 +980,9 @@ CWindowCanvas::CWindowCanvas(MWindow *mwindow, CWindowGUI *gui)
 {
        this->mwindow = mwindow;
        this->gui = gui;
+       last_xscroll = 0;
+       last_yscroll = 0;
+       last_zoom = 0;
 }
 
 void CWindowCanvas::status_event()
@@ -1000,15 +999,25 @@ void CWindowCanvas::update_zoom(int x, int y, float zoom)
        mwindow->edl->session->cwindow_scrollbars = use_scrollbars;
 }
 
-int CWindowCanvas::use_fullscreen(int on)
+int CWindowCanvas::set_fullscreen(int on)
 {
-       if( Canvas::use_fullscreen(on) ) {
-               gui->lock_window("CWindowCanvas::use_fullscreen");
+       int ret = 0;
+       if( on && !get_fullscreen() ) {
+               last_xscroll = get_xscroll();
+               last_yscroll = get_yscroll();
+               last_zoom = get_zoom();
+               Canvas::set_fullscreen(1);
                zoom_auto();
-               if( !on ) gui->zoom_panel->update(0);
-               gui->unlock_window();
+               ret = 1;
        }
-       return 1;
+       if( !on && get_fullscreen() ) {
+               Canvas::set_fullscreen(0);
+               gui->zoom_panel->update(get_zoom());
+               update_zoom(last_xscroll, last_yscroll, last_zoom);
+               gui->update_canvas();
+               ret = 1;
+       }
+       return ret;
 }
 
 int CWindowCanvas::get_xscroll()
index 2930efa..f58ac69 100644 (file)
@@ -319,9 +319,7 @@ public:
        void reset_camera();
        void reset_projector();
        void draw_crophandle(int x, int y);
-       int use_fullscreen(int on);
-       void start_fullscreen();
-       void stop_fullscreen();
+       int set_fullscreen(int on);
 
 // Draw the camera/projector overlay in different colors.
        void draw_outlines(int do_camera);
@@ -333,6 +331,8 @@ public:
 
        MWindow *mwindow;
        CWindowGUI *gui;
+       float last_xscroll, last_yscroll;
+       float last_zoom;
 };
 
 #endif
index 28603bc..efb10b8 100644 (file)
@@ -951,7 +951,6 @@ DbWindowCanvas(DbWindowGUI *gui, int x, int y, int w, int h)
  : Canvas(gui->dwindow->mwindow, gui, x, y, w, h, w, h, 0)
 {
        this->gui = gui;
-       this->is_fullscreen = 0;
 }
 
 DbWindowCanvas::
index f36644f..24a40df 100644 (file)
@@ -226,7 +226,6 @@ class DbWindowCanvas : public Canvas
 {
 public:
        DbWindowGUI *gui;
-       int is_fullscreen;
 
        DbWindowCanvas(DbWindowGUI *gui, int x, int y, int w, int h);
        ~DbWindowCanvas();
@@ -234,8 +233,6 @@ public:
        void draw_frame(VFrame *frame, int x, int y, int w, int h);
        int button_press_event() { return 0; }
        int keypress_event() { return 0; }
-       int get_fullscreen() { return is_fullscreen; }
-       void set_fullscreen(int value) { is_fullscreen = value; }
 };
 
 class DbWindowVIcon : public VIcon
index 2dd9e2c..dd587a5 100644 (file)
@@ -1826,8 +1826,9 @@ int Record::remote_process_key(RemoteControl *remote_control, int key)
                channel_down();
                break;
        case 'f': {
-               Canvas *canvas = record_monitor->window->canvas;
-               canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
+               RecordMonitorCanvas *canvas = record_monitor->window->canvas;
+               int on = canvas->get_fullscreen() ? 0 : 1;
+               canvas->Canvas::set_fullscreen(on, 0);
                break; }
        default:
                return -1;
index d8302ad..983f53e 100644 (file)
@@ -874,6 +874,11 @@ int RecordMonitorCanvas::keypress_event()
        return 1;
 }
 
+int RecordMonitorCanvas::keypress_event(RecordMonitorGUI *window)
+{
+       return Canvas::keypress_event(window);
+}
+
 
 RecordMonitorFullsize::RecordMonitorFullsize(MWindow *mwindow,
        RecordMonitorGUI *window)
index 956cd21..987d325 100644 (file)
@@ -107,7 +107,7 @@ public:
        void enable_signal_status(int enable);
 
        MeterPanel *meters;
-       Canvas *canvas;
+       RecordMonitorCanvas *canvas;
 //     RecordTransport *record_transport;
 #ifdef HAVE_FIREWIRE
        AVC1394Transport *avc1394_transport;
@@ -228,6 +228,7 @@ public:
        int cursor_enter_event();
        void reset_translation();
        int keypress_event();
+       int keypress_event(RecordMonitorGUI *window);
        int get_output_w();
        int get_output_h();
 
index 8ebd90d..04209af 100644 (file)
@@ -70,6 +70,9 @@ void Resample::reset()
        input_position = 0;
 }
 
+/* This algorithm from:
+ * SIGNAL PROCESSING ALGORITHMS IN FORTRAN AND C
+ * S.D. Stearns and R.A. David, Prentice-Hall, 1992 */
 void Resample::blackman(double fcn, int filter_l)
 {
        double wcn = M_PI * fcn;
index 70ed482..d6e20b7 100644 (file)
@@ -5,7 +5,7 @@
 #define REPOMAINTXT "git://git.cinelerra-gg.org/goodguy/cinelerra.git\n"
 #define COPYRIGHT_DATE "2019"
 #define COPYRIGHTTEXT1 "(c) 2006-2019 Heroine Virtual Ltd. by Adam Williams\n"
-#define COPYRIGHTTEXT2 "(c) 2007-2019 cin5 derivative by W.P. Morrow aka goodguy\n"
+#define COPYRIGHTTEXT2 "2007-2020 mods for Cinelerra-GG by W.P.Morrow aka goodguy\n"
 #undef COMPILEDATE
 
 #endif
index 8ecdb0d..7c1d51e 100644 (file)
@@ -364,15 +364,10 @@ int VWindowGUI::keypress_event()
                mwindow->redo_entry(this);
                break;
        case 'f':
-               unlock_window();
-               canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
-               lock_window("VWindowGUI::keypress_event 1");
+               canvas->set_fullscreen(canvas->get_fullscreen() ? 0 : 1);
                break;
        case ESC:
-               unlock_window();
-               if( canvas->get_fullscreen() )
-                       canvas->use_fullscreen(0);
-               lock_window("VWindowGUI::keypress_event 2");
+               canvas->set_fullscreen(0);
                break;
        case KEY_F1:
        case KEY_F2:
@@ -878,14 +873,3 @@ void VWindowCanvas::draw_overlays()
        }
 }
 
-int VWindowCanvas::use_fullscreen(int on)
-{
-       if( Canvas::use_fullscreen(on) ) {
-               gui->lock_window("VWindowCanvas::use_fullscreen");
-               zoom_auto();
-               draw_refresh(1);
-               gui->unlock_window();
-       }
-       return 1;
-}
-
index d25df29..712565d 100644 (file)
@@ -121,7 +121,6 @@ public:
        void draw_overlays();
        void close_source();
        void zoom_auto();
-       int use_fullscreen(int on);
 
        MWindow *mwindow;
        VWindowGUI *gui;
index a52bad9..62bcb93 100644 (file)
@@ -96,22 +96,22 @@ int ZWindowGUI::keypress_event()
                close_event();
                return 1;
        }
-       unlock_window();
        int result = 1;
        switch( key ) {
        case 'f':
-               canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
+               canvas->set_fullscreen(canvas->get_fullscreen() ? 0 : 1);
                break;
        case ESC:
-               canvas->use_fullscreen(0);
+               canvas->set_fullscreen(0);
                break;
        default:
+               unlock_window();
                mwindow->gui->lock_window("ZWindowGUI::keypress_event");
                result = mwindow->gui->mbuttons->transport->do_keypress(key);
                mwindow->gui->unlock_window();
+               lock_window("ZWindowGUI::keypress_event 1");
        }
 
-       lock_window("ZWindowGUI::keypress_event 1");
        return result;
 }
 
index 6ddc035..bcb5f0b 100644 (file)
@@ -8,6 +8,11 @@ Cinfinity icons selected in Preferences Sam (CC BY 3.0,
 Cakewalk and Neophyte themes by Olaf Wolff (CC BY 4.0,
   https://creativecommons.org/licenses/by/4.0/)
 .
+November 2019 New Features of note:
+  Audio improvements added for playback/speed/sampling.
+  Spanish po and website translations updated by Sergio.
+  Transcode 1:1 added to convert to a different format.
+  Compositor zoom using the wheel & panning is available.
 October 2019 New Features of note:
   Scaling for any size monitor now available in Preferences.
   New Shape Wipe video transitions have been contributed.