Changeset 2b5629b6f4920f02b2bbb62683f7ad2d7d386c9e

Show
Ignore:
Timestamp:
04/02/07 19:55:13 (1 year ago)
Author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr>
git-committer:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1175536513 +0000
git-parent:

[7255a5e6399f723e24ab9227d12e547e46036e8a]

git-author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1175536513 +0000
Message:

bindings/python/vlc_internal: implement vlc_object_find_name support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bindings/python/vlc_internal.c

    rc1432d5 r2b5629b  
    255255 
    256256static PyObject * 
     257vlcObject_find_name( PyObject *self, PyObject *args ) 
     258{ 
     259    vlcObject *p_retval; 
     260    vlc_object_t *p_obj; 
     261    char *psz_name; 
     262    int i_object_type; 
     263 
     264    if( !PyArg_ParseTuple( args, "s", &psz_name ) ) 
     265        return NULL; 
     266 
     267    p_obj = vlc_object_find_name( VLCSELF->p_object, psz_name, FIND_ANYWHERE ); 
     268 
     269    if( !p_obj ) 
     270    { 
     271        Py_INCREF( Py_None ); 
     272        return Py_None; 
     273    } 
     274 
     275    p_retval = PyObject_New( vlcObject, &vlcObject_Type ); 
     276 
     277    p_retval->p_object = p_obj; 
     278 
     279    return ( PyObject * )p_retval; 
     280} 
     281 
     282static PyObject * 
    257283vlcObject_info( PyObject *self, PyObject *args ) 
    258284{ 
     
    658684    { "find_id", vlcObject_find_id, METH_VARARGS, 
    659685      "find_id( int ) -> Object      Find an object by id" }, 
     686    { "find_name", vlcObject_find_name, METH_VARARGS, 
     687      "find_name( str ) -> Object      Find an object by name" }, 
    660688    { "info", vlcObject_info, METH_NOARGS, 
    661689       "info( ) -> dict    Return information about the object" },