Constness changes
[melted] / src / framework / mlt_playlist.h
1 /**
2 * \file mlt_playlist.h
3 * \brief playlist service class
4 * \see mlt_playlist_s
5 *
6 * Copyright (C) 2003-2009 Ushodaya Enterprises Limited
7 * \author Charles Yates <charles.yates@pandora.be>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24 #ifndef _MLT_PLAYLIST_H_
25 #define _MLT_PLAYLIST_H_
26
27 #include "mlt_producer.h"
28
29 /** \brief structure for returning clip information from a playlist entry
30 */
31
32 typedef struct
33 {
34 int clip; /**< the index of the clip within the playlist */
35 mlt_producer producer; /**< the clip's producer (or parent producer of a cut) */
36 mlt_producer cut; /**< the clips' cut producer */
37 mlt_position start; /**< the time this begins relative to the beginning of the playlist */
38 char *resource; /**< the file name or address of the clip */
39 mlt_position frame_in; /**< the clip's in point */
40 mlt_position frame_out; /**< the clip's out point */
41 mlt_position frame_count; /**< the duration of the clip */
42 mlt_position length; /**< the unedited duration of the clip */
43 float fps; /**< the frame rate of the clip */
44 int repeat; /**< the number of times the clip is repeated */
45 }
46 mlt_playlist_clip_info;
47
48 /** Playlist Entry
49 */
50
51 typedef struct playlist_entry_s playlist_entry;
52
53 /** \brief Playlist class
54 *
55 * A playlist is a sequential container of producers and blank spaces. The class provides all
56 * sorts of playlist assembly and manipulation routines. A playlist is also a producer within
57 * the framework.
58 *
59 * \extends mlt_producer_s
60 * \properties \em autoclose Set this true if you are doing sequential processing and want to
61 * automatically close producers as they are finished being used to free resources.
62 * \properties \em meta.fx_cut Set true on a producer to indicate that it is a "fx_cut,"
63 * which is a way to add filters as a playlist entry - useful only in a multitrack. See FxCut on the wiki.
64 * \properties \em mix_in
65 * \properties \em mix_out
66 */
67
68 struct mlt_playlist_s
69 {
70 struct mlt_producer_s parent;
71 struct mlt_producer_s blank;
72
73 int size;
74 int count;
75 playlist_entry **list;
76 };
77
78 #define MLT_PLAYLIST_PRODUCER( playlist ) ( &( playlist )->parent )
79 #define MLT_PLAYLIST_SERVICE( playlist ) MLT_PRODUCER_SERVICE( MLT_PLAYLIST_PRODUCER( playlist ) )
80 #define MLT_PLAYLIST_PROPERTIES( playlist ) MLT_SERVICE_PROPERTIES( MLT_PLAYLIST_SERVICE( playlist ) )
81
82 extern mlt_playlist mlt_playlist_init( );
83 extern mlt_producer mlt_playlist_producer( mlt_playlist self );
84 extern mlt_service mlt_playlist_service( mlt_playlist self );
85 extern mlt_properties mlt_playlist_properties( mlt_playlist self );
86 extern int mlt_playlist_count( mlt_playlist self );
87 extern int mlt_playlist_clear( mlt_playlist self );
88 extern int mlt_playlist_append( mlt_playlist self, mlt_producer producer );
89 extern int mlt_playlist_append_io( mlt_playlist self, mlt_producer producer, mlt_position in, mlt_position out );
90 extern int mlt_playlist_blank( mlt_playlist self, mlt_position length );
91 extern mlt_position mlt_playlist_clip( mlt_playlist self, mlt_whence whence, int index );
92 extern int mlt_playlist_current_clip( mlt_playlist self );
93 extern mlt_producer mlt_playlist_current( mlt_playlist self );
94 extern int mlt_playlist_get_clip_info( mlt_playlist self, mlt_playlist_clip_info *info, int index );
95 extern int mlt_playlist_insert( mlt_playlist self, mlt_producer producer, int where, mlt_position in, mlt_position out );
96 extern int mlt_playlist_remove( mlt_playlist self, int where );
97 extern int mlt_playlist_move( mlt_playlist self, int from, int to );
98 extern int mlt_playlist_resize_clip( mlt_playlist self, int clip, mlt_position in, mlt_position out );
99 extern int mlt_playlist_repeat_clip( mlt_playlist self, int clip, int repeat );
100 extern int mlt_playlist_split( mlt_playlist self, int clip, mlt_position position );
101 extern int mlt_playlist_split_at( mlt_playlist self, mlt_position position, int left );
102 extern int mlt_playlist_join( mlt_playlist self, int clip, int count, int merge );
103 extern int mlt_playlist_mix( mlt_playlist self, int clip, int length, mlt_transition transition );
104 extern int mlt_playlist_mix_add( mlt_playlist self, int clip, mlt_transition transition );
105 extern mlt_producer mlt_playlist_get_clip( mlt_playlist self, int clip );
106 extern mlt_producer mlt_playlist_get_clip_at( mlt_playlist self, mlt_position position );
107 extern int mlt_playlist_get_clip_index_at( mlt_playlist self, mlt_position position );
108 extern int mlt_playlist_clip_is_mix( mlt_playlist self, int clip );
109 extern void mlt_playlist_consolidate_blanks( mlt_playlist self, int keep_length );
110 extern int mlt_playlist_is_blank( mlt_playlist self, int clip );
111 extern int mlt_playlist_is_blank_at( mlt_playlist self, mlt_position position );
112 extern void mlt_playlist_insert_blank( mlt_playlist self, int clip, int length );
113 extern void mlt_playlist_pad_blanks( mlt_playlist self, mlt_position position, int length, int find );
114 extern mlt_producer mlt_playlist_replace_with_blank( mlt_playlist self, int clip );
115 extern int mlt_playlist_insert_at( mlt_playlist self, mlt_position position, mlt_producer producer, int mode );
116 extern int mlt_playlist_clip_start( mlt_playlist self, int clip );
117 extern int mlt_playlist_clip_length( mlt_playlist self, int clip );
118 extern int mlt_playlist_blanks_from( mlt_playlist self, int clip, int bounded );
119 extern int mlt_playlist_remove_region( mlt_playlist self, mlt_position position, int length );
120 extern int mlt_playlist_move_region( mlt_playlist self, mlt_position position, int length, int new_position );
121 extern void mlt_playlist_close( mlt_playlist self );
122
123 #endif
124