tweak zoom/fullscr to remember cwdw scale after fullscr
authorGood Guy <[email protected]>
Sat, 30 Nov 2019 03:29:02 +0000 (20:29 -0700)
committerGood Guy <[email protected]>
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 410145f04817c079fb53f7aa7bb8b8032ca79e94..e3e1b0f3381d2d826fe1a16f7b3aa7ce0df1ce05 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 140f70f2fd27c598ad6a03e67fe1d52cb172cbbf..1ea04448351575048d54faaa753a6b4c85a9db88 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 d4047e3564bd3c006bcdf3c2b15dc7004d731723..0ba2530d9481c9f3691e1a578e9c2bf51ead90d1 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 fb0cdd6788300fbd08c7b8a73ee31d8418fb247d..567c9338c8f129dbd95995eae96831b6c70e88ef 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 2930efa0c6921c9abd3449e9007a98eca1660666..f58ac69afef076cd4e8de14a1755288ee48ca008 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 28603bc618a103caae2f37caa2dae58310ce2517..efb10b8f4f18bfa354f7d97d090bd298764602c7 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 f36644f5b46e84c436153d92ad4bc4a88a08a97c..24a40df8c765fdd6eed99805457b37bf56c0d321 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 2dd9e2c5e60ae55df8a7936d0509a05847e73262..dd587a5e568a514089b53df1eff24f893d1e2409 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 d8302adca5803122aa976ddc30eef3beb74a16ec..983f53e306180424329fc1ad6aefaab4827544b0 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 956cd2143f5ea4f4b74553aba917698baef4e3b4..987d325b35ece68ca10fd1b4c3244f11f429bd08 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 8ebd90dc57c725df9329616bfd6e98bf03040b93..04209af6f9071a3fcee55dabf88b1aab7c084673 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 70ed4824f5821d29c418c2d69696e1a343187ca9..d6e20b7c9ae302a1264733b2b8ee587f5ebca861 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 8ecdb0d624d39fa9e58da292ee50a838c600d4ac..7c1d51e0a0df80a702a4fd34d5cc526055f4eed1 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 d25df29ce84a4787c7314d3fd05c55e4ecc05eab..712565dde9ef5221e2c9e14f3e8c89c9c3dfa2dd 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 a52bad967a17fe266ad96323f6063902622396e9..62bcb93e17e58d76747ced7436a3b137089feb7f 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 6ddc0351d6fd6306ffdd19d598fb59862eb94cc1..bcb5f0b613bd30986c9e41f26684b6267c5e0960 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.