#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
/** Virtual playlist entry.
*/
// Refresh all properties
mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", fps );
- mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps );
+ mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps == 0 ? 25 : fps );
mlt_properties_set_timecode( mlt_playlist_properties( this ), "length", playtime );
mlt_properties_set_timecode( mlt_playlist_properties( this ), "out", playtime );
/** Append to the virtual playlist.
*/
-static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer, mlt_timecode in, mlt_timecode out )
+static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer, mlt_timecode in, mlt_timecode playtime )
{
// Check that we have room
if ( this->count >= this->size )
this->list[ this->count ] = calloc( sizeof( playlist_entry ), 1 );
this->list[ this->count ]->producer = producer;
this->list[ this->count ]->in = in;
- this->list[ this->count ]->playtime = out - in;
+ this->list[ this->count ]->playtime = playtime;
this->count ++;
{
mlt_producer producer = this->list[ index ]->producer;
mlt_properties properties = mlt_producer_properties( producer );
+ info->producer = producer;
+ info->start = mlt_playlist_clip( this, mlt_whence_relative_start, index );
info->resource = mlt_properties_get( properties, "resource" );
info->in = this->list[ index ]->in;
info->out = this->list[ index ]->in + this->list[ index ]->playtime;
return 0;
}
+int mlt_playlist_resize_clip( mlt_playlist this, int clip, mlt_timecode in, mlt_timecode out )
+{
+ int error = clip < 0 || clip >= this->count;
+ if ( error == 0 )
+ {
+ playlist_entry *entry = this->list[ clip ];
+ mlt_producer producer = entry->producer;
+
+ if ( in <= -1 )
+ in = 0;
+ if ( out <= -1 || out >= mlt_producer_get_out( producer ) )
+ out = mlt_producer_get_out( producer );
+
+ if ( out < in )
+ {
+ mlt_timecode t = in;
+ in = out;
+ out = t;
+ }
+
+ entry->in = in;
+ entry->playtime = out - in;
+ mlt_playlist_virtual_refresh( this );
+ }
+ return error;
+}
+
/** Get the current frame.
*/
#include "mlt_producer.h"
-/** Structur for returning clip information.
+/** Structure for returning clip information.
*/
typedef struct
{
+ mlt_producer producer;
+ mlt_timecode start;
char *resource;
- double in;
- double out;
- double playtime;
- double length;
+ mlt_timecode in;
+ mlt_timecode out;
+ mlt_timecode playtime;
+ mlt_timecode length;
float fps;
}
mlt_playlist_clip_info;
extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out );
extern int mlt_playlist_remove( mlt_playlist this, int where );
extern int mlt_playlist_move( mlt_playlist this, int from, int to );
+extern int mlt_playlist_resize_clip( mlt_playlist this, int clip, mlt_timecode in, mlt_timecode out );
extern void mlt_playlist_close( mlt_playlist this );
#endif
return mlt_service_properties( &this->parent );
}
+/** Convert frame position to timecode.
+*/
+
+mlt_timecode mlt_producer_time( mlt_producer this, int64_t frame )
+{
+ if ( frame < 0 )
+ return -1;
+ else
+ return ( mlt_timecode )frame / mlt_producer_get_fps( this );
+}
+
+/** Convert timecode to frame position.
+*/
+
+int64_t mlt_producer_frame_position( mlt_producer this, mlt_timecode position )
+{
+ if ( position < 0 )
+ return -1;
+ else
+ return ( int64_t )( floor( position * mlt_producer_get_fps( this ) + 0.5 ) );
+}
+
/** Seek to a specified time code.
*/
extern int mlt_producer_init( mlt_producer this, void *child );
extern mlt_service mlt_producer_service( mlt_producer this );
extern mlt_properties mlt_producer_properties( mlt_producer this );
+extern mlt_timecode mlt_producer_time( mlt_producer this, int64_t frame );
+extern int64_t mlt_producer_frame_position( mlt_producer this, mlt_timecode position );
extern int mlt_producer_seek( mlt_producer this, mlt_timecode timecode );
extern int mlt_producer_seek_frame( mlt_producer this, uint64_t frame );
extern mlt_timecode mlt_producer_position( mlt_producer this );
return this->prop_string != NULL;
}
+/** Set an int64 on this property.
+*/
+
+int mlt_property_set_int64( mlt_property this, int64_t value )
+{
+ mlt_property_clear( this );
+ this->types = mlt_prop_int64;
+ this->prop_int64 = value;
+ return 0;
+}
+
/** Set a data on this property.
*/
return ( int )this->prop_double;
else if ( this->types & mlt_prop_timecode )
return ( int )this->prop_timecode;
+ else if ( this->types & mlt_prop_int64 )
+ return ( int )this->prop_int64;
else if ( this->types & mlt_prop_string )
return atoi( this->prop_string );
return 0;
return ( double )this->prop_int;
else if ( this->types & mlt_prop_timecode )
return ( double )this->prop_timecode;
+ else if ( this->types & mlt_prop_int64 )
+ return ( double )this->prop_int64;
else if ( this->types & mlt_prop_string )
return atof( this->prop_string );
return 0;
return ( mlt_timecode )this->prop_int;
else if ( this->types & mlt_prop_double )
return ( mlt_timecode )this->prop_double;
+ else if ( this->types & mlt_prop_int64 )
+ return ( mlt_timecode )this->prop_int64;
else if ( this->types & mlt_prop_string )
return ( mlt_timecode )atof( this->prop_string );
return 0;
}
+/** Get an int64 from this property.
+*/
+
+int64_t mlt_property_get_int64( mlt_property this )
+{
+ if ( this->types & mlt_prop_int64 )
+ return this->prop_int64;
+ else if ( this->types & mlt_prop_int )
+ return ( int64_t )this->prop_int;
+ else if ( this->types & mlt_prop_double )
+ return ( int64_t )this->prop_double;
+ else if ( this->types & mlt_prop_timecode )
+ return ( int64_t )this->prop_timecode;
+ else if ( this->types & mlt_prop_string )
+ return ( int64_t )atof( this->prop_string );
+ return 0;
+}
+
/** Get a string from this property.
*/
this->prop_string = malloc( 32 );
sprintf( this->prop_string, "%e", this->prop_timecode );
}
+ else if ( this->types & mlt_prop_int64 )
+ {
+ this->types |= mlt_prop_string;
+ this->prop_string = malloc( 32 );
+ sprintf( this->prop_string, "%lld", this->prop_int64 );
+ }
else if ( this->types & mlt_prop_data && this->serialiser != NULL )
{
this->types |= mlt_prop_string;
mlt_prop_string = 2,
mlt_prop_timecode = 4,
mlt_prop_double = 8,
- mlt_prop_data = 16
+ mlt_prop_data = 16,
+ mlt_prop_int64 = 32
}
mlt_property_type;
int prop_int;
mlt_timecode prop_timecode;
double prop_double;
+ int64_t prop_int64;
// String handling
char *prop_string;
extern int mlt_property_set_int( mlt_property this, int value );
extern int mlt_property_set_double( mlt_property this, double value );
extern int mlt_property_set_timecode( mlt_property this, mlt_timecode value );
+extern int mlt_property_set_uint64( mlt_property this, uint64_t value );
extern int mlt_property_set_string( mlt_property this, char *value );
extern int mlt_property_set_data( mlt_property this, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser );
extern int mlt_property_get_int( mlt_property this );
extern double mlt_property_get_double( mlt_property this );
extern mlt_timecode mlt_property_get_timecode( mlt_property this );
+extern int64_t mlt_property_get_int64( mlt_property this );
extern char *mlt_property_get_string( mlt_property this );
extern void *mlt_property_get_data( mlt_property this, int *length );
extern void mlt_property_close( mlt_property this );
break;
}
- sprintf( temp + strlen( temp ), " %9.2f %9.2f %9.2f ", status->in, status->position, status->out );
+ sprintf( temp + strlen( temp ), " %9lld %9lld %9lld ", status->in, status->position, status->out );
strcat( temp, status->clip );
printf( "%-80.80s\r", temp );
/* System header files */
#include <stdio.h>
+#include <stdint.h>
/* dv1394d header files */
#include <valerie/valerie_remote.h>
pthread_kill_other_threads_np();
miracle_log( LOG_DEBUG, "Clean shutdown." );
free( local );
- mlt_factory_close( );
+ //mlt_factory_close( );
}
mlt_properties_set_int( properties, "generation", ++ generation );
}
+/** Wipe all clips on the playlist for this unit.
+*/
+
static void clear_unit( miracle_unit unit )
{
mlt_properties properties = unit->properties;
mlt_properties properties = unit->properties;
int generation = mlt_properties_get_int( properties, "generation" );
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_producer producer = mlt_playlist_producer( playlist );
valerie_response_printf( response, 1024, "%d\n", generation );
{
mlt_playlist_clip_info info;
mlt_playlist_get_clip_info( playlist , &info, i );
- valerie_response_printf( response, 10240, "%d \"%s\" %e %e %e %e %.2f\n",
- i, info.resource, info.in, info.out, info.playtime, info.length, info.fps );
+ valerie_response_printf( response, 10240, "%d \"%s\" %lld %lld %lld %lld %.2f\n",
+ i, info.resource,
+ mlt_producer_frame_position( producer, info.in ),
+ mlt_producer_frame_position( producer, info.out ),
+ mlt_producer_frame_position( producer, info.playtime ),
+ mlt_producer_frame_position( producer, info.length ),
+ info.fps );
}
}
\param out The ending frame (-1 for maximum)
*/
-valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush )
+valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush )
{
// Have to clear the unit first
clear_unit( unit );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_playlist_append_io( playlist, instance, in, out );
+ mlt_playlist_append_io( playlist, instance, mlt_producer_time( instance, in ), mlt_producer_time( instance, out ) );
miracle_log( LOG_DEBUG, "loaded clip %s", clip );
miracle_unit_status_communicate( unit );
return valerie_ok;
return valerie_invalid_file;
}
-valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out )
+valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out )
{
mlt_producer instance = create_producer( unit, clip );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_playlist_insert( playlist, instance, index, in, out );
+ mlt_playlist_insert( playlist, instance, index, mlt_producer_time( instance, in ), mlt_producer_time( instance, out ) );
miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
mlt_playlist_remove( playlist, index );
miracle_log( LOG_DEBUG, "removed clip at %d", index );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
mlt_playlist_move( playlist, src, dest );
miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
\param out The ending frame (-1 for maximum)
*/
-valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, double in, double out )
+valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out )
{
mlt_producer instance = create_producer( unit, clip );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_playlist_append_io( playlist, instance, in, out );
+ mlt_playlist_append_io( playlist, instance, mlt_producer_time( instance, in ), mlt_producer_time( instance, out ) );
miracle_log( LOG_DEBUG, "appended clip %s", clip );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
strncpy( status->clip, info.resource, sizeof( status->clip ) );
status->speed = (int)( mlt_producer_get_speed( producer ) * 1000.0 );
status->fps = mlt_producer_get_fps( producer );
- status->in = info.in;
- status->out = info.in + info.playtime;
- status->position = mlt_producer_position( clip );
- status->length = mlt_producer_get_length( clip );
+ status->in = mlt_producer_frame_position( producer, info.in );
+ status->out = mlt_producer_frame_position( producer, info.out );
+ status->position = mlt_producer_frame_position( producer, mlt_producer_position( clip ) );
+ status->length = mlt_producer_frame_position( producer, mlt_producer_get_length( clip ) );
+ strncpy( status->tail_clip, info.resource, sizeof( status->tail_clip ) );
+ status->tail_in = mlt_producer_frame_position( producer, info.in );
+ status->tail_out = mlt_producer_frame_position( producer, info.out );
+ status->tail_position = mlt_producer_frame_position( producer, mlt_producer_position( clip ) );
+ status->tail_length = mlt_producer_frame_position( producer, mlt_producer_get_length( clip ) );
+ status->clip_index = mlt_playlist_current_clip( playlist );
status->seek_flag = 1;
}
+ status->generation = mlt_properties_get_int( properties, "generation" );
+
if ( !strcmp( status->clip, "" ) )
status->status = unit_not_loaded;
else if ( status->speed == 0 )
/** Change position in the playlist.
*/
-void miracle_unit_change_position( miracle_unit unit, int clip, double position )
+void miracle_unit_change_position( miracle_unit unit, int clip, int64_t position )
{
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_playlist_clip_info info;
+
+ if ( clip < 0 )
+ clip = 0;
+ else if ( clip >= mlt_playlist_count( playlist ) )
+ clip = mlt_playlist_count( playlist );
+
+ if ( mlt_playlist_get_clip_info( playlist, &info, clip ) == 0 )
+ {
+ mlt_timecode relative = mlt_producer_time( info.producer, position );
+ mlt_timecode absolute = relative - info.in;
+ int64_t frame_start = mlt_producer_frame_position( info.producer, info.start );
+ int64_t frame_offset = 0;
+
+ if ( absolute < 0 )
+ frame_offset = 0;
+ else if ( absolute >= info.out )
+ frame_offset = mlt_producer_frame_position( info.producer, info.out ) - 1;
+ else
+ frame_offset = mlt_producer_frame_position( info.producer, absolute );
+
+ mlt_producer_seek_frame( producer, frame_start + frame_offset );
+ }
+ else
+ {
+ mlt_timecode out = mlt_producer_get_out( producer );
+ mlt_producer_seek( producer, mlt_producer_frame_position( producer, out ) - 1 );
+ }
+
miracle_unit_status_communicate( unit );
}
/** Set a clip's in point
*/
-int miracle_unit_set_clip_in( miracle_unit unit, int index, double position )
+int miracle_unit_set_clip_in( miracle_unit unit, int index, int64_t position )
{
- int error = 0;
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_clip_info info;
+ int error = mlt_playlist_get_clip_info( playlist, &info, index );
+
+ if ( error == 0 )
+ {
+ mlt_timecode in = mlt_producer_time( info.producer, position );
+ error = mlt_playlist_resize_clip( playlist, index, in, info.out );
+ update_generation( unit );
+ miracle_unit_change_position( unit, index, 0 );
+ }
+
return error;
}
/** Set a clip's out point.
*/
-int miracle_unit_set_clip_out( miracle_unit unit, int index, double position )
+int miracle_unit_set_clip_out( miracle_unit unit, int index, int64_t position )
{
- int error = 0;
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_clip_info info;
+ int error = mlt_playlist_get_clip_info( playlist, &info, index );
+
+ if ( error == 0 )
+ {
+ mlt_timecode out = mlt_producer_time( info.producer, position );
+ error = mlt_playlist_resize_clip( playlist, index, info.in, out );
+ update_generation( unit );
+ miracle_unit_status_communicate( unit );
+ miracle_unit_change_position( unit, index, 0 );
+ }
+
return error;
}
/** Step by specified position.
*/
-void miracle_unit_step( miracle_unit unit, double offset )
+void miracle_unit_step( miracle_unit unit, int64_t offset )
{
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_timecode position = mlt_producer_position( producer );
+ mlt_producer_seek( producer, position + mlt_producer_time( producer, offset ) );
}
/** Set the unit's clip mode regarding in and out points.
extern miracle_unit miracle_unit_init( int index, char *arg );
extern void miracle_unit_report_list( miracle_unit unit, valerie_response response );
extern void miracle_unit_allow_stdin( miracle_unit unit, int flag );
-extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush );
-extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out );
-extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, double in, double out );
+extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush );
+extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out );
+extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out );
extern valerie_error_code miracle_unit_remove( miracle_unit unit, int index );
extern valerie_error_code miracle_unit_clean( miracle_unit unit );
extern valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest );
extern int miracle_unit_is_offline( miracle_unit unit );
extern void miracle_unit_set_notifier( miracle_unit, valerie_notifier, char * );
extern int miracle_unit_get_status( miracle_unit, valerie_status );
-extern void miracle_unit_change_position( miracle_unit, int, double position );
+extern void miracle_unit_change_position( miracle_unit, int, int64_t position );
extern void miracle_unit_change_speed( miracle_unit unit, int speed );
-extern int miracle_unit_set_clip_in( miracle_unit unit, int index, double position );
-extern int miracle_unit_set_clip_out( miracle_unit unit, int index, double position );
+extern int miracle_unit_set_clip_in( miracle_unit unit, int index, int64_t position );
+extern int miracle_unit_set_clip_out( miracle_unit unit, int index, int64_t position );
//extern void miracle_unit_set_mode( miracle_unit unit, dv_player_clip_mode mode );
//extern dv_player_clip_mode miracle_unit_get_mode( miracle_unit unit );
//extern void miracle_unit_set_eof_action( miracle_unit unit, dv_player_eof_action mode );
//extern dv_player_eof_action miracle_unit_get_eof_action( miracle_unit unit );
-extern void miracle_unit_step( miracle_unit unit, double offset );
+extern void miracle_unit_step( miracle_unit unit, int64_t offset );
extern void miracle_unit_close( miracle_unit unit );
extern void miracle_unit_suspend( miracle_unit );
extern void miracle_unit_restore( miracle_unit );
return RESPONSE_INVALID_UNIT;
else
{
- double in = -1, out = -1;
+ int64_t in = -1, out = -1;
if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 5 )
{
- in = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
- out = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+ in = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
+ out = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
}
if ( miracle_unit_load( unit, fullname, in, out, flush ) != valerie_ok )
return RESPONSE_BAD_FILE;
return RESPONSE_INVALID_UNIT;
else
{
- double in = -1, out = -1;
+ int64_t in = -1, out = -1;
if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 5 )
{
- in = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
- out = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+ in = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
+ out = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
}
switch ( miracle_unit_append( unit, fullname, in, out ) )
{
int miracle_set_in_point( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
int clip = parse_clip( cmd_arg, 3 );
-
- if (unit == NULL || dv_unit_is_offline(unit))
+
+ if ( unit == NULL )
return RESPONSE_INVALID_UNIT;
else
{
int position = *(int *) cmd_arg->argument;
- switch( dv_unit_set_clip_in( unit, clip, position ) )
+ switch( miracle_unit_set_clip_in( unit, clip, position ) )
{
case -1:
return RESPONSE_BAD_FILE;
return RESPONSE_OUT_OF_RANGE;
}
}
- */
return RESPONSE_SUCCESS;
}
int miracle_set_out_point( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
int clip = parse_clip( cmd_arg, 3 );
- if (unit == NULL || dv_unit_is_offline(unit))
+ if ( unit == NULL )
return RESPONSE_INVALID_UNIT;
else
{
int position = *(int *) cmd_arg->argument;
- switch( dv_unit_set_clip_out( unit, clip, position ) )
+ switch( miracle_unit_set_clip_out( unit, clip, position ) )
{
case -1:
return RESPONSE_BAD_FILE;
return RESPONSE_OUT_OF_RANGE;
}
}
- */
+
return RESPONSE_SUCCESS;
}
mlt_properties_set_double( properties, "fps", fps );
mlt_properties_set_timecode( properties, "length", length );
mlt_properties_set_timecode( properties, "in", 0.0 );
- mlt_properties_set_timecode( properties, "out", length );
+ mlt_properties_set_timecode( properties, "out", ( mlt_timecode )( this->frames_in_file - 1 ) / fps );
// Parse the header for meta info
dv_parse_header( this->dv_decoder, dv_data );
/** Load a file on the specified unit with the specified in/out points.
*/
-valerie_error_code valerie_unit_load_clipped( valerie this, int unit, char *file, double in, double out )
+valerie_error_code valerie_unit_load_clipped( valerie this, int unit, char *file, int64_t in, int64_t out )
{
- return valerie_execute( this, 10240, "LOAD U%d \"%s\" %e %e", unit, file, in, out );
+ return valerie_execute( this, 10240, "LOAD U%d \"%s\" %lld %lld", unit, file, in, out );
}
/** Load a file on the specified unit at the end of the current pump.
/** Load a file on the specified unit at the end of the pump with the specified in/out points.
*/
-valerie_error_code valerie_unit_load_back_clipped( valerie this, int unit, char *file, double in, double out )
+valerie_error_code valerie_unit_load_back_clipped( valerie this, int unit, char *file, int64_t in, int64_t out )
{
- return valerie_execute( this, 10240, "LOAD U%d \"!%s\" %e %e", unit, file, in, out );
+ return valerie_execute( this, 10240, "LOAD U%d \"!%s\" %lld %lld", unit, file, in, out );
}
/** Append a file on the specified unit.
*/
-valerie_error_code valerie_unit_append( valerie this, int unit, char *file, double in, double out )
+valerie_error_code valerie_unit_append( valerie this, int unit, char *file, int64_t in, int64_t out )
{
- return valerie_execute( this, 10240, "APND U%d \"%s\" %e %e", unit, file, in, out );
+ return valerie_execute( this, 10240, "APND U%d \"%s\" %lld %lld", unit, file, in, out );
}
/** Clean the unit - this function removes all but the currently playing clip.
/** Insert clip at the specified position.
*/
-valerie_error_code valerie_unit_clip_insert( valerie this, int unit, valerie_clip_offset offset, int clip, char *file, double in, double out )
+valerie_error_code valerie_unit_clip_insert( valerie this, int unit, valerie_clip_offset offset, int clip, char *file, int64_t in, int64_t out )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "INSERT U%d %s %s %e %e", unit, file, temp, in, out );
+ return valerie_execute( this, 1024, "INSERT U%d %s %s %lld %lld", unit, file, temp, in, out );
}
/** Play the unit at normal speed.
/** Step by the number of frames on the specified unit.
*/
-valerie_error_code valerie_unit_step( valerie this, int unit, double step )
+valerie_error_code valerie_unit_step( valerie this, int unit, int64_t step )
{
- return valerie_execute( this, 1024, "STEP U%d %e", unit, step );
+ return valerie_execute( this, 1024, "STEP U%d %lld", unit, step );
}
/** Goto the specified frame on the specified unit.
*/
-valerie_error_code valerie_unit_goto( valerie this, int unit, double position )
+valerie_error_code valerie_unit_goto( valerie this, int unit, int64_t position )
{
- return valerie_execute( this, 1024, "GOTO U%d %e", unit, position );
+ return valerie_execute( this, 1024, "GOTO U%d %lld", unit, position );
}
/** Goto the specified frame in the clip on the specified unit.
*/
-valerie_error_code valerie_unit_clip_goto( valerie this, int unit, valerie_clip_offset offset, int clip, double position )
+valerie_error_code valerie_unit_clip_goto( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t position )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "GOTO U%d %e %s", unit, position, temp );
+ return valerie_execute( this, 1024, "GOTO U%d %lld %s", unit, position, temp );
}
/** Set the in point of the loaded file on the specified unit.
*/
-valerie_error_code valerie_unit_set_in( valerie this, int unit, double in )
+valerie_error_code valerie_unit_set_in( valerie this, int unit, int64_t in )
{
- return valerie_execute( this, 1024, "SIN U%d %e", unit, in );
+ return valerie_execute( this, 1024, "SIN U%d %lld", unit, in );
}
/** Set the in point of the clip on the specified unit.
*/
-valerie_error_code valerie_unit_clip_set_in( valerie this, int unit, valerie_clip_offset offset, int clip, double in )
+valerie_error_code valerie_unit_clip_set_in( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t in )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "SIN U%d %e %s", unit, in, temp );
+ return valerie_execute( this, 1024, "SIN U%d %lld %s", unit, in, temp );
}
/** Set the out point of the loaded file on the specified unit.
*/
-valerie_error_code valerie_unit_set_out( valerie this, int unit, double out )
+valerie_error_code valerie_unit_set_out( valerie this, int unit, int64_t out )
{
- return valerie_execute( this, 1024, "SOUT U%d %e", unit, out );
+ return valerie_execute( this, 1024, "SOUT U%d %lld", unit, out );
}
/** Set the out point of the clip on the specified unit.
*/
-valerie_error_code valerie_unit_clip_set_out( valerie this, int unit, valerie_clip_offset offset, int clip, double in )
+valerie_error_code valerie_unit_clip_set_out( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t in )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "SOUT U%d %e %s", unit, in, temp );
+ return valerie_execute( this, 1024, "SOUT U%d %lld %s", unit, in, temp );
}
/** Clear the in point of the loaded file on the specified unit.
entry->clip = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) );
valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 1 ), '\"' );
strcpy( entry->full, valerie_tokeniser_get_string( tokeniser, 1 ) );
- entry->in = atof( valerie_tokeniser_get_string( tokeniser, 2 ) );
- entry->out = atof( valerie_tokeniser_get_string( tokeniser, 3 ) );
- entry->max = atof( valerie_tokeniser_get_string( tokeniser, 4 ) );
- entry->size = atof( valerie_tokeniser_get_string( tokeniser, 5 ) );
+ entry->in = atol( valerie_tokeniser_get_string( tokeniser, 2 ) );
+ entry->out = atol( valerie_tokeniser_get_string( tokeniser, 3 ) );
+ entry->max = atol( valerie_tokeniser_get_string( tokeniser, 4 ) );
+ entry->size = atol( valerie_tokeniser_get_string( tokeniser, 5 ) );
entry->fps = atof( valerie_tokeniser_get_string( tokeniser, 6 ) );
}
valerie_tokeniser_close( tokeniser );
/* Unit functions */
extern valerie_error_code valerie_unit_add( valerie, char *, int * );
extern valerie_error_code valerie_unit_load( valerie, int, char * );
-extern valerie_error_code valerie_unit_load_clipped( valerie, int, char *, double, double );
+extern valerie_error_code valerie_unit_load_clipped( valerie, int, char *, int64_t, int64_t );
extern valerie_error_code valerie_unit_load_back( valerie, int, char * );
-extern valerie_error_code valerie_unit_load_back_clipped( valerie, int, char *, double, double );
-extern valerie_error_code valerie_unit_append( valerie, int, char *, double, double );
+extern valerie_error_code valerie_unit_load_back_clipped( valerie, int, char *, int64_t, int64_t );
+extern valerie_error_code valerie_unit_append( valerie, int, char *, int64_t, int64_t );
extern valerie_error_code valerie_unit_clean( valerie, int );
extern valerie_error_code valerie_unit_clip_move( valerie, int, valerie_clip_offset, int, valerie_clip_offset, int );
extern valerie_error_code valerie_unit_clip_remove( valerie, int, valerie_clip_offset, int );
extern valerie_error_code valerie_unit_remove_current_clip( valerie, int );
-extern valerie_error_code valerie_unit_clip_insert( valerie, int, valerie_clip_offset, int, char *, double, double );
+extern valerie_error_code valerie_unit_clip_insert( valerie, int, valerie_clip_offset, int, char *, int64_t, int64_t );
extern valerie_error_code valerie_unit_play( valerie, int );
extern valerie_error_code valerie_unit_play_at_speed( valerie, int, int );
extern valerie_error_code valerie_unit_stop( valerie, int );
extern valerie_error_code valerie_unit_pause( valerie, int );
extern valerie_error_code valerie_unit_rewind( valerie, int );
extern valerie_error_code valerie_unit_fast_forward( valerie, int );
-extern valerie_error_code valerie_unit_step( valerie, int, double );
-extern valerie_error_code valerie_unit_goto( valerie, int, double );
-extern valerie_error_code valerie_unit_clip_goto( valerie, int, valerie_clip_offset, int, double );
-extern valerie_error_code valerie_unit_clip_set_in( valerie, int, valerie_clip_offset, int, double );
-extern valerie_error_code valerie_unit_clip_set_out( valerie, int, valerie_clip_offset, int, double );
-extern valerie_error_code valerie_unit_set_in( valerie, int, double );
-extern valerie_error_code valerie_unit_set_out( valerie, int, double );
+extern valerie_error_code valerie_unit_step( valerie, int, int64_t );
+extern valerie_error_code valerie_unit_goto( valerie, int, int64_t );
+extern valerie_error_code valerie_unit_clip_goto( valerie, int, valerie_clip_offset, int, int64_t );
+extern valerie_error_code valerie_unit_clip_set_in( valerie, int, valerie_clip_offset, int, int64_t );
+extern valerie_error_code valerie_unit_clip_set_out( valerie, int, valerie_clip_offset, int, int64_t );
+extern valerie_error_code valerie_unit_set_in( valerie, int, int64_t );
+extern valerie_error_code valerie_unit_set_out( valerie, int, int64_t );
extern valerie_error_code valerie_unit_clear_in( valerie, int );
extern valerie_error_code valerie_unit_clear_out( valerie, int );
extern valerie_error_code valerie_unit_clear_in_out( valerie, int );
{
int clip;
char full[ PATH_MAX + NAME_MAX ];
- double in;
- double out;
- double max;
- double size;
- double fps;
+ int64_t in;
+ int64_t out;
+ int64_t max;
+ int64_t size;
+ int64_t fps;
}
*valerie_list_entry, valerie_list_entry_t;
{
status->unit = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) );
strncpy( status->clip, valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 2 ), '\"' ), sizeof( status->clip ) );
- status->position = atof( valerie_tokeniser_get_string( tokeniser, 3 ) );
+ status->position = atol( valerie_tokeniser_get_string( tokeniser, 3 ) );
status->speed = atoi( valerie_tokeniser_get_string( tokeniser, 4 ) );
status->fps = atof( valerie_tokeniser_get_string( tokeniser, 5 ) );
- status->in = atof( valerie_tokeniser_get_string( tokeniser, 6 ) );
- status->out = atof( valerie_tokeniser_get_string( tokeniser, 7 ) );
- status->length = atof( valerie_tokeniser_get_string( tokeniser, 8 ) );
+ status->in = atol( valerie_tokeniser_get_string( tokeniser, 6 ) );
+ status->out = atol( valerie_tokeniser_get_string( tokeniser, 7 ) );
+ status->length = atol( valerie_tokeniser_get_string( tokeniser, 8 ) );
strncpy( status->tail_clip, valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 9 ), '\"' ), sizeof( status->tail_clip ) );
- status->tail_position = atof( valerie_tokeniser_get_string( tokeniser, 10 ) );
- status->tail_in = atof( valerie_tokeniser_get_string( tokeniser, 11 ) );
- status->tail_out = atof( valerie_tokeniser_get_string( tokeniser, 12 ) );
- status->tail_length = atof( valerie_tokeniser_get_string( tokeniser, 13 ) );
- status->seek_flag = atof( valerie_tokeniser_get_string( tokeniser, 14 ) );
- status->generation = atof( valerie_tokeniser_get_string( tokeniser, 15 ) );
- status->clip_index = atof( valerie_tokeniser_get_string( tokeniser, 16 ) );
+ status->tail_position = atol( valerie_tokeniser_get_string( tokeniser, 10 ) );
+ status->tail_in = atol( valerie_tokeniser_get_string( tokeniser, 11 ) );
+ status->tail_out = atol( valerie_tokeniser_get_string( tokeniser, 12 ) );
+ status->tail_length = atol( valerie_tokeniser_get_string( tokeniser, 13 ) );
+ status->seek_flag = atoi( valerie_tokeniser_get_string( tokeniser, 14 ) );
+ status->generation = atoi( valerie_tokeniser_get_string( tokeniser, 15 ) );
+ status->clip_index = atoi( valerie_tokeniser_get_string( tokeniser, 16 ) );
if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "unknown" ) )
status->status = unit_unknown;
break;
}
- snprintf( text, length, "%d %s \"%s\" %e %e %.2f %e %e %e \"%s\" %e %e %e %e %d %d %d\r\n",
+ snprintf( text, length, "%d %s \"%s\" %lld %d %.2f %lld %lld %lld \"%s\" %lld %lld %lld %lld %d %d %d\r\n",
status->unit,
status_string,
status->clip,
int unit;
unit_status status;
char clip[ 2048 ];
- double position;
- double speed;
+ int64_t position;
+ int speed;
double fps;
- double in;
- double out;
- double length;
+ int64_t in;
+ int64_t out;
+ int64_t length;
char tail_clip[ 2048 ];
- double tail_position;
- double tail_in;
- double tail_out;
- double tail_length;
+ int64_t tail_position;
+ int64_t tail_in;
+ int64_t tail_out;
+ int64_t tail_length;
int seek_flag;
int generation;
int clip_index;
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
/** Virtual playlist entry.
*/
// Refresh all properties
mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", fps );
- mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps );
+ mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps == 0 ? 25 : fps );
mlt_properties_set_timecode( mlt_playlist_properties( this ), "length", playtime );
mlt_properties_set_timecode( mlt_playlist_properties( this ), "out", playtime );
/** Append to the virtual playlist.
*/
-static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer, mlt_timecode in, mlt_timecode out )
+static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer, mlt_timecode in, mlt_timecode playtime )
{
// Check that we have room
if ( this->count >= this->size )
this->list[ this->count ] = calloc( sizeof( playlist_entry ), 1 );
this->list[ this->count ]->producer = producer;
this->list[ this->count ]->in = in;
- this->list[ this->count ]->playtime = out - in;
+ this->list[ this->count ]->playtime = playtime;
this->count ++;
{
mlt_producer producer = this->list[ index ]->producer;
mlt_properties properties = mlt_producer_properties( producer );
+ info->producer = producer;
+ info->start = mlt_playlist_clip( this, mlt_whence_relative_start, index );
info->resource = mlt_properties_get( properties, "resource" );
info->in = this->list[ index ]->in;
info->out = this->list[ index ]->in + this->list[ index ]->playtime;
return 0;
}
+int mlt_playlist_resize_clip( mlt_playlist this, int clip, mlt_timecode in, mlt_timecode out )
+{
+ int error = clip < 0 || clip >= this->count;
+ if ( error == 0 )
+ {
+ playlist_entry *entry = this->list[ clip ];
+ mlt_producer producer = entry->producer;
+
+ if ( in <= -1 )
+ in = 0;
+ if ( out <= -1 || out >= mlt_producer_get_out( producer ) )
+ out = mlt_producer_get_out( producer );
+
+ if ( out < in )
+ {
+ mlt_timecode t = in;
+ in = out;
+ out = t;
+ }
+
+ entry->in = in;
+ entry->playtime = out - in;
+ mlt_playlist_virtual_refresh( this );
+ }
+ return error;
+}
+
/** Get the current frame.
*/
#include "mlt_producer.h"
-/** Structur for returning clip information.
+/** Structure for returning clip information.
*/
typedef struct
{
+ mlt_producer producer;
+ mlt_timecode start;
char *resource;
- double in;
- double out;
- double playtime;
- double length;
+ mlt_timecode in;
+ mlt_timecode out;
+ mlt_timecode playtime;
+ mlt_timecode length;
float fps;
}
mlt_playlist_clip_info;
extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out );
extern int mlt_playlist_remove( mlt_playlist this, int where );
extern int mlt_playlist_move( mlt_playlist this, int from, int to );
+extern int mlt_playlist_resize_clip( mlt_playlist this, int clip, mlt_timecode in, mlt_timecode out );
extern void mlt_playlist_close( mlt_playlist this );
#endif
return mlt_service_properties( &this->parent );
}
+/** Convert frame position to timecode.
+*/
+
+mlt_timecode mlt_producer_time( mlt_producer this, int64_t frame )
+{
+ if ( frame < 0 )
+ return -1;
+ else
+ return ( mlt_timecode )frame / mlt_producer_get_fps( this );
+}
+
+/** Convert timecode to frame position.
+*/
+
+int64_t mlt_producer_frame_position( mlt_producer this, mlt_timecode position )
+{
+ if ( position < 0 )
+ return -1;
+ else
+ return ( int64_t )( floor( position * mlt_producer_get_fps( this ) + 0.5 ) );
+}
+
/** Seek to a specified time code.
*/
extern int mlt_producer_init( mlt_producer this, void *child );
extern mlt_service mlt_producer_service( mlt_producer this );
extern mlt_properties mlt_producer_properties( mlt_producer this );
+extern mlt_timecode mlt_producer_time( mlt_producer this, int64_t frame );
+extern int64_t mlt_producer_frame_position( mlt_producer this, mlt_timecode position );
extern int mlt_producer_seek( mlt_producer this, mlt_timecode timecode );
extern int mlt_producer_seek_frame( mlt_producer this, uint64_t frame );
extern mlt_timecode mlt_producer_position( mlt_producer this );
return this->prop_string != NULL;
}
+/** Set an int64 on this property.
+*/
+
+int mlt_property_set_int64( mlt_property this, int64_t value )
+{
+ mlt_property_clear( this );
+ this->types = mlt_prop_int64;
+ this->prop_int64 = value;
+ return 0;
+}
+
/** Set a data on this property.
*/
return ( int )this->prop_double;
else if ( this->types & mlt_prop_timecode )
return ( int )this->prop_timecode;
+ else if ( this->types & mlt_prop_int64 )
+ return ( int )this->prop_int64;
else if ( this->types & mlt_prop_string )
return atoi( this->prop_string );
return 0;
return ( double )this->prop_int;
else if ( this->types & mlt_prop_timecode )
return ( double )this->prop_timecode;
+ else if ( this->types & mlt_prop_int64 )
+ return ( double )this->prop_int64;
else if ( this->types & mlt_prop_string )
return atof( this->prop_string );
return 0;
return ( mlt_timecode )this->prop_int;
else if ( this->types & mlt_prop_double )
return ( mlt_timecode )this->prop_double;
+ else if ( this->types & mlt_prop_int64 )
+ return ( mlt_timecode )this->prop_int64;
else if ( this->types & mlt_prop_string )
return ( mlt_timecode )atof( this->prop_string );
return 0;
}
+/** Get an int64 from this property.
+*/
+
+int64_t mlt_property_get_int64( mlt_property this )
+{
+ if ( this->types & mlt_prop_int64 )
+ return this->prop_int64;
+ else if ( this->types & mlt_prop_int )
+ return ( int64_t )this->prop_int;
+ else if ( this->types & mlt_prop_double )
+ return ( int64_t )this->prop_double;
+ else if ( this->types & mlt_prop_timecode )
+ return ( int64_t )this->prop_timecode;
+ else if ( this->types & mlt_prop_string )
+ return ( int64_t )atof( this->prop_string );
+ return 0;
+}
+
/** Get a string from this property.
*/
this->prop_string = malloc( 32 );
sprintf( this->prop_string, "%e", this->prop_timecode );
}
+ else if ( this->types & mlt_prop_int64 )
+ {
+ this->types |= mlt_prop_string;
+ this->prop_string = malloc( 32 );
+ sprintf( this->prop_string, "%lld", this->prop_int64 );
+ }
else if ( this->types & mlt_prop_data && this->serialiser != NULL )
{
this->types |= mlt_prop_string;
mlt_prop_string = 2,
mlt_prop_timecode = 4,
mlt_prop_double = 8,
- mlt_prop_data = 16
+ mlt_prop_data = 16,
+ mlt_prop_int64 = 32
}
mlt_property_type;
int prop_int;
mlt_timecode prop_timecode;
double prop_double;
+ int64_t prop_int64;
// String handling
char *prop_string;
extern int mlt_property_set_int( mlt_property this, int value );
extern int mlt_property_set_double( mlt_property this, double value );
extern int mlt_property_set_timecode( mlt_property this, mlt_timecode value );
+extern int mlt_property_set_uint64( mlt_property this, uint64_t value );
extern int mlt_property_set_string( mlt_property this, char *value );
extern int mlt_property_set_data( mlt_property this, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser );
extern int mlt_property_get_int( mlt_property this );
extern double mlt_property_get_double( mlt_property this );
extern mlt_timecode mlt_property_get_timecode( mlt_property this );
+extern int64_t mlt_property_get_int64( mlt_property this );
extern char *mlt_property_get_string( mlt_property this );
extern void *mlt_property_get_data( mlt_property this, int *length );
extern void mlt_property_close( mlt_property this );
break;
}
- sprintf( temp + strlen( temp ), " %9.2f %9.2f %9.2f ", status->in, status->position, status->out );
+ sprintf( temp + strlen( temp ), " %9lld %9lld %9lld ", status->in, status->position, status->out );
strcat( temp, status->clip );
printf( "%-80.80s\r", temp );
/* System header files */
#include <stdio.h>
+#include <stdint.h>
/* dv1394d header files */
#include <valerie/valerie_remote.h>
pthread_kill_other_threads_np();
miracle_log( LOG_DEBUG, "Clean shutdown." );
free( local );
- mlt_factory_close( );
+ //mlt_factory_close( );
}
mlt_properties_set_int( properties, "generation", ++ generation );
}
+/** Wipe all clips on the playlist for this unit.
+*/
+
static void clear_unit( miracle_unit unit )
{
mlt_properties properties = unit->properties;
mlt_properties properties = unit->properties;
int generation = mlt_properties_get_int( properties, "generation" );
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_producer producer = mlt_playlist_producer( playlist );
valerie_response_printf( response, 1024, "%d\n", generation );
{
mlt_playlist_clip_info info;
mlt_playlist_get_clip_info( playlist , &info, i );
- valerie_response_printf( response, 10240, "%d \"%s\" %e %e %e %e %.2f\n",
- i, info.resource, info.in, info.out, info.playtime, info.length, info.fps );
+ valerie_response_printf( response, 10240, "%d \"%s\" %lld %lld %lld %lld %.2f\n",
+ i, info.resource,
+ mlt_producer_frame_position( producer, info.in ),
+ mlt_producer_frame_position( producer, info.out ),
+ mlt_producer_frame_position( producer, info.playtime ),
+ mlt_producer_frame_position( producer, info.length ),
+ info.fps );
}
}
\param out The ending frame (-1 for maximum)
*/
-valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush )
+valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush )
{
// Have to clear the unit first
clear_unit( unit );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_playlist_append_io( playlist, instance, in, out );
+ mlt_playlist_append_io( playlist, instance, mlt_producer_time( instance, in ), mlt_producer_time( instance, out ) );
miracle_log( LOG_DEBUG, "loaded clip %s", clip );
miracle_unit_status_communicate( unit );
return valerie_ok;
return valerie_invalid_file;
}
-valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out )
+valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out )
{
mlt_producer instance = create_producer( unit, clip );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_playlist_insert( playlist, instance, index, in, out );
+ mlt_playlist_insert( playlist, instance, index, mlt_producer_time( instance, in ), mlt_producer_time( instance, out ) );
miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
mlt_playlist_remove( playlist, index );
miracle_log( LOG_DEBUG, "removed clip at %d", index );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
mlt_playlist_move( playlist, src, dest );
miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
\param out The ending frame (-1 for maximum)
*/
-valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, double in, double out )
+valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out )
{
mlt_producer instance = create_producer( unit, clip );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_playlist_append_io( playlist, instance, in, out );
+ mlt_playlist_append_io( playlist, instance, mlt_producer_time( instance, in ), mlt_producer_time( instance, out ) );
miracle_log( LOG_DEBUG, "appended clip %s", clip );
+ update_generation( unit );
miracle_unit_status_communicate( unit );
return valerie_ok;
}
strncpy( status->clip, info.resource, sizeof( status->clip ) );
status->speed = (int)( mlt_producer_get_speed( producer ) * 1000.0 );
status->fps = mlt_producer_get_fps( producer );
- status->in = info.in;
- status->out = info.in + info.playtime;
- status->position = mlt_producer_position( clip );
- status->length = mlt_producer_get_length( clip );
+ status->in = mlt_producer_frame_position( producer, info.in );
+ status->out = mlt_producer_frame_position( producer, info.out );
+ status->position = mlt_producer_frame_position( producer, mlt_producer_position( clip ) );
+ status->length = mlt_producer_frame_position( producer, mlt_producer_get_length( clip ) );
+ strncpy( status->tail_clip, info.resource, sizeof( status->tail_clip ) );
+ status->tail_in = mlt_producer_frame_position( producer, info.in );
+ status->tail_out = mlt_producer_frame_position( producer, info.out );
+ status->tail_position = mlt_producer_frame_position( producer, mlt_producer_position( clip ) );
+ status->tail_length = mlt_producer_frame_position( producer, mlt_producer_get_length( clip ) );
+ status->clip_index = mlt_playlist_current_clip( playlist );
status->seek_flag = 1;
}
+ status->generation = mlt_properties_get_int( properties, "generation" );
+
if ( !strcmp( status->clip, "" ) )
status->status = unit_not_loaded;
else if ( status->speed == 0 )
/** Change position in the playlist.
*/
-void miracle_unit_change_position( miracle_unit unit, int clip, double position )
+void miracle_unit_change_position( miracle_unit unit, int clip, int64_t position )
{
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_playlist_clip_info info;
+
+ if ( clip < 0 )
+ clip = 0;
+ else if ( clip >= mlt_playlist_count( playlist ) )
+ clip = mlt_playlist_count( playlist );
+
+ if ( mlt_playlist_get_clip_info( playlist, &info, clip ) == 0 )
+ {
+ mlt_timecode relative = mlt_producer_time( info.producer, position );
+ mlt_timecode absolute = relative - info.in;
+ int64_t frame_start = mlt_producer_frame_position( info.producer, info.start );
+ int64_t frame_offset = 0;
+
+ if ( absolute < 0 )
+ frame_offset = 0;
+ else if ( absolute >= info.out )
+ frame_offset = mlt_producer_frame_position( info.producer, info.out ) - 1;
+ else
+ frame_offset = mlt_producer_frame_position( info.producer, absolute );
+
+ mlt_producer_seek_frame( producer, frame_start + frame_offset );
+ }
+ else
+ {
+ mlt_timecode out = mlt_producer_get_out( producer );
+ mlt_producer_seek( producer, mlt_producer_frame_position( producer, out ) - 1 );
+ }
+
miracle_unit_status_communicate( unit );
}
/** Set a clip's in point
*/
-int miracle_unit_set_clip_in( miracle_unit unit, int index, double position )
+int miracle_unit_set_clip_in( miracle_unit unit, int index, int64_t position )
{
- int error = 0;
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_clip_info info;
+ int error = mlt_playlist_get_clip_info( playlist, &info, index );
+
+ if ( error == 0 )
+ {
+ mlt_timecode in = mlt_producer_time( info.producer, position );
+ error = mlt_playlist_resize_clip( playlist, index, in, info.out );
+ update_generation( unit );
+ miracle_unit_change_position( unit, index, 0 );
+ }
+
return error;
}
/** Set a clip's out point.
*/
-int miracle_unit_set_clip_out( miracle_unit unit, int index, double position )
+int miracle_unit_set_clip_out( miracle_unit unit, int index, int64_t position )
{
- int error = 0;
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_clip_info info;
+ int error = mlt_playlist_get_clip_info( playlist, &info, index );
+
+ if ( error == 0 )
+ {
+ mlt_timecode out = mlt_producer_time( info.producer, position );
+ error = mlt_playlist_resize_clip( playlist, index, info.in, out );
+ update_generation( unit );
+ miracle_unit_status_communicate( unit );
+ miracle_unit_change_position( unit, index, 0 );
+ }
+
return error;
}
/** Step by specified position.
*/
-void miracle_unit_step( miracle_unit unit, double offset )
+void miracle_unit_step( miracle_unit unit, int64_t offset )
{
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_timecode position = mlt_producer_position( producer );
+ mlt_producer_seek( producer, position + mlt_producer_time( producer, offset ) );
}
/** Set the unit's clip mode regarding in and out points.
extern miracle_unit miracle_unit_init( int index, char *arg );
extern void miracle_unit_report_list( miracle_unit unit, valerie_response response );
extern void miracle_unit_allow_stdin( miracle_unit unit, int flag );
-extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush );
-extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out );
-extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, double in, double out );
+extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush );
+extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out );
+extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out );
extern valerie_error_code miracle_unit_remove( miracle_unit unit, int index );
extern valerie_error_code miracle_unit_clean( miracle_unit unit );
extern valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest );
extern int miracle_unit_is_offline( miracle_unit unit );
extern void miracle_unit_set_notifier( miracle_unit, valerie_notifier, char * );
extern int miracle_unit_get_status( miracle_unit, valerie_status );
-extern void miracle_unit_change_position( miracle_unit, int, double position );
+extern void miracle_unit_change_position( miracle_unit, int, int64_t position );
extern void miracle_unit_change_speed( miracle_unit unit, int speed );
-extern int miracle_unit_set_clip_in( miracle_unit unit, int index, double position );
-extern int miracle_unit_set_clip_out( miracle_unit unit, int index, double position );
+extern int miracle_unit_set_clip_in( miracle_unit unit, int index, int64_t position );
+extern int miracle_unit_set_clip_out( miracle_unit unit, int index, int64_t position );
//extern void miracle_unit_set_mode( miracle_unit unit, dv_player_clip_mode mode );
//extern dv_player_clip_mode miracle_unit_get_mode( miracle_unit unit );
//extern void miracle_unit_set_eof_action( miracle_unit unit, dv_player_eof_action mode );
//extern dv_player_eof_action miracle_unit_get_eof_action( miracle_unit unit );
-extern void miracle_unit_step( miracle_unit unit, double offset );
+extern void miracle_unit_step( miracle_unit unit, int64_t offset );
extern void miracle_unit_close( miracle_unit unit );
extern void miracle_unit_suspend( miracle_unit );
extern void miracle_unit_restore( miracle_unit );
return RESPONSE_INVALID_UNIT;
else
{
- double in = -1, out = -1;
+ int64_t in = -1, out = -1;
if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 5 )
{
- in = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
- out = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+ in = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
+ out = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
}
if ( miracle_unit_load( unit, fullname, in, out, flush ) != valerie_ok )
return RESPONSE_BAD_FILE;
return RESPONSE_INVALID_UNIT;
else
{
- double in = -1, out = -1;
+ int64_t in = -1, out = -1;
if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 5 )
{
- in = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
- out = atof( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+ in = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 3 ) );
+ out = atol( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
}
switch ( miracle_unit_append( unit, fullname, in, out ) )
{
int miracle_set_in_point( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
int clip = parse_clip( cmd_arg, 3 );
-
- if (unit == NULL || dv_unit_is_offline(unit))
+
+ if ( unit == NULL )
return RESPONSE_INVALID_UNIT;
else
{
int position = *(int *) cmd_arg->argument;
- switch( dv_unit_set_clip_in( unit, clip, position ) )
+ switch( miracle_unit_set_clip_in( unit, clip, position ) )
{
case -1:
return RESPONSE_BAD_FILE;
return RESPONSE_OUT_OF_RANGE;
}
}
- */
return RESPONSE_SUCCESS;
}
int miracle_set_out_point( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
int clip = parse_clip( cmd_arg, 3 );
- if (unit == NULL || dv_unit_is_offline(unit))
+ if ( unit == NULL )
return RESPONSE_INVALID_UNIT;
else
{
int position = *(int *) cmd_arg->argument;
- switch( dv_unit_set_clip_out( unit, clip, position ) )
+ switch( miracle_unit_set_clip_out( unit, clip, position ) )
{
case -1:
return RESPONSE_BAD_FILE;
return RESPONSE_OUT_OF_RANGE;
}
}
- */
+
return RESPONSE_SUCCESS;
}
mlt_properties_set_double( properties, "fps", fps );
mlt_properties_set_timecode( properties, "length", length );
mlt_properties_set_timecode( properties, "in", 0.0 );
- mlt_properties_set_timecode( properties, "out", length );
+ mlt_properties_set_timecode( properties, "out", ( mlt_timecode )( this->frames_in_file - 1 ) / fps );
// Parse the header for meta info
dv_parse_header( this->dv_decoder, dv_data );
/** Load a file on the specified unit with the specified in/out points.
*/
-valerie_error_code valerie_unit_load_clipped( valerie this, int unit, char *file, double in, double out )
+valerie_error_code valerie_unit_load_clipped( valerie this, int unit, char *file, int64_t in, int64_t out )
{
- return valerie_execute( this, 10240, "LOAD U%d \"%s\" %e %e", unit, file, in, out );
+ return valerie_execute( this, 10240, "LOAD U%d \"%s\" %lld %lld", unit, file, in, out );
}
/** Load a file on the specified unit at the end of the current pump.
/** Load a file on the specified unit at the end of the pump with the specified in/out points.
*/
-valerie_error_code valerie_unit_load_back_clipped( valerie this, int unit, char *file, double in, double out )
+valerie_error_code valerie_unit_load_back_clipped( valerie this, int unit, char *file, int64_t in, int64_t out )
{
- return valerie_execute( this, 10240, "LOAD U%d \"!%s\" %e %e", unit, file, in, out );
+ return valerie_execute( this, 10240, "LOAD U%d \"!%s\" %lld %lld", unit, file, in, out );
}
/** Append a file on the specified unit.
*/
-valerie_error_code valerie_unit_append( valerie this, int unit, char *file, double in, double out )
+valerie_error_code valerie_unit_append( valerie this, int unit, char *file, int64_t in, int64_t out )
{
- return valerie_execute( this, 10240, "APND U%d \"%s\" %e %e", unit, file, in, out );
+ return valerie_execute( this, 10240, "APND U%d \"%s\" %lld %lld", unit, file, in, out );
}
/** Clean the unit - this function removes all but the currently playing clip.
/** Insert clip at the specified position.
*/
-valerie_error_code valerie_unit_clip_insert( valerie this, int unit, valerie_clip_offset offset, int clip, char *file, double in, double out )
+valerie_error_code valerie_unit_clip_insert( valerie this, int unit, valerie_clip_offset offset, int clip, char *file, int64_t in, int64_t out )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "INSERT U%d %s %s %e %e", unit, file, temp, in, out );
+ return valerie_execute( this, 1024, "INSERT U%d %s %s %lld %lld", unit, file, temp, in, out );
}
/** Play the unit at normal speed.
/** Step by the number of frames on the specified unit.
*/
-valerie_error_code valerie_unit_step( valerie this, int unit, double step )
+valerie_error_code valerie_unit_step( valerie this, int unit, int64_t step )
{
- return valerie_execute( this, 1024, "STEP U%d %e", unit, step );
+ return valerie_execute( this, 1024, "STEP U%d %lld", unit, step );
}
/** Goto the specified frame on the specified unit.
*/
-valerie_error_code valerie_unit_goto( valerie this, int unit, double position )
+valerie_error_code valerie_unit_goto( valerie this, int unit, int64_t position )
{
- return valerie_execute( this, 1024, "GOTO U%d %e", unit, position );
+ return valerie_execute( this, 1024, "GOTO U%d %lld", unit, position );
}
/** Goto the specified frame in the clip on the specified unit.
*/
-valerie_error_code valerie_unit_clip_goto( valerie this, int unit, valerie_clip_offset offset, int clip, double position )
+valerie_error_code valerie_unit_clip_goto( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t position )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "GOTO U%d %e %s", unit, position, temp );
+ return valerie_execute( this, 1024, "GOTO U%d %lld %s", unit, position, temp );
}
/** Set the in point of the loaded file on the specified unit.
*/
-valerie_error_code valerie_unit_set_in( valerie this, int unit, double in )
+valerie_error_code valerie_unit_set_in( valerie this, int unit, int64_t in )
{
- return valerie_execute( this, 1024, "SIN U%d %e", unit, in );
+ return valerie_execute( this, 1024, "SIN U%d %lld", unit, in );
}
/** Set the in point of the clip on the specified unit.
*/
-valerie_error_code valerie_unit_clip_set_in( valerie this, int unit, valerie_clip_offset offset, int clip, double in )
+valerie_error_code valerie_unit_clip_set_in( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t in )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "SIN U%d %e %s", unit, in, temp );
+ return valerie_execute( this, 1024, "SIN U%d %lld %s", unit, in, temp );
}
/** Set the out point of the loaded file on the specified unit.
*/
-valerie_error_code valerie_unit_set_out( valerie this, int unit, double out )
+valerie_error_code valerie_unit_set_out( valerie this, int unit, int64_t out )
{
- return valerie_execute( this, 1024, "SOUT U%d %e", unit, out );
+ return valerie_execute( this, 1024, "SOUT U%d %lld", unit, out );
}
/** Set the out point of the clip on the specified unit.
*/
-valerie_error_code valerie_unit_clip_set_out( valerie this, int unit, valerie_clip_offset offset, int clip, double in )
+valerie_error_code valerie_unit_clip_set_out( valerie this, int unit, valerie_clip_offset offset, int clip, int64_t in )
{
char temp[ 100 ];
valerie_interpret_clip_offset( temp, offset, clip );
- return valerie_execute( this, 1024, "SOUT U%d %e %s", unit, in, temp );
+ return valerie_execute( this, 1024, "SOUT U%d %lld %s", unit, in, temp );
}
/** Clear the in point of the loaded file on the specified unit.
entry->clip = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) );
valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 1 ), '\"' );
strcpy( entry->full, valerie_tokeniser_get_string( tokeniser, 1 ) );
- entry->in = atof( valerie_tokeniser_get_string( tokeniser, 2 ) );
- entry->out = atof( valerie_tokeniser_get_string( tokeniser, 3 ) );
- entry->max = atof( valerie_tokeniser_get_string( tokeniser, 4 ) );
- entry->size = atof( valerie_tokeniser_get_string( tokeniser, 5 ) );
+ entry->in = atol( valerie_tokeniser_get_string( tokeniser, 2 ) );
+ entry->out = atol( valerie_tokeniser_get_string( tokeniser, 3 ) );
+ entry->max = atol( valerie_tokeniser_get_string( tokeniser, 4 ) );
+ entry->size = atol( valerie_tokeniser_get_string( tokeniser, 5 ) );
entry->fps = atof( valerie_tokeniser_get_string( tokeniser, 6 ) );
}
valerie_tokeniser_close( tokeniser );
/* Unit functions */
extern valerie_error_code valerie_unit_add( valerie, char *, int * );
extern valerie_error_code valerie_unit_load( valerie, int, char * );
-extern valerie_error_code valerie_unit_load_clipped( valerie, int, char *, double, double );
+extern valerie_error_code valerie_unit_load_clipped( valerie, int, char *, int64_t, int64_t );
extern valerie_error_code valerie_unit_load_back( valerie, int, char * );
-extern valerie_error_code valerie_unit_load_back_clipped( valerie, int, char *, double, double );
-extern valerie_error_code valerie_unit_append( valerie, int, char *, double, double );
+extern valerie_error_code valerie_unit_load_back_clipped( valerie, int, char *, int64_t, int64_t );
+extern valerie_error_code valerie_unit_append( valerie, int, char *, int64_t, int64_t );
extern valerie_error_code valerie_unit_clean( valerie, int );
extern valerie_error_code valerie_unit_clip_move( valerie, int, valerie_clip_offset, int, valerie_clip_offset, int );
extern valerie_error_code valerie_unit_clip_remove( valerie, int, valerie_clip_offset, int );
extern valerie_error_code valerie_unit_remove_current_clip( valerie, int );
-extern valerie_error_code valerie_unit_clip_insert( valerie, int, valerie_clip_offset, int, char *, double, double );
+extern valerie_error_code valerie_unit_clip_insert( valerie, int, valerie_clip_offset, int, char *, int64_t, int64_t );
extern valerie_error_code valerie_unit_play( valerie, int );
extern valerie_error_code valerie_unit_play_at_speed( valerie, int, int );
extern valerie_error_code valerie_unit_stop( valerie, int );
extern valerie_error_code valerie_unit_pause( valerie, int );
extern valerie_error_code valerie_unit_rewind( valerie, int );
extern valerie_error_code valerie_unit_fast_forward( valerie, int );
-extern valerie_error_code valerie_unit_step( valerie, int, double );
-extern valerie_error_code valerie_unit_goto( valerie, int, double );
-extern valerie_error_code valerie_unit_clip_goto( valerie, int, valerie_clip_offset, int, double );
-extern valerie_error_code valerie_unit_clip_set_in( valerie, int, valerie_clip_offset, int, double );
-extern valerie_error_code valerie_unit_clip_set_out( valerie, int, valerie_clip_offset, int, double );
-extern valerie_error_code valerie_unit_set_in( valerie, int, double );
-extern valerie_error_code valerie_unit_set_out( valerie, int, double );
+extern valerie_error_code valerie_unit_step( valerie, int, int64_t );
+extern valerie_error_code valerie_unit_goto( valerie, int, int64_t );
+extern valerie_error_code valerie_unit_clip_goto( valerie, int, valerie_clip_offset, int, int64_t );
+extern valerie_error_code valerie_unit_clip_set_in( valerie, int, valerie_clip_offset, int, int64_t );
+extern valerie_error_code valerie_unit_clip_set_out( valerie, int, valerie_clip_offset, int, int64_t );
+extern valerie_error_code valerie_unit_set_in( valerie, int, int64_t );
+extern valerie_error_code valerie_unit_set_out( valerie, int, int64_t );
extern valerie_error_code valerie_unit_clear_in( valerie, int );
extern valerie_error_code valerie_unit_clear_out( valerie, int );
extern valerie_error_code valerie_unit_clear_in_out( valerie, int );
{
int clip;
char full[ PATH_MAX + NAME_MAX ];
- double in;
- double out;
- double max;
- double size;
- double fps;
+ int64_t in;
+ int64_t out;
+ int64_t max;
+ int64_t size;
+ int64_t fps;
}
*valerie_list_entry, valerie_list_entry_t;
{
status->unit = atoi( valerie_tokeniser_get_string( tokeniser, 0 ) );
strncpy( status->clip, valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 2 ), '\"' ), sizeof( status->clip ) );
- status->position = atof( valerie_tokeniser_get_string( tokeniser, 3 ) );
+ status->position = atol( valerie_tokeniser_get_string( tokeniser, 3 ) );
status->speed = atoi( valerie_tokeniser_get_string( tokeniser, 4 ) );
status->fps = atof( valerie_tokeniser_get_string( tokeniser, 5 ) );
- status->in = atof( valerie_tokeniser_get_string( tokeniser, 6 ) );
- status->out = atof( valerie_tokeniser_get_string( tokeniser, 7 ) );
- status->length = atof( valerie_tokeniser_get_string( tokeniser, 8 ) );
+ status->in = atol( valerie_tokeniser_get_string( tokeniser, 6 ) );
+ status->out = atol( valerie_tokeniser_get_string( tokeniser, 7 ) );
+ status->length = atol( valerie_tokeniser_get_string( tokeniser, 8 ) );
strncpy( status->tail_clip, valerie_util_strip( valerie_tokeniser_get_string( tokeniser, 9 ), '\"' ), sizeof( status->tail_clip ) );
- status->tail_position = atof( valerie_tokeniser_get_string( tokeniser, 10 ) );
- status->tail_in = atof( valerie_tokeniser_get_string( tokeniser, 11 ) );
- status->tail_out = atof( valerie_tokeniser_get_string( tokeniser, 12 ) );
- status->tail_length = atof( valerie_tokeniser_get_string( tokeniser, 13 ) );
- status->seek_flag = atof( valerie_tokeniser_get_string( tokeniser, 14 ) );
- status->generation = atof( valerie_tokeniser_get_string( tokeniser, 15 ) );
- status->clip_index = atof( valerie_tokeniser_get_string( tokeniser, 16 ) );
+ status->tail_position = atol( valerie_tokeniser_get_string( tokeniser, 10 ) );
+ status->tail_in = atol( valerie_tokeniser_get_string( tokeniser, 11 ) );
+ status->tail_out = atol( valerie_tokeniser_get_string( tokeniser, 12 ) );
+ status->tail_length = atol( valerie_tokeniser_get_string( tokeniser, 13 ) );
+ status->seek_flag = atoi( valerie_tokeniser_get_string( tokeniser, 14 ) );
+ status->generation = atoi( valerie_tokeniser_get_string( tokeniser, 15 ) );
+ status->clip_index = atoi( valerie_tokeniser_get_string( tokeniser, 16 ) );
if ( !strcmp( valerie_tokeniser_get_string( tokeniser, 1 ), "unknown" ) )
status->status = unit_unknown;
break;
}
- snprintf( text, length, "%d %s \"%s\" %e %e %.2f %e %e %e \"%s\" %e %e %e %e %d %d %d\r\n",
+ snprintf( text, length, "%d %s \"%s\" %lld %d %.2f %lld %lld %lld \"%s\" %lld %lld %lld %lld %d %d %d\r\n",
status->unit,
status_string,
status->clip,
int unit;
unit_status status;
char clip[ 2048 ];
- double position;
- double speed;
+ int64_t position;
+ int speed;
double fps;
- double in;
- double out;
- double length;
+ int64_t in;
+ int64_t out;
+ int64_t length;
char tail_clip[ 2048 ];
- double tail_position;
- double tail_in;
- double tail_out;
- double tail_length;
+ int64_t tail_position;
+ int64_t tail_in;
+ int64_t tail_out;
+ int64_t tail_length;
int seek_flag;
int generation;
int clip_index;