MLT_0.9.0 {
global:
"mlt_service_filter_count";
+ "mlt_service_move_filter";
} MLT_0.8.8;
return result;
}
+/** Reorder the attached filters.
+ *
+ * \public \memberof mlt_service_s
+ * \param self a service
+ * \param from the current index value of the filter to move
+ * \param to the new index value for the filter specified in \p from
+ * \return true if there was an error
+ */
+
+int mlt_service_move_filter( mlt_service self, int from, int to )
+{
+ int error = -1;
+ if ( self )
+ {
+ mlt_service_base *base = self->local;
+ if ( from < 0 ) from = 0;
+ if ( from >= base->filter_count ) from = base->filter_count - 1;
+ if ( to < 0 ) to = 0;
+ if ( to >= base->filter_count ) to = base->filter_count - 1;
+ if ( from != to && base->filter_count > 1 )
+ {
+ mlt_filter filter = base->filters[from];
+ int i;
+ if ( from > to )
+ {
+ for ( i = from; i > to; i-- )
+ base->filters[i] = base->filters[i - 1];
+ }
+ else
+ {
+ for ( i = from; i < to; i++ )
+ base->filters[i] = base->filters[i + 1];
+ }
+ base->filters[to] = filter;
+ error = 0;
+ }
+ }
+ return error;
+}
+
/** Retrieve an attached filter.
*
* \public \memberof mlt_service_s
extern int mlt_service_detach( mlt_service self, mlt_filter filter );
extern void mlt_service_apply_filters( mlt_service self, mlt_frame frame, int index );
extern int mlt_service_filter_count( mlt_service self );
+extern int mlt_service_move_filter( mlt_service self, int from, int to );
extern mlt_filter mlt_service_filter( mlt_service self, int index );
extern mlt_profile mlt_service_profile( mlt_service self );
extern void mlt_service_set_profile( mlt_service self, mlt_profile profile );
return mlt_service_filter_count( get_service() );
}
+int Service::move_filter(int from, int to)
+{
+ return mlt_service_move_filter( get_service(), from, to );
+}
+
Filter *Service::filter( int index )
{
mlt_filter result = mlt_service_filter( get_service( ), index );
int attach( Filter &filter );
int detach( Filter &filter );
int filter_count( );
+ int move_filter( int from, int to );
Filter *filter( int index );
void set_profile( Profile &profile );
};
extern "C++" {
"Mlt::Deque::peek(int)";
"Mlt::Service::filter_count()";
+ "Mlt::Service::move_filter(int, int)";
};
} MLTPP_0.8.8;