/* gcompris - py-mod-sound.c * * Copyright (C) 2003, 2008 Olivier Samyn * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #include #define NO_IMPORT_PYGOBJECT 1 #include #include #include "gcompris/gcompris.h" #include "py-mod-sound.h" #include "py-gcompris-board.h" /* All functions provided by this python module * wraps a gcompris function. Each "py_*" function wraps the * "*" C function. */ /*void gc_sound_play_ogg_list( GList* files ); */ static PyObject* py_gc_sound_play_ogg_list(PyObject* self, PyObject* args) { GList* list; PyObject* pylist; /* Parse arguments */ if(!PyArg_ParseTuple(args, "O:gc_sound_play_ogg_list", &pylist)) return NULL; list = (GList*) pygobject_get(pylist); /* Call the corresponding C function */ gc_sound_play_ogg_list(list); /* Create and return the result */ Py_INCREF(Py_None); return Py_None; } /* void gc_sound_play_ogg(char *, ...); The method: gc_sound_play_ogg_list( GList* ) is used to perform the core call. (Because there's no way to construct a variable argument function call. */ static PyObject* py_gc_sound_play_ogg(PyObject* self, PyObject* args) { PyObject* item; GList* list = NULL; int i, length; /* Parse arguments */ length = PyTuple_Size(args); if(length<1) return NULL; for(i=0; i