Finished almost every method of VA interface

parent 279ec824
......@@ -93,8 +93,6 @@ static struct PyMethodDef va_methods[] =
{ "get_listener_parameters", ( PyCFunction ) va_get_listener_parameters, METH_FASTCALL, va_no_doc },
{ "get_listener_hrir", ( PyCFunction ) va_get_listener_hrir, METH_FASTCALL, va_no_doc },
{ "set_listener_hrir", ( PyCFunction ) va_set_listener_hrir, METH_FASTCALL, va_no_doc },
{ "get_active_listener", ( PyCFunction ) va_get_active_listener, METH_FASTCALL, va_no_doc },
{ "set_active_listener", ( PyCFunction ) va_set_active_listener, METH_FASTCALL, va_no_doc },
{ "get_listener_position", ( PyCFunction ) va_get_listener_position, METH_FASTCALL, va_no_doc },
{ "set_listener_position", ( PyCFunction ) va_set_listener_position, METH_FASTCALL, va_no_doc },
{ "get_listener_orientation_vu", ( PyCFunction ) va_get_listener_orientation_vu, METH_FASTCALL, va_no_doc },
......@@ -129,32 +127,32 @@ static struct PyMethodDef va_methods[] =
{ "set_reprodution_module_gain", ( PyCFunction ) va_set_reproduction_module_gain, METH_FASTCALL, va_no_doc },
{ "get_reprodution_module_gain", ( PyCFunction ) va_get_reproduction_module_gain, METH_FASTCALL, va_no_doc },
{ "get_input_gain", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_input_gain", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "is_input_muted", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_input_muted", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_output_gain", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_output_gain", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "is_output_muted", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_output_muted", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_global_auralization_mode", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_global_auralization_mode", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_active_listener", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_active_listener", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_active_listener_explicit_renderer", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_active_listener_explicit_renderer", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_core_clock", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_core_clock", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "substitute_macro", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "find_file_path", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_log_level_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "parse_auralization_mode_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_auralization_mode_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_volume_str_decibel", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "parse_playback_state_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_playback_state_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "parse_playback_action_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_playback_action_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_input_gain", ( PyCFunction )va_get_input_gain, METH_FASTCALL, va_no_doc },
{ "set_input_gain", ( PyCFunction )va_set_input_gain, METH_FASTCALL, va_no_doc },
{ "is_input_muted", ( PyCFunction )va_is_input_muted, METH_FASTCALL, va_no_doc },
{ "set_input_muted", ( PyCFunction )va_set_input_muted, METH_FASTCALL, va_no_doc },
{ "get_output_gain", ( PyCFunction )va_get_output_gain, METH_FASTCALL, va_no_doc },
{ "set_output_gain", ( PyCFunction )va_set_output_gain, METH_FASTCALL, va_no_doc },
{ "is_output_muted", ( PyCFunction )va_is_output_muted, METH_FASTCALL, va_no_doc },
{ "set_output_muted", ( PyCFunction )va_set_output_muted, METH_FASTCALL, va_no_doc },
{ "get_global_auralization_mode", ( PyCFunction ) va_get_global_auralization_mode, METH_FASTCALL, va_no_doc },
{ "set_global_auralization_mode", (PyCFunction)va_set_global_auralization_mode, METH_FASTCALL, va_no_doc },
{ "get_active_listener", (PyCFunction)va_get_active_listener, METH_FASTCALL, va_no_doc },
{ "set_active_listener", (PyCFunction)va_set_active_listener, METH_FASTCALL, va_no_doc },
{ "get_active_listener_explicit_renderer", ( PyCFunction ) va_get_active_listener_explicit_renderer, METH_FASTCALL, va_no_doc },
{ "set_active_listener_explicit_renderer", ( PyCFunction ) va_set_active_listener_explicit_renderer, METH_FASTCALL, va_no_doc },
{ "get_core_clock", ( PyCFunction )va_get_core_clock, METH_FASTCALL, va_no_doc },
{ "set_core_clock", ( PyCFunction )va_set_core_clock, METH_FASTCALL, va_no_doc },
{ "substitute_macro", ( PyCFunction )va_substitute_macro, METH_FASTCALL, va_no_doc },
{ "find_file_path", ( PyCFunction )va_find_file_path, METH_FASTCALL, va_no_doc },
{ "get_log_level_str", ( PyCFunction )va_get_log_level_str, METH_FASTCALL, va_no_doc },
{ "parse_auralization_mode_str", ( PyCFunction )va_parse_auralization_mode_str, METH_FASTCALL, va_no_doc },
{ "get_auralization_mode_str", ( PyCFunction )va_get_auralization_mode_str, METH_FASTCALL, va_no_doc },
{ "get_volume_str_decibel", ( PyCFunction )va_get_volume_str_decibel, METH_FASTCALL, va_no_doc },
{ "parse_playback_state_str", ( PyCFunction )va_parse_playback_state_str, METH_FASTCALL, va_no_doc },
{ "get_playback_state_str", ( PyCFunction )va_get_playback_state_str, METH_FASTCALL, va_no_doc },
{ "parse_playback_action_str", ( PyCFunction )va_parse_playback_action_str, METH_FASTCALL, va_no_doc },
{ "get_playback_action_str", ( PyCFunction )va_get_playback_action_str, METH_FASTCALL, va_no_doc },
{ NULL, NULL }
};
......
......@@ -1105,29 +1105,6 @@ static PyObject* va_set_listener_hrir( PyObject*, PyObject** ppArgs, Py_ssize_t
VAPY_CATCH_RETURN;
};
static PyObject* va_get_active_listener( PyObject*, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
return PyLong_FromLong( g_pVANetClient->GetCoreInstance()->GetActiveListener() );
VAPY_CATCH_RETURN;
};
static PyObject* va_set_active_listener( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "id", "muted", NULL };
static _PyArg_Parser _parser = { "i:set_active_listener", _keywords, 0 };
long iID = -1;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &iID ) )
return NULL;
g_pVANetClient->GetCoreInstance()->SetActiveListener( iID );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_get_listener_position( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
......@@ -1976,3 +1953,357 @@ static PyObject* va_is_reproduction_module_muted( PyObject*, PyObject** ppArgs,
VAPY_CATCH_RETURN;
};
static PyObject* va_get_input_gain(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble(g_pVANetClient->GetCoreInstance()->GetInputGain());
VAPY_CATCH_RETURN;
};
static PyObject* va_set_input_gain(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "gain", NULL };
static _PyArg_Parser _parser = { "d:set_input_gain", _keywords, 0 };
double dGain = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &dGain))
return NULL;
g_pVANetClient->GetCoreInstance()->SetInputGain(dGain);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_set_input_muted(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "muted", NULL };
static _PyArg_Parser _parser = { "|b:set_input_muted", _keywords, 0 };
bool bMuted = true;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &bMuted))
return NULL;
g_pVANetClient->GetCoreInstance()->SetInputMuted( bMuted);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_is_input_muted(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyBool_FromLong(g_pVANetClient->GetCoreInstance()->IsInputMuted());
VAPY_CATCH_RETURN;
};
static PyObject* va_get_output_gain(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble(g_pVANetClient->GetCoreInstance()->GetInputGain());
VAPY_CATCH_RETURN;
};
static PyObject* va_set_output_gain(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "gain", NULL };
static _PyArg_Parser _parser = { "d:set_output_gain", _keywords, 0 };
double dGain = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &dGain))
return NULL;
g_pVANetClient->GetCoreInstance()->SetInputGain(dGain);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_set_output_muted(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "muted", NULL };
static _PyArg_Parser _parser = { "|b:set_output_muted", _keywords, 0 };
bool bMuted = true;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &bMuted))
return NULL;
g_pVANetClient->GetCoreInstance()->SetInputMuted(bMuted);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_is_output_muted(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyBool_FromLong(g_pVANetClient->GetCoreInstance()->IsInputMuted());
VAPY_CATCH_RETURN;
};
static PyObject* va_get_global_auralization_mode(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyLong_FromLong(g_pVANetClient->GetCoreInstance()->GetGlobalAuralizationMode());
VAPY_CATCH_RETURN;
};
static PyObject* va_set_global_auralization_mode(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "auralization_mode", NULL };
static _PyArg_Parser _parser = { "i:set_global_auralization_mode", _keywords, 0 };
long iAM = true;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iAM))
return NULL;
g_pVANetClient->GetCoreInstance()->SetGlobalAuralizationMode(iAM);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_get_active_listener(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyLong_FromLong(g_pVANetClient->GetCoreInstance()->GetActiveListener());
VAPY_CATCH_RETURN;
};
static PyObject* va_set_active_listener(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "id", NULL };
static _PyArg_Parser _parser = { "i:set_active_listener", _keywords, 0 };
long iID = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iID))
return NULL;
g_pVANetClient->GetCoreInstance()->SetActiveListener(iID);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_get_active_listener_explicit_renderer(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "id", NULL };
static _PyArg_Parser _parser = { "s:is_reproduction_module_muted", _keywords, 0 };
char* pcID = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &pcID))
return NULL;
std::string sID = pcID ? std::string(pcID) : "";
return PyLong_FromLong(g_pVANetClient->GetCoreInstance()->GetActiveListenerExplicitRenderer( sID ));
VAPY_CATCH_RETURN;
};
static PyObject* va_set_active_listener_explicit_renderer(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "id", "renderer", NULL };
static _PyArg_Parser _parser = { "is:set_active_listener_explicit_renderer", _keywords, 0 };
long iID = -1;
char* pcID = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iID, &pcID))
return NULL;
std::string sID = pcID ? std::string(pcID) : "";
g_pVANetClient->GetCoreInstance()->SetActiveListenerExplicitRenderer(iID, sID);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_get_core_clock(PyObject*, PyObject*)
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble( g_pVANetClient->GetCoreInstance()->GetCoreClock() );
VAPY_CATCH_RETURN;
};
static PyObject* va_set_core_clock(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "time", NULL };
static _PyArg_Parser _parser = { "d:set_core_clock", _keywords, 0 };
double dTime = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &dTime))
return NULL;
g_pVANetClient->GetCoreInstance()->SetCoreClock(dTime);
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* va_substitute_macro(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "rawstring", NULL };
static _PyArg_Parser _parser = { "s:substitute_macro", _keywords, 0 };
char* pcRawString = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &pcRawString))
return NULL;
std::string sSubstitutedString = g_pVANetClient->GetCoreInstance()->SubstituteMacros(std::string(pcRawString));
return PyUnicode_FromString( SaveStringToUnicodeConversion( sSubstitutedString).c_str() );
VAPY_CATCH_RETURN;
};
static PyObject* va_find_file_path(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "rawpath", NULL };
static _PyArg_Parser _parser = { "s:find_file_path", _keywords, 0 };
char* pcRawFilePath = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &pcRawFilePath))
return NULL;
std::string sSubstitutedPath = g_pVANetClient->GetCoreInstance()->FindFilePath(std::string(pcRawFilePath));
return PyUnicode_FromString(SaveStringToUnicodeConversion(sSubstitutedPath).c_str());
VAPY_CATCH_RETURN;
};
static PyObject* va_get_log_level_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "loglevel", NULL };
static _PyArg_Parser _parser = { "i:get_log_level_str", _keywords, 0 };
int iLogLevel = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iLogLevel))
return NULL;
std::string sLogLevel = g_pVANetClient->GetCoreInstance()->GetLogLevelStr(iLogLevel);
return PyUnicode_FromString(SaveStringToUnicodeConversion(sLogLevel).c_str());
VAPY_CATCH_RETURN;
};
static PyObject* va_parse_auralization_mode_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "auralization_mode_string", NULL };
static _PyArg_Parser _parser = { "s:parse_auralization_mode_str", _keywords, 0 };
char* pcAM = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &pcAM))
return NULL;
int iAM = g_pVANetClient->GetCoreInstance()->ParseAuralizationModeStr(std::string(pcAM));
return PyLong_FromLong(iAM);
VAPY_CATCH_RETURN;
};
static PyObject* va_get_auralization_mode_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "auralization_mode", NULL };
static _PyArg_Parser _parser = { "i:get_auralization_mode_str", _keywords, 0 };
int iAM = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iAM))
return NULL;
std::string sAM = g_pVANetClient->GetCoreInstance()->GetAuralizationModeStr(iAM);
return PyUnicode_FromString(SaveStringToUnicodeConversion(sAM).c_str());
VAPY_CATCH_RETURN;
};
static PyObject* va_get_volume_str_decibel(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "gain", NULL };
static _PyArg_Parser _parser = { "d:get_volume_str_decibel", _keywords, 0 };
double dGain = -1.0f;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &dGain))
return NULL;
std::string sGainDB = g_pVANetClient->GetCoreInstance()->GetVolumeStrDecibel(dGain);
return PyUnicode_FromString(SaveStringToUnicodeConversion(sGainDB).c_str());
VAPY_CATCH_RETURN;
};
static PyObject* va_parse_playback_state_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "state_string", NULL };
static _PyArg_Parser _parser = { "s:parse_playback_state_str", _keywords, 0 };
char* pcState = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &pcState))
return NULL;
int iState = g_pVANetClient->GetCoreInstance()->ParsePlaybackState(std::string(pcState));
return PyLong_FromLong(iState);
VAPY_CATCH_RETURN;
};
static PyObject* va_parse_playback_action_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "action_string", NULL };
static _PyArg_Parser _parser = { "s:parse_playback_action_str", _keywords, 0 };
char* pcAction = nullptr;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &pcAction))
return NULL;
int iState = g_pVANetClient->GetCoreInstance()->ParsePlaybackState(std::string(pcAction));
return PyLong_FromLong(iState);
VAPY_CATCH_RETURN;
};
static PyObject* va_get_playback_state_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "state", NULL };
static _PyArg_Parser _parser = { "i:get_playback_state_str", _keywords, 0 };
int iState = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iState))
return NULL;
std::string sState = g_pVANetClient->GetCoreInstance()->GetPlaybackStateStr(iState);
return PyUnicode_FromString(SaveStringToUnicodeConversion(sState).c_str());
VAPY_CATCH_RETURN;
};
static PyObject* va_get_playback_action_str(PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "state", NULL };
static _PyArg_Parser _parser = { "i:get_playback_action_str", _keywords, 0 };
int iAction = -1;
if (!_PyArg_ParseStack(ppArgs, nArgs, pKeywordNames, &_parser, &iAction))
return NULL;
std::string sAction = g_pVANetClient->GetCoreInstance()->GetPlaybackActionStr(iAction);
return PyUnicode_FromString(SaveStringToUnicodeConversion(sAction).c_str());
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