Exemplo n.º 1
0
Arquivo: xine.c Projeto: clones/kaa
PyObject *
Xine_PyObject_list_plugins(Xine_PyObject *self, PyObject *args, PyObject *kwargs)
{
    char *type;
    const char *const *list;
    PyObject *pylist = NULL;
    int i, post_types = -1;

    if (!PyArg_ParseTuple(args, "s|i", &type, &post_types))
        return NULL;
    if (!strcmp(type, "video"))
        list = xine_list_video_output_plugins(self->xine);
    else if (!strcmp(type, "audio"))
        list = xine_list_audio_output_plugins(self->xine);
    else if (!strcmp(type, "demuxer"))
        list = xine_list_demuxer_plugins(self->xine);
    else if (!strcmp(type, "input"))
        list = xine_list_input_plugins(self->xine);
    else if (!strcmp(type, "spu"))
        list = xine_list_spu_plugins(self->xine);
    else if (!strcmp(type, "audio_decoder"))
        list = xine_list_audio_decoder_plugins(self->xine);
    else if (!strcmp(type, "video_decoder"))
        list = xine_list_video_decoder_plugins(self->xine);
    else if (!strcmp(type, "post")) {
        if (post_types == -1)
            list = xine_list_post_plugins(self->xine);
        else
            list = xine_list_post_plugins_typed(self->xine, post_types);
    }
    else {
        PyErr_Format(xine_error, "Unknown plugin type: %s", type);
        return NULL;
    }

    pylist = PyList_New(0);
    for (i = 0; list[i] != 0; i++) {
        PyObject *str = PyString_FromString(list[i]);
        PyList_Append(pylist, str);
        Py_DECREF(str);
    }
    return pylist;
}
Exemplo n.º 2
0
void SjPlayer::DoGetLittleOptions(SjArrayLittleOption& lo)
{
	if( !m_impl->InitXine() ) {
		return; // error
	}

	wxString options = wxT("auto|") + wxString(_("Default")), currOption;
	const char* const* pl = xine_list_audio_output_plugins(m_impl->m_xine);
	if( pl ) {
		while( *pl ) {
			currOption = wxString(*pl, wxConvUTF8);
			if( !currOption.IsEmpty() ) {
				options += wxT("|") + currOption +  wxT("|") + currOption;
			}
			pl++;
		}
	}
	lo.Add(new SjLittleReplayEnum( _("Device"), options,
						&m_impl->m_iniDevice, wxT("auto"), wxT("xine/device"), SJ_ICON_MODULE));
}