2 * MltProfile.cpp - MLT Wrapper
3 * Copyright (C) 2008 Dan Dennedy <dan@dennedy.org>
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.
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.
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
20 #include "MltProfile.h"
21 #include "MltProperties.h"
22 #include "MltProducer.h"
29 instance = mlt_profile_init( NULL );
32 Profile::Profile( const char* name ) :
35 instance = mlt_profile_init( name );
38 Profile::Profile( Properties& properties ) :
41 instance = mlt_profile_load_properties( properties.get_properties() );
44 Profile::Profile( mlt_profile profile ) :
52 mlt_profile_close( instance );
56 mlt_profile Profile::get_profile( ) const
61 char* Profile::description() const
63 return instance->description;
66 int Profile::frame_rate_num() const
68 return instance->frame_rate_num;
71 int Profile::frame_rate_den() const
73 return instance->frame_rate_den;
76 double Profile::fps() const
78 return mlt_profile_fps( instance );
81 int Profile::width() const
83 return instance->width;
86 int Profile::height() const
88 return instance->height;
91 bool Profile::progressive() const
93 return instance->progressive;
96 int Profile::sample_aspect_num() const
98 return instance->sample_aspect_num;
101 int Profile::sample_aspect_den() const
103 return instance->sample_aspect_den;
106 double Profile::sar() const
108 return mlt_profile_sar( instance );
111 int Profile::display_aspect_num() const
113 return instance->display_aspect_num;
116 int Profile::display_aspect_den() const
118 return instance->display_aspect_den;
121 double Profile::dar() const
123 return mlt_profile_dar( instance );
126 Properties* Profile::list()
128 return new Properties( mlt_profile_list() );
131 void Profile::from_producer( Producer &producer )
133 mlt_profile_from_producer( instance, producer.get_producer() );
136 void Profile::set_width( int width )
138 instance->width = width;
141 void Profile::set_height( int height )
143 instance->height = height;
146 void Profile::set_sample_aspect( int numerator, int denominator )
148 instance->sample_aspect_num = numerator;
149 instance->sample_aspect_den = denominator;
152 void Profile::set_progressive( int progressive )
154 instance->progressive = progressive;
157 void Profile::set_colorspace( int colorspace )
159 instance->colorspace = colorspace;
162 void Profile::set_frame_rate( int numerator, int denominator )
164 instance->sample_aspect_num = numerator;
165 instance->sample_aspect_den = denominator;
168 void Profile::set_explicit( int boolean )
170 instance->is_explicit = boolean;