diff options
| author | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2005-09-23 03:00:27 +0000 |
|---|---|---|
| committer | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2005-09-23 03:00:27 +0000 |
| commit | 52c8604edf6a7cc3ba15658b648c797a24bd60f3 (patch) | |
| tree | d592aa23cee73677bd17a1c33c4a2f0d931be45a /bindings/python/gpod.i | |
| parent | 32fdf71f74fee4e0774d7ae5167447c70cd83b7c (diff) | |
| download | libgpod-52c8604edf6a7cc3ba15658b648c797a24bd60f3.tar.gz libgpod-52c8604edf6a7cc3ba15658b648c797a24bd60f3.tar.xz libgpod-52c8604edf6a7cc3ba15658b648c797a24bd60f3.zip | |
* added python bindings provided by Nicholas Piper
<nick at nickpiper co uk>
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1099 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python/gpod.i')
| -rw-r--r-- | bindings/python/gpod.i | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bindings/python/gpod.i b/bindings/python/gpod.i new file mode 100644 index 0000000..7bfab55 --- /dev/null +++ b/bindings/python/gpod.i @@ -0,0 +1,40 @@ +/* File : gpod.i */ +%module gpod +%{ +#include "../../src/db-artwork-debug.h" +#include "../../src/db-artwork-parser.h" +#include "../../src/db-image-parser.h" +#include "../../src/db-itunes-parser.h" +#include "../../src/db-parse-context.h" +#include "../../src/itdb.h" +#include "../../src/itdb_private.h" + +PyObject* sw_get_tracks(Itdb_iTunesDB *itdb) { + PyObject *list; + gint i; + GList *l; + list = PyList_New(g_list_length(itdb->tracks)); + for (l = itdb->tracks, i = 0; l; l = l->next, ++i) { + PyList_SET_ITEM(list, i, SWIG_NewPointerObj((void*)(l->data), SWIGTYPE_p_Itdb_Track, 0)); + } + return list; + } + +PyObject* sw_get_playlists(Itdb_iTunesDB *itdb) { + PyObject *list; + gint i; + GList *l; + list = PyList_New(g_list_length(itdb->playlists)); + for (l = itdb->playlists, i = 0; l; l = l->next, ++i) { + PyList_SET_ITEM(list, i, SWIG_NewPointerObj((void*)(l->data), SWIGTYPE_p_Itdb_Playlist, 0)); + } + return list; + } +%} + +typedef char gchar; +typedef int gboolean; + +PyObject* sw_get_tracks(Itdb_iTunesDB *itdb); +PyObject* sw_get_playlists(Itdb_iTunesDB *itdb); +%include "../../src/itdb.h" |
