[CinCV TNG] [PATCH] playback speeds

Einar R√ľnkaru einarrunkaru at gmail.com
Sat May 2 18:35:49 CEST 2015


Hi.

Some remarks below.


      1	From 350e341b8336b95cfb0675bf3f51f6eaecced274 Mon Sep 17 
00:00:00 2001
      2	From: Johannes Mueller <github at johannes-mueller.org>
      3	Date: Wed, 22 Apr 2015 18:05:25 +0200
      4	Subject: [PATCH] Added some more playback speeds
      5	
      6	They can be accessed by using the Alt key in addition to the 
usual key
      7	to start the playback. They are useful if you use a jog shuttle 
like the
      8	ShuttlePro.
      9	---
     10	 cinelerra/playtransport.C   | 78 
++++++++++++++++++++++++++++++---------------
     11	 cinelerra/transportque.C    | 36 +++++++++++++++++++++
     12	 cinelerra/transportque.inc  |  9 ++++++
     13	 cinelerra/virtualaconsole.C |  6 ++--
     14	 4 files changed, 102 insertions(+), 27 deletions(-)
     15	
     16	diff --git a/cinelerra/playtransport.C b/cinelerra/playtransport.C
     17	index f32eb40..8ecaf01 100644
     18	--- a/cinelerra/playtransport.C
     19	+++ b/cinelerra/playtransport.C
     20	@@ -213,32 +213,52 @@ int PlayTransport::keypress_event()
     21	 	}
     22	 	subwindow->unlock_window();

     62	+			case ' ':           handle_transport(NORMAL_FWD, 0, 
use_inout);                  result = 1; break;
     63	+			case 'k':           handle_transport(STOP, 0, 
use_inout);   			 result = 1; break;

When you change indentation remove all tabs after the first non-tab

     75	+			case KP1:           handle_transport(SINGLE_FRAME_FWD, 0, 
use_inout);   	result = 1; break;
     76	+			case KP2:           handle_transport(SLOW_FWD, 0, 
use_inout);           	result = 1; break;
     77	+			case KP3:           handle_transport(NORMAL_FWD, 0, 
use_inout);         	result = 1; break;
     78	+			case KPENTER:       handle_transport(FAST_FWD, 0, 
use_inout);           	result = 1; break;
     79	+			case KPINS:         handle_transport(STOP, 0, use_inout); 
                     result = 1; break;
     80	+			case ' ':           handle_transport(NORMAL_FWD, 0, 
use_inout);                 result = 1; break;
     81	+			case 'k':           handle_transport(STOP, 0, 
use_inout);   			result = 1; break;

When you change indentation remove all tabs after the first non-tab

    139	@@ -147,6 +155,26 @@ float TransportCommand::get_speed()
    140	 		case FAST_REWIND:
    141	 			return 2;
    142	 			break;
    143	+		

Tabs at the end of line

    144	+		case SHIFTED_SINGLE_FRAME_FWD:
    145	+		case SHIFTED_SINGLE_FRAME_REWIND:
    146	+			return 4;
    147	+			break;
    148	+	

Tabs at the end of line

    149	+		case SHIFTED_SLOW_FWD:
    150	+		case SHIFTED_SLOW_REWIND:
    151	+			return 8;
    152	+			break;
    153	+		

Tabs at the end of line

    154	+		case SHIFTED_NORMAL_FWD:
    155	+		case SHIFTED_NORMAL_REWIND:
    156	+			return 16;
    157	+			break;
    158	+		

Tabs at the end of line

    188	diff --git a/cinelerra/transportque.inc b/cinelerra/transportque.inc
    189	index b83437a..026af50 100644
    190	--- a/cinelerra/transportque.inc
    191	+++ b/cinelerra/transportque.inc
    192	@@ -44,6 +44,15 @@
    193	 #define REWIND               	  11
    194	 #define GOTO_END             	  12
    195	 #define CURRENT_FRAME             13
    196	+#define SHIFTED_SINGLE_FRAME_FWD     	  14
    197	+#define SHIFTED_NORMAL_FWD           	  15
    198	+#define SHIFTED_FAST_FWD             	  16
    199	+#define SHIFTED_SINGLE_FRAME_REWIND  	  17
    200	+#define SHIFTED_NORMAL_REWIND     	  18
    201	+#define SHIFTED_FAST_REWIND       	  19
    202	+#define SHIFTED_PAUSE             	  20
    203	+#define SHIFTED_SLOW_FWD             	  21
    204	+#define SHIFTED_SLOW_REWIND          	  22

The SHIFTED_ prefix is bad. You must give reasonable name to the new 
functions.
No tabs in the middle of the line
      1	From 350e341b8336b95cfb0675bf3f51f6eaecced274 Mon Sep 17 
00:00:00 2001
      2	From: Johannes Mueller <github at johannes-mueller.org>
      3	Date: Wed, 22 Apr 2015 18:05:25 +0200
      4	Subject: [PATCH] Added some more playback speeds
      5	
      6	They can be accessed by using the Alt key in addition to the 
usual key
      7	to start the playback. They are useful if you use a jog shuttle 
like the
      8	ShuttlePro.
      9	---
     10	 cinelerra/playtransport.C   | 78 
++++++++++++++++++++++++++++++---------------
     11	 cinelerra/transportque.C    | 36 +++++++++++++++++++++
     12	 cinelerra/transportque.inc  |  9 ++++++
     13	 cinelerra/virtualaconsole.C |  6 ++--
     14	 4 files changed, 102 insertions(+), 27 deletions(-)
     15	
     16	diff --git a/cinelerra/playtransport.C b/cinelerra/playtransport.C
     17	index f32eb40..8ecaf01 100644
     18	--- a/cinelerra/playtransport.C
     19	+++ b/cinelerra/playtransport.C
     20	@@ -213,32 +213,52 @@ int PlayTransport::keypress_event()
     21	 	}
     22	 	subwindow->unlock_window();

     62	+			case ' ':           handle_transport(NORMAL_FWD, 0, 
use_inout);                  result = 1; break;
     63	+			case 'k':           handle_transport(STOP, 0, 
use_inout);   			 result = 1; break;

When you change indentation remove all tabs after the first non-tab

     75	+			case KP1:           handle_transport(SINGLE_FRAME_FWD, 0, 
use_inout);   	result = 1; break;
     76	+			case KP2:           handle_transport(SLOW_FWD, 0, 
use_inout);           	result = 1; break;
     77	+			case KP3:           handle_transport(NORMAL_FWD, 0, 
use_inout);         	result = 1; break;
     78	+			case KPENTER:       handle_transport(FAST_FWD, 0, 
use_inout);           	result = 1; break;
     79	+			case KPINS:         handle_transport(STOP, 0, use_inout); 
                     result = 1; break;
     80	+			case ' ':           handle_transport(NORMAL_FWD, 0, 
use_inout);                 result = 1; break;
     81	+			case 'k':           handle_transport(STOP, 0, 
use_inout);   			result = 1; break;

When you change indentation remove all tabs after the first non-tab

    139	@@ -147,6 +155,26 @@ float TransportCommand::get_speed()
    140	 		case FAST_REWIND:
    141	 			return 2;
    142	 			break;
    143	+		

Tabs at the end of line

    144	+		case SHIFTED_SINGLE_FRAME_FWD:
    145	+		case SHIFTED_SINGLE_FRAME_REWIND:
    146	+			return 4;
    147	+			break;
    148	+	

Tabs at the end of line

    149	+		case SHIFTED_SLOW_FWD:
    150	+		case SHIFTED_SLOW_REWIND:
    151	+			return 8;
    152	+			break;
    153	+		

Tabs at the end of line

    154	+		case SHIFTED_NORMAL_FWD:
    155	+		case SHIFTED_NORMAL_REWIND:
    156	+			return 16;
    157	+			break;
    158	+		

Tabs at the end of line

    188	diff --git a/cinelerra/transportque.inc b/cinelerra/transportque.inc
    189	index b83437a..026af50 100644
    190	--- a/cinelerra/transportque.inc
    191	+++ b/cinelerra/transportque.inc
    192	@@ -44,6 +44,15 @@
    193	 #define REWIND               	  11
    194	 #define GOTO_END             	  12
    195	 #define CURRENT_FRAME             13
    196	+#define SHIFTED_SINGLE_FRAME_FWD     	  14
    197	+#define SHIFTED_NORMAL_FWD           	  15
    198	+#define SHIFTED_FAST_FWD             	  16
    199	+#define SHIFTED_SINGLE_FRAME_REWIND  	  17
    200	+#define SHIFTED_NORMAL_REWIND     	  18
    201	+#define SHIFTED_FAST_REWIND       	  19
    202	+#define SHIFTED_PAUSE             	  20
    203	+#define SHIFTED_SLOW_FWD             	  21
    204	+#define SHIFTED_SLOW_REWIND          	  22

The SHIFTED_ prefix is bad. You must give reasonable name to the new 
functions.
No tabs in the middle of the line

    205	
    206	 // Level of change.  Changes have to be inclusive of all the 
lesser changes.
    207	 // Delete cache
    208	diff --git a/cinelerra/virtualaconsole.C 
b/cinelerra/virtualaconsole.C
    209	index 4551d1f..08933d7 100644
    210	--- a/cinelerra/virtualaconsole.C
    211	+++ b/cinelerra/virtualaconsole.C
    212	@@ -264,8 +264,10 @@ int VirtualAConsole::process_buffer(int64_t 
len,
    213	 		}
    214	 		if(!renderengine->audio->get_interrupted())
    215	 		{
    216	-			renderengine->audio->write_buffer(audio_out_packed,
    217	-				real_output_len);
    218	+                        if (renderengine->command->get_speed() 
<= 2)
    219	+                        {
    220	+        			renderengine->audio->write_buffer(audio_out_packed, 
real_output_len);
    221	+                        }

Indent with tabs, not spaces.
You must skip audio before the resampling at the begining of process_buffer.


    205	
    206	 // Level of change.  Changes have to be inclusive of all the 
lesser changes.
    207	 // Delete cache
    208	diff --git a/cinelerra/virtualaconsole.C 
b/cinelerra/virtualaconsole.C
    209	index 4551d1f..08933d7 100644
    210	--- a/cinelerra/virtualaconsole.C
    211	+++ b/cinelerra/virtualaconsole.C
    212	@@ -264,8 +264,10 @@ int VirtualAConsole::process_buffer(int64_t 
len,
    213	 		}
    214	 		if(!renderengine->audio->get_interrupted())
    215	 		{
    216	-			renderengine->audio->write_buffer(audio_out_packed,
    217	-				real_output_len);
    218	+                        if (renderengine->command->get_speed() 
<= 2)
    219	+                        {
    220	+        			renderengine->audio->write_buffer(audio_out_packed, 
real_output_len);
    221	+                        }

Indent with tabs, not spaces.
You must skip audio before the resampling at the begining of process_buffer.

Thanks,
Einar




More information about the Cinelerra mailing list