]> git.sesse.net Git - mlt/blob - src/mlt++/MltProfile.cpp
Fix doc error for mlt_playlist_is_blank().
[mlt] / src / mlt++ / MltProfile.cpp
1 /**
2  * MltProfile.cpp - MLT Wrapper
3  * Copyright (C) 2008 Dan Dennedy <dan@dennedy.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #include "MltProfile.h"
21 #include "MltProperties.h"
22 #include "MltProducer.h"
23
24 using namespace Mlt;
25
26 Profile::Profile( ) :
27         instance( NULL )
28 {
29         instance = mlt_profile_init( NULL );
30 }
31
32 Profile::Profile( const char* name ) :
33         instance( NULL )
34 {
35         instance = mlt_profile_init( name );
36 }
37
38 Profile::Profile( Properties& properties ) :
39         instance( NULL )
40 {
41         instance = mlt_profile_load_properties( properties.get_properties() );
42 }
43
44 Profile::Profile( mlt_profile profile ) :
45         instance( profile )
46 {
47 }
48
49 Profile::~Profile( )
50 {
51         if ( instance )
52                 mlt_profile_close( instance );
53         instance = NULL;
54 }
55
56 mlt_profile Profile::get_profile( ) const
57 {
58         return instance;
59 }
60
61 char* Profile::description() const
62 {
63         return instance->description;
64 }
65
66 int Profile::frame_rate_num() const
67 {
68         return instance->frame_rate_num;
69 }
70
71 int Profile::frame_rate_den() const
72 {
73         return instance->frame_rate_den;
74 }
75
76 double Profile::fps() const
77 {
78         return mlt_profile_fps( instance );
79 }
80
81 int Profile::width() const
82 {
83         return instance->width;
84 }
85
86 int Profile::height() const
87 {
88         return instance->height;
89 }
90
91 bool Profile::progressive() const
92 {
93         return instance->progressive;
94 }
95
96 int Profile::sample_aspect_num() const
97 {
98         return instance->sample_aspect_num;
99 }
100
101 int Profile::sample_aspect_den() const
102 {
103         return instance->sample_aspect_den;
104 }
105
106 double Profile::sar() const
107 {
108         return mlt_profile_sar( instance );
109 }
110
111 int Profile::display_aspect_num() const
112 {
113         return instance->display_aspect_num;
114 }
115
116 int Profile::display_aspect_den() const
117 {
118         return instance->display_aspect_den;
119 }
120
121 double Profile::dar() const
122 {
123         return mlt_profile_dar( instance );
124 }
125
126 int Profile::is_explicit() const
127 {
128         return instance->is_explicit;
129 }
130
131 int Profile::colorspace() const
132 {
133         return instance->colorspace;
134 }
135
136 Properties* Profile::list()
137 {
138         return new Properties( mlt_profile_list() );
139 }
140
141 void Profile::from_producer( Producer &producer )
142 {
143         mlt_profile_from_producer( instance, producer.get_producer() );
144 }
145
146 void Profile::set_width( int width )
147 {
148         instance->width = width;
149 }
150
151 void Profile::set_height( int height )
152 {
153         instance->height = height;
154 }
155
156 void Profile::set_sample_aspect( int numerator, int denominator )
157 {
158         instance->sample_aspect_num = numerator;
159         instance->sample_aspect_den = denominator;
160 }
161
162 void Profile::set_progressive( int progressive )
163 {
164         instance->progressive = progressive;
165 }
166
167 void Profile::set_colorspace( int colorspace )
168 {
169         instance->colorspace = colorspace;
170 }
171
172 void Profile::set_frame_rate( int numerator, int denominator )
173 {
174         instance->frame_rate_num = numerator;
175         instance->frame_rate_den = denominator;
176 }
177
178 void Profile::set_explicit( int boolean )
179 {
180         instance->is_explicit = boolean;
181 }