Commit 30621cd0 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

-Started changing to new method parser of python(WIP)

parent 307e2d0e
......@@ -69,7 +69,7 @@ static struct PyMethodDef va_methods[] =
{ "get_signal_source_parameters", ( PyCFunction ) get_signal_source_parameters, METH_FASTCALL, no_doc },
{ "get_sound_source_ids", ( PyCFunction ) get_sound_source_ids, METH_FASTCALL, no_doc },
{ "create_sound_source", ( PyCFunction ) create_sound_source, METH_FASTCALL, no_doc },
{ "create_sound_source", ( PyCFunction ) create_sound_source, METH_VARARGS | METH_KEYWORDS, no_doc },
{ "create_sound_source_explicit_renderer", ( PyCFunction ) create_sound_source_explicit_renderer, METH_FASTCALL, no_doc },
{ "delete_sound_source", ( PyCFunction ) delete_sound_source, METH_FASTCALL, no_doc },
{ "set_sound_source_enabled", ( PyCFunction ) set_sound_source_enabled, METH_FASTCALL, no_doc },
......
......@@ -476,19 +476,34 @@ static PyObject* get_sound_source_ids( PyObject*, PyObject* )
VAPY_CATCH_RETURN;
};
static PyObject* create_sound_source( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "name", NULL };
static _PyArg_Parser _parser = { "s:create_sound_source", _keywords, 0 };
//static PyObject* create_sound_source( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
//{
// VAPY_REQUIRE_CONN_TRY;
//
// static const char * const _keywords[] = { "name", NULL };
// static _PyArg_Parser _parser = { "s:create_sound_source", _keywords, 0 };
// char* pcName = nullptr;
// if( !_PyArg_ParseStackAndKeywords( ppArgs, nArgs, pKeywordNames, &_parser, &pcName ) )
// return NULL;
//
// std::string sName = pcName ? std::string( pcName ) : "PySoundSource";
// return PyLong_FromLong( g_pVANetClient->GetCoreInstance()->CreateSoundSource( sName ) );
//
// VAPY_CATCH_RETURN;
//};
static PyObject* create_sound_source(PyObject*, PyObject* pArgs, PyObject* pKeywordTuple)
{
VAPY_REQUIRE_CONN_TRY;
static char* pKeyWordList[] = { "name", NULL };
const char* sDataTypes = "s";
char* pcName = nullptr;
if( !_PyArg_ParseStackAndKeywords( ppArgs, nArgs, pKeywordNames, &_parser, &pcName ) )
return NULL;
std::string sName = pcName ? std::string( pcName ) : "PySoundSource";
return PyLong_FromLong( g_pVANetClient->GetCoreInstance()->CreateSoundSource( sName ) );
if (!PyArg_ParseTupleAndKeywords(pArgs, pKeywordTuple, sDataTypes, pKeyWordList, &pcName))
return NULL;
std::string sName = pcName ? std::string(pcName) : "PySoundSource";
return PyLong_FromLong(g_pVANetClient->GetCoreInstance()->CreateSoundSource(sName));
VAPY_CATCH_RETURN;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment