inigo usage message
[melted] / src / inigo / inigo.c
index 2dec87a..c8552c3 100644 (file)
@@ -50,43 +50,57 @@ static void transport_action( mlt_producer producer, char *value )
                        case '9':
                                mlt_producer_set_speed( producer, 10 );
                                break;
+                       case 'd':
+                               if ( multitrack != NULL )
+                               {
+                                       int i = 0;
+                                       mlt_position last = -1;
+                                       for ( i = 0; 1; i ++ )
+                                       {
+                                               mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_start, i );
+                                               if ( time == last )
+                                                       break;
+                                               last = time;
+                                               fprintf( stderr, "%d: %lld\n", i, time );
+                                       }
+                               }
+                               break;
+
                        case 'g':
                                if ( multitrack != NULL )
                                {
-                                       mlt_timecode time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 0 );
+                                       mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 0 );
                                        mlt_producer_seek( producer, time );
                                }
                                break;
                        case 'h':
                                if ( multitrack != NULL )
                                {
-                                       mlt_producer producer = mlt_multitrack_producer( multitrack );
-                                       int64_t position = mlt_producer_frame_position( producer, mlt_producer_position( producer ) );
+                                       mlt_position position = mlt_producer_position( producer );
                                        mlt_producer_set_speed( producer, 0 );
-                                       mlt_producer_seek_frame( producer, position - 1 >= 0 ? position - 1 : 0 );
+                                       mlt_producer_seek( producer, position - 1 >= 0 ? position - 1 : 0 );
                                }
                                break;
                        case 'j':
                                if ( multitrack != NULL )
                                {
-                                       mlt_timecode time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 1 );
+                                       mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, 1 );
                                        mlt_producer_seek( producer, time );
                                }
                                break;
                        case 'k':
                                if ( multitrack != NULL )
                                {
-                                       mlt_timecode time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, -1 );
+                                       mlt_position time = mlt_multitrack_clip( multitrack, mlt_whence_relative_current, -1 );
                                        mlt_producer_seek( producer, time );
                                }
                                break;
                        case 'l':
                                if ( multitrack != NULL )
                                {
-                                       mlt_producer producer = mlt_multitrack_producer( multitrack );
-                                       int64_t position = mlt_producer_frame_position( producer, mlt_producer_position( producer ) );
+                                       mlt_position position = mlt_producer_position( producer );
                                        mlt_producer_set_speed( producer, 0 );
-                                       mlt_producer_seek_frame( producer, position + 1 );
+                                       mlt_producer_seek( producer, position + 1 );
                                }
                                break;
                }
@@ -156,7 +170,7 @@ int main( int argc, char **argv )
        // Get inigo producer
        inigo = mlt_factory_producer( "inigo", &argv[ 1 ] );
 
-       if ( inigo != NULL && mlt_producer_get_length( inigo ) > 0 )
+       if ( argc > 1 && inigo != NULL && mlt_producer_get_length( inigo ) > 0 )
        {
                // Get inigo's properties
                mlt_properties inigo_props = mlt_producer_properties( inigo );
@@ -170,26 +184,30 @@ int main( int argc, char **argv )
                // Parse the arguments
                for ( i = 1; i < argc; i ++ )
                {
-                       if ( !strcmp( argv[ i ], "-serialise" ) )
-                       {
-                               i ++;
-                       }
-                       else if ( !strcmp( argv[ i ], "-consumer" ) )
+                       if ( !strcmp( argv[ i ], "-consumer" ) )
                        {
                                consumer = create_consumer( argv[ ++ i ], inigo );
                                while ( argv[ i + 1 ] != NULL && strstr( argv[ i + 1 ], "=" ) )
                                        mlt_properties_parse( group, argv[ ++ i ] );
                        }
+                       else if ( !strcmp( argv[ i ], "-serialise" ) )
+                       {
+                               i ++;
+                       }
                        else
                        {
                                if ( store != NULL )
                                        fprintf( store, "%s\n", argv[ i ] );
+
+                               i ++;
+
                                while ( argv[ i ] != NULL && argv[ i ][ 0 ] != '-' )
                                {
-                                       i ++;
-                                       if ( store != NULL && argv[ i ] != NULL && argv[ i ][ 0 ] != '-' )
+                                       if ( store != NULL )
                                                fprintf( store, "%s\n", argv[ i ] );
+                                       i += 1;
                                }
+
                                i --;
                        }
                }
@@ -209,7 +227,6 @@ int main( int argc, char **argv )
 
                        // Transport functionality
                        transport( inigo );
-                       
                }
                else if ( store != NULL )
                {
@@ -225,6 +242,7 @@ int main( int argc, char **argv )
                                         "             [ -filter id[:arg] [ name=value ] * ]\n"
                                         "             [ -transition id[:arg] [ name=value ] * ]\n"
                                                 "             [ -blank time ]\n"
+                                                "             [ -track ]\n"
                                         "             [ producer [ name=value ] * ]+\n" );
        }