Commit dca53b33 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding signal source prototype from parameters creation call

parent 7f3bfe1c
......@@ -40,7 +40,8 @@ static struct PyMethodDef va_methods[] =
{ "get_directivity_info", ( PyCFunction ) get_directivity_info, METH_FASTCALL, no_doc },
{ "get_directivity_infos", ( PyCFunction ) get_directivity_infos, METH_FASTCALL, no_doc },
{ "create_signal_source_buffer_from_file", ( PyCFunction ) create_signal_source_buffer_from_file, METH_FASTCALL, no_doc },
{ "create_signal_source_buffer_from_file", (PyCFunction)create_signal_source_buffer_from_file, METH_FASTCALL, no_doc },
{ "create_signal_source_prototype_from_parameters", (PyCFunction)create_signal_source_prototype_from_parameters, METH_FASTCALL, no_doc },
{ "create_signal_source_text_to_speech", ( PyCFunction ) create_signal_source_text_to_speech, METH_FASTCALL, no_doc },
{ "create_signal_source_sequencer", ( PyCFunction ) create_signal_source_sequencer, METH_FASTCALL, no_doc },
{ "create_signal_source_network_stream", ( PyCFunction ) create_signal_source_network_stream, METH_FASTCALL, no_doc },
......
......@@ -11,7 +11,7 @@
* --------------------------------------------------------------------------------------------
*/
#include <Python.h>
#include <Python.h>
#include <VA.h>
#include <VANet.h>
......@@ -331,7 +331,7 @@ static PyObject* call_module( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, Py
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pcModuleName, &PyDict_Type, &pArgumentsDict ) )
return NULL;
std::string sModuleName = pcModuleName? std::string( pcModuleName ) : "";
std::string sModuleName = pcModuleName ? std::string( pcModuleName ) : "";
CVAStruct oInArgs = ConvertPythonDictToVAStruct( pArgumentsDict );
CVAStruct oOutArgs = g_pVANetClient->GetCoreInstance()->CallModule( sModuleName, oInArgs );
......@@ -471,7 +471,7 @@ static PyObject* get_sound_source_ids( PyObject*, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
std::vector< int > viIDs;
g_pVANetClient->GetCoreInstance()->GetSoundSourceIDs( viIDs );
g_pVANetClient->GetCoreInstance()->GetSoundSourceIDs( viIDs );
return ConvertIntVectorToPythonList( viIDs );
VAPY_CATCH_RETURN;
};
......@@ -636,7 +636,7 @@ static PyObject* get_sound_source_auralization_mode( PyObject*, PyObject** ppArg
const int iAM = g_pVANetClient->GetCoreInstance()->GetSoundSourceAuralizationMode( iID );
const std::string sAM = SaveStringToUnicodeConversion( IVAInterface::GetAuralizationModeStr( iAM, bShortMode ) );
return PyUnicode_FromString( sAM.c_str() );
VAPY_CATCH_RETURN;
......@@ -1264,6 +1264,25 @@ static PyObject* create_signal_source_buffer_from_file( PyObject*, PyObject** pp
VAPY_CATCH_RETURN;
};
static PyObject* create_signal_source_prototype_from_parameters( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "parameters", "name", NULL };
static _PyArg_Parser _parser = { "O!|s:create_signal_source_prototype_from_parameters", _keywords, 0 };
PyObject* pParameters = nullptr;
char* pcName = nullptr;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pParameters, &pcName ) )
return NULL;
CVAStruct oParameters = ConvertPythonDictToVAStruct( pParameters );
std::string sName = pcName ? std::string( pcName ) : "";
auto sID = g_pVANetClient->GetCoreInstance()->CreateSignalSourcePrototypeFromParameters( oParameters, sName );
return PyUnicode_FromString( SaveStringToUnicodeConversion( sID ).c_str() );
VAPY_CATCH_RETURN;
};
static PyObject* create_signal_source_text_to_speech( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
......@@ -1326,7 +1345,7 @@ static PyObject* create_signal_source_engine( PyObject*, PyObject** ppArgs, Py_s
static _PyArg_Parser _parser = { "O!|s:create_signal_source_engine", _keywords, 0 };
PyObject* pParameters = nullptr;
char* pcName = nullptr;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pParameters ,&pcName ) )
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pParameters, &pcName ) )
return NULL;
std::string sName = pcName ? std::string( pcName ) : "";
......@@ -1715,7 +1734,7 @@ static PyObject* get_signal_source_parameters( PyObject*, PyObject** ppArgs, Py_
std::string sSignalSource = pcSignalSource ? std::string( pcSignalSource ) : "";
CVAStruct oParameters = ConvertPythonDictToVAStruct( pParameters );
CVAStruct oReturn = g_pVANetClient->GetCoreInstance()->GetSignalSourceParameters( sSignalSource, oParameters );
return ConvertVAStructToPythonDict( oReturn );;
return ConvertVAStructToPythonDict( oReturn );
VAPY_CATCH_RETURN;
};
......@@ -2159,7 +2178,7 @@ static PyObject* set_rendering_module_auralization_mode( PyObject*, PyObject** p
std::string sID = pcID ? std::string( pcID ) : "";
const std::string sAM = pcAM ? std::string( pcAM ) : "";
const int iCurrentAM = g_pVANetClient->GetCoreInstance()->GetRenderingModuleAuralizationMode( sID );
const int iAM = IVAInterface::ParseAuralizationModeStr( sAM, iCurrentAM );
g_pVANetClient->GetCoreInstance()->SetRenderingModuleAuralizationMode( sID, iAM );
......@@ -2496,7 +2515,7 @@ static PyObject* set_global_auralization_mode( PyObject*, PyObject** ppArgs, Py_
return NULL;
std::string sAM = pcAM ? std::string( pcAM ) : "";
const int iCurrentAM = g_pVANetClient->GetCoreInstance()->GetGlobalAuralizationMode();
const int iAM = IVAInterface::ParseAuralizationModeStr( sAM, iCurrentAM );
g_pVANetClient->GetCoreInstance()->SetGlobalAuralizationMode( iAM );
......
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