#include <stdlib.h>
#include <string.h>
#include "MltTransition.h"
+#include "MltProfile.h"
using namespace Mlt;
-Transition::Transition( char *id, char *arg ) :
- destroy( true ),
+Transition::Transition( Profile& profile, char *id, char *arg ) :
instance( NULL )
{
if ( arg != NULL )
{
- instance = mlt_factory_transition( id, arg );
+ instance = mlt_factory_transition( profile.get_profile(), id, arg );
}
else
{
char *temp = strdup( id );
char *arg = strchr( temp, ':' ) + 1;
*( arg - 1 ) = '\0';
- instance = mlt_factory_transition( temp, arg );
+ instance = mlt_factory_transition( profile.get_profile(), temp, arg );
free( temp );
}
else
{
- instance = mlt_factory_transition( id, NULL );
+ instance = mlt_factory_transition( profile.get_profile(), id, NULL );
}
}
}
+Transition::Transition( Service &transition ) :
+ instance( NULL )
+{
+ if ( transition.type( ) == transition_type )
+ {
+ instance = ( mlt_transition )transition.get_service( );
+ inc_ref( );
+ }
+}
+
Transition::Transition( Transition &transition ) :
- destroy( false ),
+ Mlt::Service( transition ),
instance( transition.get_transition( ) )
{
+ inc_ref( );
}
Transition::Transition( mlt_transition transition ) :
- destroy( false ),
instance( transition )
{
+ inc_ref( );
}
Transition::~Transition( )
{
- if ( destroy )
- mlt_transition_close( instance );
+ mlt_transition_close( instance );
}
mlt_transition Transition::get_transition( )
return mlt_transition_service( get_transition( ) );
}
+void Transition::set_in_and_out( int in, int out )
+{
+ mlt_transition_set_in_and_out( get_transition( ), in, out );
+}