]> git.sesse.net Git - mlt/blob - mlt++/src/MltGeometry.cpp
Remove files that no longer belong.
[mlt] / mlt++ / src / MltGeometry.cpp
1 /**
2  * MltGeometry.cpp - MLT Wrapper
3  * Copyright (C) 2004-2005 Charles Yates
4  * Author: Charles Yates <charles.yates@pandora.be>
5  *
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.
10  *
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.
15  *
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.
19  */
20
21 #include <stdlib.h>
22 #include "MltGeometry.h"
23 using namespace Mlt;
24
25 Geometry::Geometry( char *data, int length, int nw, int nh )
26 {
27         geometry = mlt_geometry_init( );
28         parse( data, length, nw, nh );
29 }
30
31 Geometry::~Geometry( )
32 {
33         mlt_geometry_close( geometry );
34 }
35
36 int Geometry::parse( char *data, int length, int nw, int nh )
37 {
38         return mlt_geometry_parse( geometry, data, length, nw, nh );
39 }
40
41 // Fetch a geometry item for an absolute position
42 int Geometry::fetch( GeometryItem &item, float position )
43 {
44         return mlt_geometry_fetch( geometry, item.get_item( ), position );
45 }
46
47 int Geometry::fetch( GeometryItem *item, float position )
48 {
49         return mlt_geometry_fetch( geometry, item->get_item( ), position );
50 }
51
52 // Specify a geometry item at an absolute position
53 int Geometry::insert( GeometryItem &item )
54 {
55         return mlt_geometry_insert( geometry, item.get_item( ) );
56 }
57
58 int Geometry::insert( GeometryItem *item )
59 {
60         return mlt_geometry_insert( geometry, item->get_item( ) );
61 }
62
63 // Remove the key at the specified position
64 int Geometry::remove( int position )
65 {
66         return mlt_geometry_remove( geometry, position );
67 }
68
69 // Get the key at the position or the next following
70 int Geometry::next_key( GeometryItem &item, int position )
71 {
72         return mlt_geometry_next_key( geometry, item.get_item( ), position );
73 }
74
75 int Geometry::next_key( GeometryItem *item, int position )
76 {
77         return mlt_geometry_next_key( geometry, item->get_item( ), position );
78 }
79
80 int Geometry::prev_key( GeometryItem &item, int position )
81 {
82         return mlt_geometry_prev_key( geometry, item.get_item( ), position );
83 }
84
85 int Geometry::prev_key( GeometryItem *item, int position )
86 {
87         return mlt_geometry_prev_key( geometry, item->get_item( ), position );
88 }
89
90 // Serialise the current geometry
91 char *Geometry::serialise( int in, int out )
92 {
93         return mlt_geometry_serialise_cut( geometry, in, out );
94 }
95
96 char *Geometry::serialise( )
97 {
98         return mlt_geometry_serialise( geometry );
99 }
100