]> git.sesse.net Git - mlt/blob - src/framework/mlt_playlist.h
A little debugging.
[mlt] / 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  * \properties \em hide Set to 1 to hide the video (make it an audio-only track),
67  * 2 to hide the audio (make it a video-only track), or 3 to hide audio and video (hidden track).
68  * This property only applies when using a multitrack or transition.
69  * \event \em playlist-next The playlist fires this when it moves to the next item in the list.
70  * The listener receives one argument that is the index of the entry that just completed.
71  */
72
73 struct mlt_playlist_s
74 {
75         struct mlt_producer_s parent;
76         struct mlt_producer_s blank;
77
78         int size;
79         int count;
80         playlist_entry **list;
81 };
82
83 #define MLT_PLAYLIST_PRODUCER( playlist )       ( &( playlist )->parent )
84 #define MLT_PLAYLIST_SERVICE( playlist )        MLT_PRODUCER_SERVICE( MLT_PLAYLIST_PRODUCER( playlist ) )
85 #define MLT_PLAYLIST_PROPERTIES( playlist )     MLT_SERVICE_PROPERTIES( MLT_PLAYLIST_SERVICE( playlist ) )
86
87 extern mlt_playlist mlt_playlist_init( );
88 extern mlt_playlist mlt_playlist_new( mlt_profile profile );
89 extern mlt_producer mlt_playlist_producer( mlt_playlist self );
90 extern mlt_service mlt_playlist_service( mlt_playlist self );
91 extern mlt_properties mlt_playlist_properties( mlt_playlist self );
92 extern int mlt_playlist_count( mlt_playlist self );
93 extern int mlt_playlist_clear( mlt_playlist self );
94 extern int mlt_playlist_append( mlt_playlist self, mlt_producer producer );
95 extern int mlt_playlist_append_io( mlt_playlist self, mlt_producer producer, mlt_position in, mlt_position out );
96 extern int mlt_playlist_blank( mlt_playlist self, mlt_position out );
97 extern int mlt_playlist_blank_time( mlt_playlist self, const char *length );
98 extern mlt_position mlt_playlist_clip( mlt_playlist self, mlt_whence whence, int index );
99 extern int mlt_playlist_current_clip( mlt_playlist self );
100 extern mlt_producer mlt_playlist_current( mlt_playlist self );
101 extern int mlt_playlist_get_clip_info( mlt_playlist self, mlt_playlist_clip_info *info, int index );
102 extern int mlt_playlist_insert( mlt_playlist self, mlt_producer producer, int where, mlt_position in, mlt_position out );
103 extern int mlt_playlist_remove( mlt_playlist self, int where );
104 extern int mlt_playlist_move( mlt_playlist self, int from, int to );
105 extern int mlt_playlist_resize_clip( mlt_playlist self, int clip, mlt_position in, mlt_position out );
106 extern int mlt_playlist_repeat_clip( mlt_playlist self, int clip, int repeat );
107 extern int mlt_playlist_split( mlt_playlist self, int clip, mlt_position position );
108 extern int mlt_playlist_split_at( mlt_playlist self, mlt_position position, int left );
109 extern int mlt_playlist_join( mlt_playlist self, int clip, int count, int merge );
110 extern int mlt_playlist_mix( mlt_playlist self, int clip, int length, mlt_transition transition );
111 extern int mlt_playlist_mix_in( mlt_playlist self, int clip, int length );
112 extern int mlt_playlist_mix_out( mlt_playlist self, int clip, int length );
113 extern int mlt_playlist_mix_add( mlt_playlist self, int clip, mlt_transition transition );
114 extern mlt_producer mlt_playlist_get_clip( mlt_playlist self, int clip );
115 extern mlt_producer mlt_playlist_get_clip_at( mlt_playlist self, mlt_position position );
116 extern int mlt_playlist_get_clip_index_at( mlt_playlist self, mlt_position position );
117 extern int mlt_playlist_clip_is_mix( mlt_playlist self, int clip );
118 extern void mlt_playlist_consolidate_blanks( mlt_playlist self, int keep_length );
119 extern int mlt_playlist_is_blank( mlt_playlist self, int clip );
120 extern int mlt_playlist_is_blank_at( mlt_playlist self, mlt_position position );
121 extern void mlt_playlist_insert_blank( mlt_playlist self, int clip, int out );
122 extern void mlt_playlist_pad_blanks( mlt_playlist self, mlt_position position, int length, int find );
123 extern mlt_producer mlt_playlist_replace_with_blank( mlt_playlist self, int clip );
124 extern int mlt_playlist_insert_at( mlt_playlist self, mlt_position position, mlt_producer producer, int mode );
125 extern int mlt_playlist_clip_start( mlt_playlist self, int clip );
126 extern int mlt_playlist_clip_length( mlt_playlist self, int clip );
127 extern int mlt_playlist_blanks_from( mlt_playlist self, int clip, int bounded );
128 extern int mlt_playlist_remove_region( mlt_playlist self, mlt_position position, int length );
129 extern int mlt_playlist_move_region( mlt_playlist self, mlt_position position, int length, int new_position );
130 extern void mlt_playlist_close( mlt_playlist self );
131
132 #endif
133