2 * MltProperties.cpp - MLT Wrapper
3 * Copyright (C) 2004-2005 Charles Yates
4 * Author: Charles Yates <charles.yates@pandora.be>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #include "MltProperties.h"
24 Properties
::Properties( ) :
28 instance
= mlt_properties_new( );
31 Properties
::Properties( Properties
&properties
) :
33 instance( properties
.get_properties( ) )
37 Properties
::Properties( mlt_properties properties
) :
39 instance( properties
)
43 Properties
::Properties( char *file
) :
47 instance
= mlt_properties_load( file
);
50 Properties
::~Properties( )
53 mlt_properties_close( instance
);
56 mlt_properties Properties
::get_properties( )
61 bool Properties
::is_valid( )
63 return get_properties( ) != NULL
;
66 int Properties
::count( )
68 return mlt_properties_count( get_properties( ) );
71 char *Properties
::get( char *name
)
73 return mlt_properties_get( get_properties( ), name
);
76 int Properties
::get_int( char *name
)
78 return mlt_properties_get_int( get_properties( ), name
);
81 double Properties
::get_double( char *name
)
83 return mlt_properties_get_double( get_properties( ), name
);
86 void *Properties
::get_data( char *name
, int &size
)
88 return mlt_properties_get_data( get_properties( ), name
, &size
);
91 int Properties
::set( char *name
, char *value
)
93 return mlt_properties_set( get_properties( ), name
, value
);
96 int Properties
::set( char *name
, int value
)
98 return mlt_properties_set_int( get_properties( ), name
, value
);
101 int Properties
::set( char *name
, double value
)
103 return mlt_properties_set_double( get_properties( ), name
, value
);
106 int Properties
::set( char *name
, void *value
, int size
, mlt_destructor destructor
, mlt_serialiser serialiser
)
108 return mlt_properties_set_data( get_properties( ), name
, value
, size
, destructor
, serialiser
);
111 int Properties
::pass_values( Properties
&that
, char *prefix
)
113 return mlt_properties_pass( get_properties( ), that
.get_properties( ), prefix
);
116 int Properties
::parse( char *namevalue
)
118 return mlt_properties_parse( get_properties( ), namevalue
);
121 char *Properties
::get_name( int index
)
123 return mlt_properties_get_name( get_properties( ), index
);
126 char *Properties
::get( int index
)
128 return mlt_properties_get_value( get_properties( ), index
);
131 void *Properties
::get_data( int index
, int &size
)
133 return mlt_properties_get_data_at( get_properties( ), index
, &size
);
136 void Properties
::mirror( Properties
&that
)
138 mlt_properties_mirror( get_properties( ), that
.get_properties( ) );
141 int Properties
::inherit( Properties
&that
)
143 return mlt_properties_inherit( get_properties( ), that
.get_properties( ) );
146 int Properties
::rename( char *source
, char *dest
)
148 return mlt_properties_rename( get_properties( ), source
, dest
);
151 void Properties
::dump( FILE *output
)
153 mlt_properties_dump( get_properties( ), output
);