1 /*****************************************************************************
2 * vlcglue.h: Main header for the Python binding
3 *****************************************************************************
4 * Copyright (C) 1998-2004 the VideoLAN team
7 * Authors: Olivier Aubert <oaubert at bat710.univ-lyon1.fr>
8 * Clément Stenac <zorglub@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
26 #include "structmember.h"
32 #include <vlc/mediacontrol_structures.h>
33 #include <vlc/mediacontrol.h>
35 #define SELF ((MediaControl*)self)
37 /**********************************************************************
39 **********************************************************************/
41 #define MC_TRY exception=mediacontrol_exception_init(exception)
44 if( exception->code ) { \
45 PyObject *py_exc = MediaControl_InternalException; \
46 switch( exception->code ) { \
47 case mediacontrol_InternalException: \
48 py_exc = MediaControl_InternalException; \
50 case mediacontrol_PlaylistException: \
51 py_exc = MediaControl_PlaylistException; \
53 case mediacontrol_InvalidPosition: \
54 py_exc = MediaControl_InvalidPosition; \
56 case mediacontrol_PositionKeyNotSupported: \
57 py_exc = MediaControl_PositionKeyNotSupported; \
59 case mediacontrol_PositionOriginNotSupported: \
60 py_exc = MediaControl_PositionOriginNotSupported; \
63 PyErr_SetString( py_exc, exception->message ); \
64 mediacontrol_exception_free( exception ); \
66 } else { mediacontrol_exception_free( exception ); }
68 PyObject *MediaControl_InternalException;
69 PyObject *MediaControl_PositionKeyNotSupported;
70 PyObject *MediaControl_PositionOriginNotSupported;
71 PyObject *MediaControl_InvalidPosition;
72 PyObject *MediaControl_PlaylistException;
74 /**********************************************************************
76 **********************************************************************/
77 #define VLCSELF ( ( vlcObject* )self )
79 /**********************************************************************
81 **********************************************************************/
85 vlc_object_t* p_object;
89 staticforward PyTypeObject vlcObject_Type;
91 /**********************************************************************
93 **********************************************************************/
97 mediacontrol_Instance* mc;
100 staticforward PyTypeObject MediaControl_Type;
102 /**********************************************************************
104 **********************************************************************/
113 staticforward PyTypeObject PyPosition_Type;
115 mediacontrol_PositionKey positionKey_py_to_c( PyObject * py_key );
116 mediacontrol_PositionOrigin positionOrigin_py_to_c( PyObject * py_origin );
117 mediacontrol_Position * position_py_to_c( PyObject * py_position );
118 PyPosition * position_c_to_py( mediacontrol_Position * position );