shift keypad toggles audio, xtion masks, render+prefs widget placement
authorGood Guy <good1.2guy@gmail.com>
Thu, 3 Aug 2017 21:31:44 +0000 (15:31 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 3 Aug 2017 21:31:44 +0000 (15:31 -0600)
12 files changed:
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/playtransport.C
cinelerra-5.1/cinelerra/playtransport.h
cinelerra-5.1/cinelerra/render.C
cinelerra-5.1/cinelerra/renderengine.C
cinelerra-5.1/cinelerra/transportque.C
cinelerra-5.1/cinelerra/transportque.h
cinelerra-5.1/cinelerra/transportque.inc
cinelerra-5.1/cinelerra/vdeviceprefs.C
cinelerra-5.1/plugins/shapes/burst.png [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/specks.png [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/spiral.png

index 556bc8bdd69a6e87c51f9a9bfe690f24a1f53b45..90c67b1a5acb5fdc80d25b815ac353bec936e684 100644 (file)
@@ -80,7 +80,7 @@ void InterfacePrefs::create_objects()
        x = x2;
        BC_Title *title;
        add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
-       y += 25;
+       y += title->get_h() + 5;
        keyframe_reticle = new KeyframeReticle(pwindow, this, x, y,
                &pwindow->thread->preferences->keyframe_reticle);
        add_subwindow(keyframe_reticle);
@@ -505,7 +505,7 @@ int HairlineItem::handle_event()
 
 KeyframeReticle::KeyframeReticle(PreferencesWindow *pwindow,
        InterfacePrefs *iface_prefs, int x, int y, int *output)
- : BC_PopupMenu(x, y, 175, hairline_to_string(*output))
+ : BC_PopupMenu(x, y, 220, hairline_to_string(*output))
 {
        this->pwindow = pwindow;
        this->iface_prefs = iface_prefs;
index d8f0cbf5886414657b4eb47ca1dff1d6e85c9fbd..85fe95a446a9252cd6d5bd935b8cfffc99c6cb0b 100644 (file)
@@ -180,74 +180,52 @@ int PlayTransport::flip_vertical(int vertical, int &x, int &y)
 int PlayTransport::keypress_event()
 {
        int result = 1;
-       if(subwindow->shift_down())
-       {
-               switch(subwindow->get_keypress())
-               {
-                       case END:
-                               subwindow->lock_window("PlayTransport::keypress_event 1");
-                               goto_end();
-                               subwindow->unlock_window();
-                               break;
-                       case HOME:
-                               subwindow->lock_window("PlayTransport::keypress_event 2");
-                               goto_start();
-                               subwindow->unlock_window();
-                               break;
-                       default:
-                               result = 0;
-                               break;
-               }
+       int key = subwindow->get_keypress();
+// unqualified keys, still holding lock
+       switch( key ) {
+       case HOME:
+               goto_start();
+               return result;
+       case END:
+               goto_end();
                return result;
        }
 
-// Set playback range to in/out points if CTRL is down
-       int use_inout = 0;
-       if(subwindow->ctrl_down())
-       {
-               use_inout = 1;
-       }
+       int toggle_audio = subwindow->shift_down() ? 1 : 0;
+       int use_inout = subwindow->ctrl_down() ? 1 : 0;
+       int command = -1, prev_command = engine->command->command;
        using_inout = use_inout;
        subwindow->unlock_window();
 
-
-       switch(subwindow->get_keypress())
-       {
-               case KPPLUS:    handle_transport(FAST_REWIND, 0, use_inout);            break;
-               case KP6:       handle_transport(NORMAL_REWIND, 0, use_inout);          break;
-               case KP5:       handle_transport(SLOW_REWIND, 0, use_inout);            break;
-               case KP4:       handle_transport(SINGLE_FRAME_REWIND, 0, use_inout);    break;
-               case KP1:       handle_transport(SINGLE_FRAME_FWD, 0, use_inout);       break;
-               case KP2:       handle_transport(SLOW_FWD, 0, use_inout);               break;
-               case KP3:       handle_transport(NORMAL_FWD, 0, use_inout);             break;
-               case KPENTER:   handle_transport(FAST_FWD, 0, use_inout);               break;
-               case KPINS:     handle_transport(STOP, 0, use_inout);                   break;
-               case ' ': {
-                       int prev_command = engine->command->command;
-                       int new_command = prev_command == COMMAND_NONE ||
-                                       prev_command == CURRENT_FRAME ||
-                                       prev_command == PAUSE ||
-                                       prev_command == STOP ? NORMAL_FWD : STOP;
-                               handle_transport(new_command, 0, use_inout);            break;
-                         }
-               case 'k':       handle_transport(STOP, 0, use_inout);                   break;
-               case END:
-                       subwindow->lock_window("PlayTransport::keypress_event 3");
-                       goto_end();
-                       subwindow->unlock_window();
-                       break;
-               case HOME:
-                       subwindow->lock_window("PlayTransport::keypress_event 4");
-                       goto_start();
-                       subwindow->unlock_window();
-                       break;
-               default:
-                       result = 0;
+       switch( key ) {
+       case 'k':
+       case KPINS:     command = STOP;                 break;
+       case KPPLUS:    command = FAST_REWIND;          break;
+       case KP6:       command = NORMAL_REWIND;        break;
+       case KP5:       command = SLOW_REWIND;          break;
+       case KP4:       command = SINGLE_FRAME_REWIND;  break;
+       case KP1:       command = SINGLE_FRAME_FWD;     break;
+       case KP2:       command = SLOW_FWD;             break;
+       case KP3:       command = NORMAL_FWD;           break;
+       case KPENTER:   command = FAST_FWD;             break;
+       case ' ':
+               switch( prev_command ) {
+               case COMMAND_NONE:
+               case CURRENT_FRAME:
+               case PAUSE:
+               case STOP:
+                       command = NORMAL_FWD;
                        break;
+               }
+               break;
+       default:
+               result = 0;
+               break;
        }
+       if( command >= 0 )
+               handle_transport(command, 0, use_inout, 1, toggle_audio);
 
        subwindow->lock_window("PlayTransport::keypress_event 5");
-
        return result;
 }
 
@@ -265,115 +243,80 @@ void PlayTransport::goto_end()
 
 
 void PlayTransport::handle_transport(int command,
-       int wait_tracking,
-       int use_inout,
-       int update_refresh)
+       int wait_tracking, int use_inout, int update_refresh, int toggle_audio)
 {
-       if(!get_edl()) return;
+       if( !get_edl() ) return;
 
 // Stop requires transferring the output buffer to a refresh buffer.
        int do_stop = 0;
+       int resume = 0;
 //printf("PlayTransport::handle_transport 1 %d\n", command);
        int prev_command = engine->command->command;
        int prev_direction = engine->command->get_direction();
        int prev_single_frame = engine->command->single_frame();
 
 // Dispatch command
-       switch(command)
-       {
-// Commands that play back
-               case FAST_REWIND:
-               case NORMAL_REWIND:
-               case SLOW_REWIND:
-               case SINGLE_FRAME_REWIND:
-               case SINGLE_FRAME_FWD:
-               case SLOW_FWD:
-               case NORMAL_FWD:
-               case FAST_FWD:
+       switch(command) {
+       case FAST_REWIND:       // Commands that play back
+       case NORMAL_REWIND:
+       case SLOW_REWIND:
+       case SINGLE_FRAME_REWIND:
+       case SINGLE_FRAME_FWD:
+       case SLOW_FWD:
+       case NORMAL_FWD:
+       case FAST_FWD:
+               if( prev_command == command && !prev_single_frame ) {
 // Same direction pressed twice.  Stop
-                       if(prev_command == command &&
-                               !prev_single_frame)
-                       {
-                               do_stop = 1;
-                       }
-                       else
+                       do_stop = 1;
+                       break;
+               }
 // Resume or change direction
-                       if(prev_command != STOP &&
-                               prev_command != COMMAND_NONE &&
-                               prev_command != SINGLE_FRAME_FWD &&
-                               prev_command != SINGLE_FRAME_REWIND)
-                       {
-                               engine->que->send_command(STOP,
-                                       CHANGE_NONE,
-                                       0,
-                                       0,
-                                       0,
-                                       0);
-                               engine->interrupt_playback(wait_tracking);
-                               engine->que->send_command(command,
-                                       CHANGE_NONE,
-                                       get_edl(),
-                                       1,
-                                       1,
-                                       use_inout);
-                       }
-                       else
+               switch( prev_command ) {
+               default:
+                       engine->que->send_command(STOP, CHANGE_NONE, 0, 0, 0, 0);
+                       engine->interrupt_playback(wait_tracking);
+                       resume = 1;
+// fall through
+               case STOP:
+               case COMMAND_NONE:
+               case SINGLE_FRAME_FWD:
+               case SINGLE_FRAME_REWIND:
 // Start from scratch
-                       {
-                               engine->que->send_command(command,
-                                       CHANGE_NONE,
-                                       get_edl(),
-                                       1,
-                                       0,
-                                       use_inout);
-                       }
+                       engine->que->send_command(command, CHANGE_NONE, get_edl(),
+                               1, resume, use_inout, toggle_audio);
                        break;
+               }
+               break;
 
 // Commands that stop
-               case STOP:
-                       do_stop = 1;
-                       break;
+       case STOP:
+               do_stop = 1;
+               break;
 
-               case REWIND:
-               case GOTO_END:
-                       engine->que->send_command(STOP,
-                               CHANGE_NONE,
-                               0,
-                               0,
-                               0,
-                               0);
+       case REWIND:
+       case GOTO_END:
+               engine->que->send_command(STOP, CHANGE_NONE, 0, 0, 0, 0);
                        engine->interrupt_playback(wait_tracking);
                        break;
        }
 
-       if(do_stop)
-       {
-               engine->que->send_command(STOP,
-                       CHANGE_NONE,
-                       0,
-                       0,
-                       0,
-                       0);
+       if( do_stop ) {
+               engine->que->send_command(STOP, CHANGE_NONE, 0, 0, 0, 0);
                engine->interrupt_playback(wait_tracking);
 // This is necessary to get an OpenGL output buffer
 // printf("PlayTransport::handle_transport 2 update_refresh=%d prev_command=%d prev_direction=%d\n",
 // update_refresh, prev_command, prev_direction);
-               if(!prev_single_frame &&
-                       update_refresh &&
-                       prev_command != STOP &&
-                       prev_command != COMMAND_NONE)
-               {
-                       engine->que->send_command(
-                               (prev_direction == PLAY_FORWARD) ? SINGLE_FRAME_REWIND : SINGLE_FRAME_FWD,
-                               CHANGE_NONE,
-                               get_edl(),
-                               1,
-                               0,
-                               0);
+               if( !prev_single_frame && update_refresh &&
+                   prev_command != STOP && prev_command != COMMAND_NONE ) {
+                       int command = (prev_direction == PLAY_FORWARD) ?
+                                       SINGLE_FRAME_REWIND : SINGLE_FRAME_FWD;
+                       engine->que->send_command(command,
+                               CHANGE_NONE, get_edl(), 1, 0, 0);
                }
        }
 }
 
+
 EDL* PlayTransport::get_edl()
 {
        return mwindow->edl;
index 6de294aff2893b8d377857df7e3f9fb7152b09e2..11233b2b1030cd363e30e837cb87b15d198b0382 100644 (file)
@@ -56,11 +56,9 @@ public:
 // of playback
 // update_refresh - causes a frame advance to be issued after STOP to update
 // the refresh frame.
-       void handle_transport(int command,
-               int wait_tracking = 0,
-               int use_inout = 0,
-               int update_refresh = 1);
-
+// toggle_audio - reverses audio playback enable in RenderEngine::get_duty
+       void handle_transport(int command, int wait_tracking=0,
+               int use_inout=0, int update_refresh=1, int toggle_audio=0);
        int pause_transport();
        int reset_transport();
        int get_w();
index 6667cbbba30d1e6241fe2a6000d330285618c7e3..085384ae9b8ad3f2b165062f349897ff53acb7b3 100644 (file)
@@ -1121,7 +1121,7 @@ void RenderThread::run()
 
 
 #define WIDTH 480
-#define HEIGHT 455
+#define HEIGHT 480
 
 
 RenderWindow::RenderWindow(MWindow *mwindow,
@@ -1185,16 +1185,18 @@ void RenderWindow::create_objects()
        if( is_image )
                render->range_type = RANGE_1FRAME;
 
-       int x1 = x + title->get_w() + 20, x2 = x1 + 140;
+       int x1 = x + title->get_w() + 20;
        add_subwindow(rangeproject = new RenderRangeProject(this,
                render->range_type == RANGE_PROJECT, x1, y));
-       add_subwindow(range1frame = new RenderRange1Frame(this,
-               render->range_type == RANGE_1FRAME, x2, y));
        y += 20;
        add_subwindow(rangeselection = new RenderRangeSelection(this,
                render->range_type == RANGE_SELECTION, x1, y));
+       y += 20;
        add_subwindow(rangeinout = new RenderRangeInOut(this,
-               render->range_type == RANGE_INOUT, x2, y));
+               render->range_type == RANGE_INOUT, x1, y));
+       y += 20;
+       add_subwindow(range1frame = new RenderRange1Frame(this,
+               render->range_type == RANGE_1FRAME, x1, y));
        y += 30;
 
        if( is_image )
index bb8f43a865c86f4dc92a3afe4b0d4a6aa5a64ce9..4e8bc7de26d189ca8fc36ebf8c3fd5969b2feee5 100644 (file)
@@ -189,11 +189,11 @@ void RenderEngine::get_duty()
        do_video = 0;
 
 //printf("RenderEngine::get_duty %d\n", __LINE__);
-       if(!command->single_frame() &&
-               get_edl()->tracks->playable_audio_tracks() &&
-               get_edl()->session->audio_channels)
+       if( get_edl()->tracks->playable_audio_tracks() &&
+           get_edl()->session->audio_channels )
        {
-               do_audio = 1;
+               do_audio = !command->single_frame() ? 1 : 0;
+               if( command->audio_toggle ) do_audio = !do_audio;
        }
 
 //printf("RenderEngine::get_duty %d\n", __LINE__);
index fef685826df873f4ffd5226845a95e3562d70023..16aa45faf352aad41e945a99057f41dc1ed50521 100644 (file)
@@ -52,6 +52,7 @@ void TransportCommand::reset()
        infinite = 0;
        realtime = 0;
        resume = 0;
+       audio_toggle = 0;
 // Don't reset the change type for commands which don't perform the change
        if(command != STOP) change_type = 0;
        command = COMMAND_NONE;
@@ -85,6 +86,7 @@ void TransportCommand::copy_from(TransportCommand *command)
        this->playbackstart = command->playbackstart;
        this->realtime = command->realtime;
        this->resume = command->resume;
+       this->audio_toggle = command->audio_toggle;
 }
 
 TransportCommand& TransportCommand::operator=(TransportCommand &command)
@@ -148,13 +150,10 @@ float TransportCommand::get_speed()
 }
 
 // Assume starting without pause
-void TransportCommand::set_playback_range(EDL *edl, int use_inout)
+void TransportCommand::set_playback_range(EDL *edl, int use_inout, int toggle_audio)
 {
        if(!edl) edl = this->edl;
 
-
-
-
        switch(command)
        {
                case SLOW_FWD:
@@ -226,6 +225,7 @@ void TransportCommand::set_playback_range(EDL *edl, int use_inout)
                        break;
        }
 
+       audio_toggle = toggle_audio;
 }
 
 void TransportCommand::playback_range_adjust_inout()
@@ -275,12 +275,8 @@ TransportQue::~TransportQue()
        delete output_lock;
 }
 
-int TransportQue::send_command(int command,
-               int change_type,
-               EDL *new_edl,
-               int realtime,
-               int resume,
-               int use_inout)
+int TransportQue::send_command(int command, int change_type, EDL *new_edl,
+               int realtime, int resume, int use_inout, int toggle_audio)
 {
        input_lock->lock("TransportQue::send_command 1");
        this->command.command = command;
@@ -307,7 +303,7 @@ int TransportQue::send_command(int command,
                }
 
 // Set playback range
-               this->command.set_playback_range(new_edl, use_inout);
+               this->command.set_playback_range(new_edl, use_inout, toggle_audio);
        }
 
        input_lock->unlock();
index 5093b0eace75c4c629601d297098b7a1a2e9b53e..1eed30e7f0115ca93794d22f511d1380639a40de 100644 (file)
@@ -41,7 +41,7 @@ public:
        void copy_from(TransportCommand *command);
        TransportCommand& operator=(TransportCommand &command);
 // Get the range to play back from the EDL
-       void set_playback_range(EDL *edl = 0, int use_inout = 0);
+       void set_playback_range(EDL *edl=0, int use_inout=0, int toggle_audio=0);
 
 // Adjust playback range with in/out points for rendering
        void playback_range_adjust_inout();
@@ -69,6 +69,8 @@ public:
        int realtime;
 // Use persistant starting point
        int resume;
+// reverse audio duty
+       int audio_toggle;
 
 private:
 // Copied to render engines
@@ -88,7 +90,8 @@ public:
                int realtime,
 // Persistent starting point
                int resume = 0,
-               int use_inout = 0);
+               int use_inout = 0,
+               int toggle_audio = 0);
        void update_change_type(int change_type);
 
        TransportCommand command;
index 5f0c0b90f9705e4aa49e1be3750ebbf64bd4514c..3ce2f20ef14144a152bab9319c3a78d5f19e4365 100644 (file)
 
 // Commands
 // Perform change but don't render anything
-#define COMMAND_NONE              0
+#define COMMAND_NONE         0
 // Stop playback but keep existing change_type flag
-#define STOP                             7
-
-#define SINGLE_FRAME_FWD         1
-#define NORMAL_FWD               2
-#define FAST_FWD                 3
-#define SINGLE_FRAME_REWIND      4
-#define NORMAL_REWIND                    5
-#define FAST_REWIND                      6
-#define PAUSE                            8
-#define SLOW_FWD                 9
-#define SLOW_REWIND              10
-#define REWIND                   11
-#define GOTO_END                 12
-#define CURRENT_FRAME             13
+#define STOP                 7
+
+#define SINGLE_FRAME_FWD     1
+#define NORMAL_FWD           2
+#define FAST_FWD             3
+#define SINGLE_FRAME_REWIND  4
+#define NORMAL_REWIND        5
+#define FAST_REWIND          6
+#define PAUSE                8
+#define SLOW_FWD             9
+#define SLOW_REWIND         10
+#define REWIND              11
+#define GOTO_END            12
+#define CURRENT_FRAME       13
 
 // Level of change.  Changes have to be inclusive of all the lesser changes.
 // Delete cache
index e4b6dd280cb6e07281800783acd06f05cffd9219..beada6050ff70d34815a5576f7475d96860097a0 100644 (file)
@@ -617,7 +617,7 @@ int VScalingItem::handle_event()
 
 
 VScalingEquation::VScalingEquation(int x, int y, int *output)
- : BC_PopupMenu(x, y, 175, interpolation_to_string(*output))
+ : BC_PopupMenu(x, y, 240, interpolation_to_string(*output))
 {
        this->output = output;
 }
diff --git a/cinelerra-5.1/plugins/shapes/burst.png b/cinelerra-5.1/plugins/shapes/burst.png
new file mode 100644 (file)
index 0000000..b605c6d
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/burst.png differ
diff --git a/cinelerra-5.1/plugins/shapes/specks.png b/cinelerra-5.1/plugins/shapes/specks.png
new file mode 100644 (file)
index 0000000..63a75b6
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/specks.png differ
index 9a8da9f85011613ca0cff31a7881a48efa2c6d6f..e2eaa8053e6d3eb1beb28ff4a9db94786a94efc1 100644 (file)
Binary files a/cinelerra-5.1/plugins/shapes/spiral.png and b/cinelerra-5.1/plugins/shapes/spiral.png differ