0a38157b619a0e4b0096a81f21c4a3b3c6bdb992
[melted] / src / framework / mlt_transition.h
1 /**
2 * \file mlt_transition.h
3 * \brief abstraction for all transition services
4 *
5 * Copyright (C) 2003-2008 Ushodaya Enterprises Limited
6 * \author Charles Yates <charles.yates@pandora.be>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23 #ifndef _MLT_TRANSITION_H_
24 #define _MLT_TRANSITION_H_
25
26 #include "mlt_service.h"
27
28 /** \brief Transition abstract service class
29 *
30 * \extends mlt_service_s
31 */
32
33 struct mlt_transition_s
34 {
35 /* We're implementing service here */
36 struct mlt_service_s parent;
37
38 /* public virtual */
39 void ( *close )( mlt_transition );
40
41 /* protected transition method */
42 mlt_frame ( *process )( mlt_transition, mlt_frame, mlt_frame );
43
44 /* Protected */
45 void *child;
46
47 /* track and in/out points */
48 mlt_service producer;
49
50 /* Private */
51 mlt_frame *frames;
52 int held;
53 };
54
55 /** Public final methods
56 */
57
58 #define MLT_TRANSITION_SERVICE( transition ) ( &( transition )->parent )
59 #define MLT_TRANSITION_PROPERTIES( transition ) MLT_SERVICE_PROPERTIES( MLT_TRANSITION_SERVICE( transition ) )
60
61 extern int mlt_transition_init( mlt_transition self, void *child );
62 extern mlt_transition mlt_transition_new( );
63 extern mlt_service mlt_transition_service( mlt_transition self );
64 extern mlt_properties mlt_transition_properties( mlt_transition self );
65 extern int mlt_transition_connect( mlt_transition self, mlt_service producer, int a_track, int b_track );
66 extern void mlt_transition_set_in_and_out( mlt_transition self, mlt_position in, mlt_position out );
67 extern int mlt_transition_get_a_track( mlt_transition self );
68 extern int mlt_transition_get_b_track( mlt_transition self );
69 extern mlt_position mlt_transition_get_in( mlt_transition self );
70 extern mlt_position mlt_transition_get_out( mlt_transition self );
71 extern mlt_frame mlt_transition_process( mlt_transition self, mlt_frame a_frame, mlt_frame b_frame );
72 extern void mlt_transition_close( mlt_transition self );
73
74 #endif