8 static PyObject *vlc_create(PyObject *self, PyObject *args)
13 return Py_BuildValue("i", iRc);
17 static PyObject *vlc_init(PyObject *self, PyObject *args)
20 char *pArgv[] = { "vlc", "--sout", NULL };
23 if (!PyArg_ParseTuple(args, "is", &iVlc, &pArgv[2]))
25 iRc = VLC_Init(iVlc, 3, pArgv);
26 return Py_BuildValue("i", iRc);
30 static PyObject *vlc_addTarget(PyObject *self, PyObject *args)
36 if (!PyArg_ParseTuple(args, "is", &iVlc, &file))
38 iRc = VLC_AddTarget(iVlc, file, 0, 0, PLAYLIST_APPEND, PLAYLIST_END);
39 return Py_BuildValue("i", iRc);
43 static PyObject *vlc_play(PyObject *self, PyObject *args)
48 if (!PyArg_ParseTuple(args, "i", &iVlc))
51 return Py_BuildValue("i", iRc);
55 static PyObject *vlc_stop(PyObject *self, PyObject *args)
60 if (!PyArg_ParseTuple(args, "i", &iVlc))
62 iRc = VLC_CleanUp(iVlc);
63 return Py_BuildValue("i", iRc);
67 static PyObject *vlc_pause(PyObject *self, PyObject *args)
72 if (!PyArg_ParseTuple(args, "i", &iVlc))
74 iRc = VLC_Pause(iVlc);
75 return Py_BuildValue("i", iRc);
79 static PyMethodDef VlcMethods[] = {
80 {"create", vlc_create, METH_VARARGS, _("Create a vlc thread.")},
81 {"init", vlc_init, METH_VARARGS, _("Initialize a vlc thread.")},
82 {"addTarget", vlc_addTarget, METH_VARARGS, _("Add a target in the playlist.")},
83 {"play", vlc_play, METH_VARARGS, _("Play")},
84 {"stop", vlc_stop, METH_VARARGS, _("Stop")},
85 {"pause", vlc_pause, METH_VARARGS, _("Pause")},
86 {NULL, NULL, 0, NULL} /* Sentinel */
92 Py_InitModule("vlc", VlcMethods);