X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltTransition.cpp;h=3a194e45b9568f31df52a4b1629be58026d84f52;hb=c1dda4b336a041cef7ad422a9dffc4705c7128fa;hp=517abaf8b609154bef1353abe7951ef4605fffb0;hpb=01116637238e74419971afc26311c7a65b7b43aa;p=melted diff --git a/mlt++/src/MltTransition.cpp b/mlt++/src/MltTransition.cpp index 517abaf..3a194e4 100644 --- a/mlt++/src/MltTransition.cpp +++ b/mlt++/src/MltTransition.cpp @@ -18,32 +18,62 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include #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 ) { - instance = mlt_factory_transition( id, arg ); + if ( arg != NULL ) + { + instance = mlt_factory_transition( profile.get_profile(), id, arg ); + } + else + { + if ( strchr( id, ':' ) ) + { + char *temp = strdup( id ); + char *arg = strchr( temp, ':' ) + 1; + *( arg - 1 ) = '\0'; + instance = mlt_factory_transition( profile.get_profile(), temp, arg ); + free( temp ); + } + else + { + 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( ) @@ -56,4 +86,7 @@ mlt_service Transition::get_service( ) 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 ); +}