4bd3e7f96f2d534efc013c272220cf9ae3b6c7ee
[melted] / src / framework / mlt_multitrack.h
1 /**
2 * \file mlt_multitrack.h
3 * \brief multitrack service class
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_MULITRACK_H_
24 #define _MLT_MULITRACK_H_
25
26 #include "mlt_producer.h"
27
28 /** \brief Track class
29 */
30
31 struct mlt_track_s
32 {
33 mlt_producer producer;
34 mlt_event event;
35 };
36
37 typedef struct mlt_track_s *mlt_track;
38
39 /** \brief Multitrack class
40 *
41 * A multitrack is a parallel container of producers that acts a single producer.
42 *
43 * \extends mlt_producer_s
44 */
45
46 struct mlt_multitrack_s
47 {
48 /* We're extending producer here */
49 struct mlt_producer_s parent;
50 mlt_track *list;
51 int size;
52 int count;
53 };
54
55 #define MLT_MULTITRACK_PRODUCER( multitrack ) ( &( multitrack )->parent )
56 #define MLT_MULTITRACK_SERVICE( multitrack ) MLT_PRODUCER_SERVICE( MLT_MULTITRACK_PRODUCER( multitrack ) )
57 #define MLT_MULTITRACK_PROPERTIES( multitrack ) MLT_SERVICE_PROPERTIES( MLT_MULTITRACK_SERVICE( multitrack ) )
58
59 extern mlt_multitrack mlt_multitrack_init( );
60 extern mlt_producer mlt_multitrack_producer( mlt_multitrack self );
61 extern mlt_service mlt_multitrack_service( mlt_multitrack self );
62 extern mlt_properties mlt_multitrack_properties( mlt_multitrack self );
63 extern int mlt_multitrack_connect( mlt_multitrack self, mlt_producer producer, int track );
64 extern mlt_position mlt_multitrack_clip( mlt_multitrack self, mlt_whence whence, int index );
65 extern void mlt_multitrack_close( mlt_multitrack self );
66 extern int mlt_multitrack_count( mlt_multitrack self );
67 extern void mlt_multitrack_refresh( mlt_multitrack self );
68 extern mlt_producer mlt_multitrack_track( mlt_multitrack self, int track );
69
70 #endif
71