From d158f6438ef398b5a900b176bbb338190be7d8ad Mon Sep 17 00:00:00 2001 From: Nicholas Piper Date: Wed, 17 May 2006 08:26:11 +0000 Subject: sw_get_playlist() seems to have also (?) become lost. Maybe I've just lost a ability to use cvs ;-) git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1268 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- bindings/python/gpod.i | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bindings/python/gpod.i b/bindings/python/gpod.i index 23d8092..472f9d9 100644 --- a/bindings/python/gpod.i +++ b/bindings/python/gpod.i @@ -69,6 +69,16 @@ PyObject* sw_get_rule(GList *list, gint index) { return SWIG_NewPointerObj((void*)(position->data), SWIGTYPE_p__SPLRule, 0); } +PyObject* sw_get_playlist(GList *list, gint index) { + GList *position; + if ( (index >= g_list_length(list)) || index < 0 ) { + PyErr_SetString(PyExc_IndexError, "Value out of range"); + return NULL; + } + position = g_list_nth(list, index); + return SWIG_NewPointerObj((void*)(position->data), SWIGTYPE_p__Itdb_Playlist, 0); + } + PyObject* sw_get_list_len(GList *list) { return PyInt_FromLong(g_list_length(list)); } @@ -263,6 +273,7 @@ typedef int gint; PyObject* sw_get_tracks(Itdb_iTunesDB *itdb); PyObject* sw_get_track(GList *list, gint index); PyObject* sw_get_rule(GList *list, gint index); +PyObject* sw_get_playlist(GList *list, gint index); PyObject* sw_get_list_len(GList *list); PyObject* sw_get_playlists(Itdb_iTunesDB *itdb); PyObject* sw_get_playlist_tracks(Itdb_Playlist *pl); -- cgit