Fixing bugs and improving Python binding and jupyter examples

parent 397181d0
This diff is collapsed.
......@@ -129,7 +129,9 @@ static struct PyMethodDef va_methods[] =
{ "set_homogeneous_medium_parameters", ( PyCFunction ) set_homogeneous_medium_parameters, METH_FASTCALL, no_doc },
{ "create_acoustic_material", ( PyCFunction ) create_acoustic_material, METH_FASTCALL, no_doc },
{ "create_acoustic_material_from_file", ( PyCFunction ) create_acoustic_material_from_file, METH_FASTCALL, no_doc },
{ "create_acoustic_material_from_parameters", ( PyCFunction ) create_acoustic_material_from_parameters, METH_FASTCALL, no_doc },
{ "get_acoustic_material_infos", ( PyCFunction ) get_acoustic_material_infos, METH_FASTCALL, no_doc },
......@@ -143,13 +145,13 @@ static struct PyMethodDef va_methods[] =
{ "get_rendering_module_parameters", ( PyCFunction ) get_rendering_module_parameters, METH_FASTCALL, no_doc },
{ "set_rendering_module_parameters", ( PyCFunction ) set_rendering_module_parameters, METH_FASTCALL, no_doc },
{ "get_reprodution_modules", ( PyCFunction ) get_reproduction_modules, METH_FASTCALL, no_doc },
{ "set_reprodution_module_muted", ( PyCFunction ) set_reproduction_module_muted, METH_FASTCALL, no_doc },
{ "get_reprodution_module_muted", ( PyCFunction ) get_reproduction_module_muted, METH_FASTCALL, no_doc },
{ "set_reprodution_module_gain", ( PyCFunction ) set_reproduction_module_gain, METH_FASTCALL, no_doc },
{ "get_reprodution_module_gain", ( PyCFunction ) get_reproduction_module_gain, METH_FASTCALL, no_doc },
{ "get_reproduction_modules", ( PyCFunction ) get_reproduction_modules, METH_FASTCALL, no_doc },
{ "set_reproduction_module_muted", ( PyCFunction ) set_reproduction_module_muted, METH_FASTCALL, no_doc },
{ "get_reproduction_module_muted", ( PyCFunction ) get_reproduction_module_muted, METH_FASTCALL, no_doc },
{ "set_reproduction_module_gain", ( PyCFunction ) set_reproduction_module_gain, METH_FASTCALL, no_doc },
{ "get_reproduction_module_gain", ( PyCFunction ) get_reproduction_module_gain, METH_FASTCALL, no_doc },
{ "get_reproduction_module_parameters", ( PyCFunction ) get_reproduction_module_parameters, METH_FASTCALL, no_doc },
{ "set_reproduction_parameters", ( PyCFunction ) set_reproduction_module_parameters, METH_FASTCALL, no_doc },
{ "set_reproduction_module_parameters", ( PyCFunction ) set_reproduction_module_parameters, METH_FASTCALL, no_doc },
{ "lock_update", ( PyCFunction ) lock_update, METH_FASTCALL, no_doc },
......
......@@ -216,7 +216,8 @@ CVAStruct ConvertPythonDictToVAStruct( PyObject* pInDict )
CVAAcousticMaterial ConvertPythonDictToAcousticMaterial( PyObject* pMaterial )
{
CVAAcousticMaterial oMaterial;
oMaterial.
VA_EXCEPT_NOT_IMPLEMENTED;
return oMaterial;
}
......@@ -1935,7 +1936,7 @@ static PyObject* get_homogeneous_medium_parameters( PyObject*, PyObject** ppArgs
static const char * const _keywords[] = { "arguments", NULL };
static _PyArg_Parser _parser = { "|O!:get_homogeneous_medium_parameters", _keywords, 0 };
PyObject* pParamArgs = nullptr;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, pParamArgs ) )
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pParamArgs ) )
return NULL;
CVAStruct oArgs = ConvertPythonDictToVAStruct( pParamArgs );
......@@ -2061,7 +2062,7 @@ static PyObject* get_rendering_modules( PyObject*, PyObject* )
for( size_t i = 0; i < voInfos.size(); i++ )
{
CVAAudioRendererInfo& oInfo( voInfos[ i ] );
PyObject* pInfo = Py_BuildValue( "{s:b,s:s,s:s,s:s,s:s,s:b,s:b,s:O!}",
PyObject* pInfo = Py_BuildValue( "{s:b,s:s,s:s,s:s,s:s,s:b,s:b,s:O}",
"enabled", oInfo.bEnabled,
"class", SaveStringToUnicodeConversion( oInfo.sClass ).c_str(),
"description", SaveStringToUnicodeConversion( oInfo.sDescription ).c_str(),
......@@ -2163,7 +2164,7 @@ static PyObject* get_rendering_module_parameters( PyObject*, PyObject** ppArgs,
static _PyArg_Parser _parser = { "s|O!:get_rendering_module_parameters", _keywords, 0 };
char* pcID = nullptr;
PyObject* pArgs = NULL;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pcID, pArgs ) )
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pcID, &pArgs ) )
return NULL;
std::string sID = pcID ? std::string( pcID ) : "";
......@@ -2453,11 +2454,18 @@ static PyObject* get_output_muted( PyObject*, PyObject* )
VAPY_CATCH_RETURN;
};
static PyObject* get_global_auralization_mode( PyObject*, PyObject* )
static PyObject* get_global_auralization_mode( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "short_mode", NULL };
static _PyArg_Parser _parser = { "|b:get_global_auralization_mode", _keywords, 0 };
bool bShortMode = true;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &bShortMode ) )
return NULL;
const int iAM = g_pVANetClient->GetCoreInstance()->GetGlobalAuralizationMode();
const std::string sAM = SaveStringToUnicodeConversion( IVAInterface::GetAuralizationModeStr( iAM ) );
const std::string sAM = SaveStringToUnicodeConversion( IVAInterface::GetAuralizationModeStr( iAM, bShortMode ) );
return PyUnicode_FromString( sAM.c_str() );
......
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