Commit 1fb54fc4 authored by Olivier Aubert's avatar Olivier Aubert

python bindings: formatted to VLC coding style

parent 9992f342
This diff is collapsed.
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include <Python.h> #include <Python.h>
#include "structmember.h" #include "structmember.h"
/* Undefine the following define to disable low-level vlc Object support */
#define VLCOBJECT_SUPPORT 0
#define __VLC__ #define __VLC__
#include <stdio.h> #include <stdio.h>
...@@ -44,9 +41,9 @@ ...@@ -44,9 +41,9 @@
#define MC_TRY exception=mediacontrol_exception_init(exception) #define MC_TRY exception=mediacontrol_exception_init(exception)
#define MC_EXCEPT \ #define MC_EXCEPT \
if (exception->code) { \ if( exception->code ) { \
PyObject *py_exc = MediaControl_InternalException; \ PyObject *py_exc = MediaControl_InternalException; \
switch (exception->code) { \ switch( exception->code ) { \
case mediacontrol_InternalException: \ case mediacontrol_InternalException: \
py_exc = MediaControl_InternalException; \ py_exc = MediaControl_InternalException; \
break; \ break; \
...@@ -63,10 +60,10 @@ ...@@ -63,10 +60,10 @@
py_exc = MediaControl_PositionOriginNotSupported; \ py_exc = MediaControl_PositionOriginNotSupported; \
break; \ break; \
} \ } \
PyErr_SetString(py_exc, exception->message); \ PyErr_SetString( py_exc, exception->message ); \
mediacontrol_exception_free(exception); \ mediacontrol_exception_free( exception ); \
return NULL; \ return NULL; \
} else { mediacontrol_exception_free(exception); } } else { mediacontrol_exception_free( exception ); }
PyObject *MediaControl_InternalException; PyObject *MediaControl_InternalException;
PyObject *MediaControl_PositionKeyNotSupported; PyObject *MediaControl_PositionKeyNotSupported;
...@@ -77,9 +74,7 @@ PyObject *MediaControl_PlaylistException; ...@@ -77,9 +74,7 @@ PyObject *MediaControl_PlaylistException;
/********************************************************************** /**********************************************************************
* VLC Object * VLC Object
**********************************************************************/ **********************************************************************/
#ifdef VLCOBJECT_SUPPORT #define VLCSELF ( ( vlcObject* )self )
#define VLCSELF ((vlcObject*)self)
/********************************************************************** /**********************************************************************
* VLCObject Object * VLCObject Object
...@@ -93,8 +88,6 @@ typedef struct ...@@ -93,8 +88,6 @@ typedef struct
staticforward PyTypeObject vlcObject_Type; staticforward PyTypeObject vlcObject_Type;
#endif
/********************************************************************** /**********************************************************************
* MediaControl Object * MediaControl Object
**********************************************************************/ **********************************************************************/
...@@ -121,5 +114,5 @@ staticforward PyTypeObject PyPosition_Type; ...@@ -121,5 +114,5 @@ staticforward PyTypeObject PyPosition_Type;
mediacontrol_PositionKey positionKey_py_to_c( PyObject * py_key ); mediacontrol_PositionKey positionKey_py_to_c( PyObject * py_key );
mediacontrol_PositionOrigin positionOrigin_py_to_c( PyObject * py_origin ); mediacontrol_PositionOrigin positionOrigin_py_to_c( PyObject * py_origin );
mediacontrol_Position* position_py_to_c( PyObject * py_position ); mediacontrol_Position * position_py_to_c( PyObject * py_position );
PyPosition* position_c_to_py(mediacontrol_Position *position); PyPosition * position_c_to_py( mediacontrol_Position * position );
...@@ -116,8 +116,7 @@ mediacontrol_Instance * ...@@ -116,8 +116,7 @@ mediacontrol_Instance *
mediacontrol_new_from_object( int vlc_object_id, mediacontrol_new_from_object( int vlc_object_id,
mediacontrol_Exception *exception ); mediacontrol_Exception *exception );
mediacontrol_Position * mediacontrol_Position * mediacontrol_get_media_position(
mediacontrol_get_media_position(
mediacontrol_Instance *self, mediacontrol_Instance *self,
const mediacontrol_PositionOrigin an_origin, const mediacontrol_PositionOrigin an_origin,
const mediacontrol_PositionKey a_key, const mediacontrol_PositionKey a_key,
......
...@@ -46,7 +46,6 @@ typedef struct { ...@@ -46,7 +46,6 @@ typedef struct {
long value; long value;
} mediacontrol_Position; } mediacontrol_Position;
# ifdef __cplusplus # ifdef __cplusplus
} }
# endif # endif
......
...@@ -31,7 +31,6 @@ extern "C" { ...@@ -31,7 +31,6 @@ extern "C" {
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include "vlc/control_structures.h" #include "vlc/control_structures.h"
typedef struct { typedef struct {
vlc_object_t *p_vlc; vlc_object_t *p_vlc;
playlist_t *p_playlist; playlist_t *p_playlist;
...@@ -47,7 +46,6 @@ vlc_int64_t mediacontrol_position2microsecond( ...@@ -47,7 +46,6 @@ vlc_int64_t mediacontrol_position2microsecond(
input_thread_t *p_input, input_thread_t *p_input,
const mediacontrol_Position *pos ); const mediacontrol_Position *pos );
# ifdef __cplusplus # ifdef __cplusplus
} }
# endif # endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment