mlt_tractor.[ch], mlt_multitrack.[ch]: improve doxygen documentation for the tractor...
[melted] / src / framework / mlt_playlist.h
1 /**
2 * \file mlt_playlist.h
3 * \brief playlist 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_PLAYLIST_H_
24 #define _MLT_PLAYLIST_H_
25
26 #include "mlt_producer.h"
27
28 /** \brief structure for returning clip information
29 */
30
31 typedef struct
32 {
33 int clip; /**< the index of the clip within the playlist */
34 mlt_producer producer; /**< the clip's producer (or parent producer of a cut) */
35 mlt_producer cut; /**< the clips' cut producer */
36 mlt_position start; /**< the time this begins relative to the beginning of the playlist */
37 char *resource; /**< the file name or address of the clip */
38 mlt_position frame_in; /**< the clip's in point */
39 mlt_position frame_out; /**< the clip's out point */
40 mlt_position frame_count; /**< the duration of the clip */
41 mlt_position length; /**< the unedited duration of the clip */
42 float fps; /**< the frame rate of the clip */
43 int repeat; /**< the number of times the clip is repeated */
44 }
45 mlt_playlist_clip_info;
46
47 /** Playlist Entry
48 */
49
50 typedef struct playlist_entry_s playlist_entry;
51
52 /** \brief Playlist class
53 *
54 * A playlist is a sequential container of producers and blank spaces. The class provides all
55 * sorts of playlist assembly and manipulation routines. A playlist is also a producer within
56 * the framework.
57 *
58 * \extends mlt_producer_s
59 * \properties \em autoclose Set this true if you are doing sequential processing and want to
60 * automatically close producers as they are finished being used to free resources.
61 * \properties \em meta.fx_cut Set true on a producer to indicate that it is a "fx_cut,"
62 * which is a way to add filters as a playlist entry - useful only in a multitrack. See FxCut on the wiki.
63 * \properties \em mix_in
64 * \properties \em mix_out
65 */
66
67 struct mlt_playlist_s
68 {
69 struct mlt_producer_s parent;
70 struct mlt_producer_s blank;
71
72 int size;
73 int count;
74 playlist_entry **list;
75 };
76
77 #define MLT_PLAYLIST_PRODUCER( playlist ) ( &( playlist )->parent )
78 #define MLT_PLAYLIST_SERVICE( playlist ) MLT_PRODUCER_SERVICE( MLT_PLAYLIST_PRODUCER( playlist ) )
79 #define MLT_PLAYLIST_PROPERTIES( playlist ) MLT_SERVICE_PROPERTIES( MLT_PLAYLIST_SERVICE( playlist ) )
80
81 extern mlt_playlist mlt_playlist_init( );
82 extern mlt_producer mlt_playlist_producer( mlt_playlist self );
83 extern mlt_service mlt_playlist_service( mlt_playlist self );
84 extern mlt_properties mlt_playlist_properties( mlt_playlist self );
85 extern int mlt_playlist_count( mlt_playlist self );
86 extern int mlt_playlist_clear( mlt_playlist self );
87 extern int mlt_playlist_append( mlt_playlist self, mlt_producer producer );
88 extern int mlt_playlist_append_io( mlt_playlist self, mlt_producer producer, mlt_position in, mlt_position out );
89 extern int mlt_playlist_blank( mlt_playlist self, mlt_position length );
90 extern mlt_position mlt_playlist_clip( mlt_playlist self, mlt_whence whence, int index );
91 extern int mlt_playlist_current_clip( mlt_playlist self );
92 extern mlt_producer mlt_playlist_current( mlt_playlist self );
93 extern int mlt_playlist_get_clip_info( mlt_playlist self, mlt_playlist_clip_info *info, int index );
94 extern int mlt_playlist_insert( mlt_playlist self, mlt_producer producer, int where, mlt_position in, mlt_position out );
95 extern int mlt_playlist_remove( mlt_playlist self, int where );
96 extern int mlt_playlist_move( mlt_playlist self, int from, int to );
97 extern int mlt_playlist_resize_clip( mlt_playlist self, int clip, mlt_position in, mlt_position out );
98 extern int mlt_playlist_repeat_clip( mlt_playlist self, int clip, int repeat );
99 extern int mlt_playlist_split( mlt_playlist self, int clip, mlt_position position );
100 extern int mlt_playlist_split_at( mlt_playlist self, mlt_position position, int left );
101 extern int mlt_playlist_join( mlt_playlist self, int clip, int count, int merge );
102 extern int mlt_playlist_mix( mlt_playlist self, int clip, int length, mlt_transition transition );
103 extern int mlt_playlist_mix_add( mlt_playlist self, int clip, mlt_transition transition );
104 extern mlt_producer mlt_playlist_get_clip( mlt_playlist self, int clip );
105 extern mlt_producer mlt_playlist_get_clip_at( mlt_playlist self, mlt_position position );
106 extern int mlt_playlist_get_clip_index_at( mlt_playlist self, mlt_position position );
107 extern int mlt_playlist_clip_is_mix( mlt_playlist self, int clip );
108 extern void mlt_playlist_consolidate_blanks( mlt_playlist self, int keep_length );
109 extern int mlt_playlist_is_blank( mlt_playlist self, int clip );
110 extern int mlt_playlist_is_blank_at( mlt_playlist self, mlt_position position );
111 extern void mlt_playlist_insert_blank( mlt_playlist self, int clip, int length );
112 extern void mlt_playlist_pad_blanks( mlt_playlist self, mlt_position position, int length, int find );
113 extern mlt_producer mlt_playlist_replace_with_blank( mlt_playlist self, int clip );
114 extern int mlt_playlist_insert_at( mlt_playlist self, mlt_position position, mlt_producer producer, int mode );
115 extern int mlt_playlist_clip_start( mlt_playlist self, int clip );
116 extern int mlt_playlist_clip_length( mlt_playlist self, int clip );
117 extern int mlt_playlist_blanks_from( mlt_playlist self, int clip, int bounded );
118 extern int mlt_playlist_remove_region( mlt_playlist self, mlt_position position, int length );
119 extern int mlt_playlist_move_region( mlt_playlist self, mlt_position position, int length, int new_position );
120 extern void mlt_playlist_close( mlt_playlist self );
121
122 #endif
123