* vlcglue.h: Main header for the Python binding
*****************************************************************************
* Copyright (C) 1998-2004 the VideoLAN team
- * $Id: vlcglue.h 16752 2006-09-20 11:10:44Z oaubert $
+ * $Id$
*
- * Authors: Olivier Aubert <oaubert at bat710.univ-lyon1.fr>
+ * Authors: Olivier Aubert <olivier.aubert at liris.cnrs.fr>
* Clément Stenac <zorglub@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
#define PY_SSIZE_T_MIN INT_MIN
#endif
-#define SELF ((MediaControl*)self)
/**********************************************************************
* Exceptions handling
PyObject *MediaControl_PositionOriginNotSupported;
PyObject *MediaControl_InvalidPosition;
PyObject *MediaControl_PlaylistException;
-PyObject *vlcInstance_Exception;
+PyObject *vlc_Exception;
+
+/**********************************************************************
+ * vlc.Instance Object
+ **********************************************************************/
+typedef struct
+{
+ PyObject_HEAD
+ libvlc_instance_t* p_instance;
+} vlcInstance;
/**********************************************************************
* MediaControl Object
{
PyObject_HEAD
mediacontrol_Instance* mc;
+ vlcInstance *vlc_instance;
} MediaControl;
/**********************************************************************
} PyPosition;
/**********************************************************************
- * vlc.Instance Object
+ * vlc.MediaPlayer Object
**********************************************************************/
typedef struct
{
PyObject_HEAD
- libvlc_instance_t* p_instance;
-} vlcInstance;
-
-#define LIBVLC_INSTANCE ((vlcInstance*)self)
+ libvlc_media_player_t* p_mp;
+} vlcMediaPlayer;
/**********************************************************************
- * vlc.Input Object
+ * vlc.Media Object
**********************************************************************/
typedef struct
{
PyObject_HEAD
- libvlc_input_t* p_input;
-} vlcInput;
+ libvlc_media_t* p_media;
+} vlcMedia;
/* Forward declarations */
staticforward PyTypeObject MediaControl_Type;
staticforward PyTypeObject PyPosition_Type;
staticforward PyTypeObject vlcInstance_Type;
-staticforward PyTypeObject vlcInput_Type;
+staticforward PyTypeObject vlcMediaPlayer_Type;
+staticforward PyTypeObject vlcMedia_Type;
-#define LIBVLC_INPUT ((vlcInput*)self)
+#define LIBVLC_INSTANCE(self) (((vlcInstance*)self)->p_instance)
+#define LIBVLC_MEDIAPLAYER(self) (((vlcMediaPlayer*)self)->p_mp)
+#define LIBVLC_MEDIA(self) (((vlcMedia*)self)->p_media)
+#define LIBVLC_MC(self) (((MediaControl*)self)->mc)
#define LIBVLC_TRY libvlc_exception_init( &ex );
#define LIBVLC_EXCEPT if( libvlc_exception_raised( &ex ) ) { \
- PyObject *py_exc = vlcInstance_Exception; \
- PyErr_SetString( py_exc, libvlc_exception_get_message( &ex ) ); \
+ PyObject *py_exc = vlc_Exception; \
+ PyErr_SetString( py_exc, libvlc_errmsg() ); \
return NULL; \
}