* Copyright (C) 2007 the VideoLAN team
* $Id$
*
- * Authors: Olivier Aubert <oaubert at liris.cnrs.fr>
+ * Authors: Olivier Aubert <olivier.aubert at liris.cnrs.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
vlcMedia_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
{
fprintf(stderr, "vlcMedia_new called\n");
- PyErr_SetString( PyExc_TypeError, "vlc.Media can be instanciated by itself. You should use vlc.Instance().media_new(mrl)." );
+ PyErr_SetString( PyExc_TypeError, "vlc.Media can be instantiated by itself. You should use vlc.Instance().media_new(mrl)." );
return NULL;
}
static void
vlcMedia_dealloc( PyObject *self )
{
- libvlc_media_release( LIBVLC_MEDIA->p_media );
+ libvlc_media_release( LIBVLC_MEDIA(self) );
PyObject_DEL( self );
}
return NULL;
LIBVLC_TRY;
- libvlc_media_add_option( LIBVLC_MEDIA->p_media, psz_options, &ex);
+ libvlc_media_add_option( LIBVLC_MEDIA(self), psz_options, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
PyObject * o_ret;
LIBVLC_TRY;
- psz_mrl = libvlc_media_get_mrl( LIBVLC_MEDIA->p_media, &ex);
+ psz_mrl = libvlc_media_get_mrl( LIBVLC_MEDIA(self), &ex);
LIBVLC_EXCEPT;
o_ret = Py_BuildValue( "s", psz_mrl );
libvlc_state_t i_state;
LIBVLC_TRY;
- i_state = libvlc_media_get_state( LIBVLC_MEDIA->p_media, &ex);
+ i_state = libvlc_media_get_state( LIBVLC_MEDIA(self), &ex);
LIBVLC_EXCEPT;
/* FIXME: return the defined state constant */
return Py_BuildValue( "i", i_state );
libvlc_exception_t ex;
libvlc_time_t i_ret;
LIBVLC_TRY;
- i_ret = libvlc_media_get_duration( LIBVLC_MEDIA->p_media, &ex);
+ i_ret = libvlc_media_get_duration( LIBVLC_MEDIA(self), &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "L", i_ret );
}
vlcMediaPlayer *p_ret;
LIBVLC_TRY;
- p_mp = libvlc_media_player_new_from_media( LIBVLC_MEDIA->p_media, &ex);
+ p_mp = libvlc_media_player_new_from_media( LIBVLC_MEDIA(self), &ex);
LIBVLC_EXCEPT;
p_ret = PyObject_New( vlcMediaPlayer, &vlcMediaPlayer_Type );
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
- i_ret = libvlc_media_is_preparsed( LIBVLC_MEDIA->p_media, &ex);
+ i_ret = libvlc_media_is_preparsed( LIBVLC_MEDIA(self), &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "L", i_ret );
}
}
LIBVLC_TRY;
- psz_ret = libvlc_media_get_meta( LIBVLC_MEDIA->p_media, i_index, &ex);
+ psz_ret = libvlc_media_get_meta( LIBVLC_MEDIA(self), i_index, &ex);
LIBVLC_EXCEPT;
o_ret = Py_BuildValue( "s", psz_ret );
"is_preparsed() -> int" },
{ "get_meta", vlcMedia_get_meta, METH_VARARGS,
"get_meta(str) -> str Read the meta of the media." },
-
+
{ NULL } /* Sentinel */
};