self->item->data.f[4] = 1;
}
}
+ else if ( item->next != NULL && item->prev != NULL )
+ {
+ item->prev->next = item->next;
+ item->next->prev = item->prev;
+ }
else if ( item->next != NULL )
{
item->next->prev = item->prev;
else if ( item->prev != NULL )
{
item->prev->next = item->next;
- item->next->prev = item->prev;
}
free( item );
// Get the first item
geometry_item place = self->item;
- while( place != NULL && position < place->data.frame )
+ while( place != NULL && position != place->data.frame )
place = place->next;
if ( place != NULL && position == place->data.frame )
}
// Get the key at the position or the next following
-int mlt_geometry_key( mlt_geometry this, mlt_geometry_item item, int position )
+int mlt_geometry_next_key( mlt_geometry this, mlt_geometry_item item, int position )
{
// Get the local/private geometry structure
geometry self = this->local;
return place == NULL;
}
+// Get the key at the position or the previous key
+int mlt_geometry_prev_key( mlt_geometry this, mlt_geometry_item item, int position )
+{
+ // Get the local/private geometry structure
+ geometry self = this->local;
+
+ // Get the first item
+ geometry_item place = self->item;
+
+ while( place != NULL && place->next != NULL && position >= place->next->data.frame )
+ place = place->next;
+
+ if ( place != NULL )
+ memcpy( item, &place->data, sizeof( struct mlt_geometry_item_s ) );
+
+ return place == NULL;
+}
+
char *mlt_geometry_serialise_cut( mlt_geometry this, int in, int out )
{
struct mlt_geometry_item_s item;
// Typically, we move from key to key
else if ( item.frame < out )
{
- if ( mlt_geometry_key( this, &item, item.frame ) )
+ if ( mlt_geometry_next_key( this, &item, item.frame ) )
break;
// Special case - crop at the out point
// Remove the key at the specified position
extern int mlt_geometry_remove( mlt_geometry self, int position );
// Get the key at the position or the next following
-extern int mlt_geometry_key( mlt_geometry self, mlt_geometry_item item, int position );
+extern int mlt_geometry_next_key( mlt_geometry self, mlt_geometry_item item, int position );
+extern int mlt_geometry_prev_key( mlt_geometry self, mlt_geometry_item item, int position );
// Serialise the current geometry
extern char *mlt_geometry_serialise_cut( mlt_geometry self, int in, int out );
extern char *mlt_geometry_serialise( mlt_geometry self );