2 * MltTransition.cpp - MLT Wrapper
3 * Copyright (C) 2004-2005 Charles Yates
4 * Author: Charles Yates <charles.yates@pandora.be>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "MltTransition.h"
24 #include "MltProfile.h"
25 #include "MltProducer.h"
28 Transition::Transition( Profile& profile, const char *id, const char *arg ) :
33 instance = mlt_factory_transition( profile.get_profile(), id, arg );
37 if ( strchr( id, ':' ) )
39 char *temp = strdup( id );
40 char *arg = strchr( temp, ':' ) + 1;
42 instance = mlt_factory_transition( profile.get_profile(), temp, arg );
47 instance = mlt_factory_transition( profile.get_profile(), id, NULL );
52 Transition::Transition( Service &transition ) :
55 if ( transition.type( ) == transition_type )
57 instance = ( mlt_transition )transition.get_service( );
62 Transition::Transition( Transition &transition ) :
63 Mlt::Service( transition ),
64 instance( transition.get_transition( ) )
69 Transition::Transition( mlt_transition transition ) :
70 instance( transition )
75 Transition::~Transition( )
77 mlt_transition_close( instance );
80 mlt_transition Transition::get_transition( )
85 mlt_service Transition::get_service( )
87 return mlt_transition_service( get_transition( ) );
90 void Transition::set_in_and_out( int in, int out )
92 mlt_transition_set_in_and_out( get_transition( ), in, out );
95 int Transition::connect( Producer &producer, int a_track, int b_track )
97 return mlt_transition_connect( get_transition(), producer.get_service(), a_track, b_track );
100 int Transition::get_a_track( )
102 return mlt_transition_get_a_track( get_transition() );
105 int Transition::get_b_track( )
107 return mlt_transition_get_b_track( get_transition() );
110 int Transition::get_in( )
112 return mlt_transition_get_in( get_transition() );
115 int Transition::get_out( )
117 return mlt_transition_get_out( get_transition() );
120 int Transition::get_length( )
122 return mlt_transition_get_length( get_transition( ) );
125 int Transition::get_position( Frame &frame )
127 return mlt_transition_get_position( get_transition( ), frame.get_frame( ) );
130 double Transition::get_progress( Frame &frame )
132 return mlt_transition_get_progress( get_transition( ), frame.get_frame( ) );
135 double Transition::get_progress_delta( Frame &frame )
137 return mlt_transition_get_progress_delta( get_transition( ), frame.get_frame( ) );