]> git.sesse.net Git - vlc/blobdiff - python/vlcmodule.c
* modules/gui/macosx/intf.*: made the Services-menu translatable
[vlc] / python / vlcmodule.c
index 87494112b7e76432db11caa367985e121dee4b2b..6576bc1fbfb41d3099cdfbda2b2547fd05cdd10e 100644 (file)
@@ -17,15 +17,25 @@ static PyObject *vlc_create(PyObject *self, PyObject *args)
 static PyObject *vlc_init(PyObject *self, PyObject *args)
 {
     int iVlc;
-    char *file;
     char *pArgv[] = { "vlc", "--sout", NULL };
     int iRc;
 
-    if (!PyArg_ParseTuple(args, "iss", &iVlc, &file, &pArgv[2]))
+    if (!PyArg_ParseTuple(args, "is", &iVlc, &pArgv[2]))
         return NULL;
     iRc = VLC_Init(iVlc, 3, pArgv);
-    if (iRc >= 0)
-        iRc = VLC_AddTarget(iVlc, file, PLAYLIST_APPEND, PLAYLIST_END);
+    return Py_BuildValue("i", iRc);
+}
+
+
+static PyObject *vlc_addTarget(PyObject *self, PyObject *args)
+{
+    int iVlc;
+    char *file;
+    int iRc;
+
+    if (!PyArg_ParseTuple(args, "is", &iVlc, &file))
+        return NULL;
+    iRc = VLC_AddTarget(iVlc, file, 0, 0, PLAYLIST_APPEND, PLAYLIST_END);
     return Py_BuildValue("i", iRc);
 }
 
@@ -67,11 +77,12 @@ static PyObject *vlc_pause(PyObject *self, PyObject *args)
 
 
 static PyMethodDef VlcMethods[] = {
-    {"create", vlc_create, METH_VARARGS, "Create a vlc thread."},
-    {"init", vlc_init, METH_VARARGS, "Initialize a vlc thread."},
-    {"play", vlc_play, METH_VARARGS, "Play"},
-    {"stop", vlc_stop, METH_VARARGS, "Stop"},
-    {"pause", vlc_pause, METH_VARARGS, "Pause"},
+    {"create", vlc_create, METH_VARARGS, _("Create a vlc thread.")},
+    {"init", vlc_init, METH_VARARGS, _("Initialize a vlc thread.")},
+    {"addTarget", vlc_addTarget, METH_VARARGS, _("Add a target in the playlist.")},
+    {"play", vlc_play, METH_VARARGS, _("Play")},
+    {"stop", vlc_stop, METH_VARARGS, _("Stop")},
+    {"pause", vlc_pause, METH_VARARGS, _("Pause")},
     {NULL, NULL, 0, NULL}        /* Sentinel */
 };