Adding more methods

parent 5301135d
......@@ -1533,8 +1533,6 @@ void set_sound_source_auralization_mode( int nlhs, mxArray *plhs[], int nrhs, co
pConnection->pCoreInterface->SetSoundSourceAuralizationMode( iSoundSourceID, iNewAuralizationMode );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_source_parameters, "Returns the current sound source parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_source_parameters, ID, "integer-1x1", "Sound source identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_source_parameters, args, "mstruct", "Requested parameters" );
......@@ -1552,8 +1550,6 @@ void get_sound_source_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxA
plhs[ 0 ] = matlabCreateStruct( oRet );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_source_parameters, "Sets sound source parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_source_parameters, ID, "integer-1x1", "Sound source identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_source_parameters, params, "mstruct", "Parameters" );
......@@ -1569,8 +1565,6 @@ void set_sound_source_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxA
pConnection->pCoreInterface->SetSoundSourceParameters( iID, oParams );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_sound_source_directivity, "Returns the directivity of a sound source", "Note: If the sound source is not assigned a directivity, the methods returns -1." );
DECLARE_FUNCTION_REQUIRED_INARG( get_sound_source_directivity, soundSourceID, "integer-1x1", "Sound source ID" );
DECLARE_FUNCTION_OUTARG( get_sound_source_directivity, directivityID, "integer-1x1", "Directivity ID" );
......@@ -1665,7 +1659,6 @@ void get_sound_source_muted( int nlhs, mxArray *plhs[], int nrhs, const mxArray
plhs[ 0 ] = mxCreateLogicalScalar( bResult );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( set_sound_source_muted, "Sets a sound source muted or unmuted", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_source_muted, soundSourceID, "integer-1x1", "Sound source ID" );
......@@ -2500,6 +2493,177 @@ void set_homogeneous_medium_shift_parameters( int nlhs, mxArray *plhs[], int nrh
}
// Material
REGISTER_PUBLIC_FUNCTION( create_acoustic_material_from_file, "Create acoustic material", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_acoustic_material_from_file, file_path, "string", "Material file path" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_acoustic_material_from_file, material_name, "string", "Material name", "" );
DECLARE_FUNCTION_OUTARG( create_acoustic_material_from_file, material_id, "double-1x1", "Material identifier" );
void create_acoustic_material_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
std::string sFilePath = matlabGetString( prhs[ 1 ], "file_path" );
std::string sName = matlabGetString( prhs[ 2 ], "material_name" );
const int iID = pConnection->pCoreInterface->CreateAcousticMaterialFromFile( sFilePath, sName );
plhs[ 0 ] = mxCreateDoubleScalar( iID );
}
REGISTER_PUBLIC_FUNCTION( delete_acoustic_material, "Delete acoustic material", "" );
DECLARE_FUNCTION_REQUIRED_INARG( delete_acoustic_material, material_id, "double-1x1", "Material identifier" );
DECLARE_FUNCTION_OUTARG( delete_acoustic_material, success_flag, "logical-1x1", "Removal success" );
void delete_acoustic_material( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "material_id" );
const bool bSuccess = pConnection->pCoreInterface->DeleteAcousticMaterial( iID );
plhs[ 0 ] = mxCreateLogicalScalar( bSuccess );
}
REGISTER_PUBLIC_FUNCTION( get_acoustic_magerial_parameters, "Acoustic material parameter getter", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_acoustic_magerial_parameters, material_id, "integer-1x1", "Acoustic material identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( get_acoustic_magerial_parameters, args, "mstruct", "Requested parameters" );
DECLARE_FUNCTION_OUTARG( get_acoustic_magerial_parameters, params, "mstruct", "Parameters" );
void get_acoustic_magerial_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "material_id" );
CVAStruct oArgs = matlabGetStruct( prhs[ 2 ], "args" );
CVAStruct oRet = pConnection->pCoreInterface->GetAcousticMaterialParameters( iID, oArgs );
plhs[ 0 ] = matlabCreateStruct( oRet );
}
REGISTER_PUBLIC_FUNCTION( set_acoustic_magerial_parameters, "Acoustic material parameter setter", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_acoustic_magerial_parameters, material_id, "integer-1x1", "Acoustic material identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( set_acoustic_magerial_parameters, params, "mstruct", "Parameters" );
void set_acoustic_magerial_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "material_id" );
CVAStruct oParams = matlabGetStruct( prhs[ 2 ], "params" );
pConnection->pCoreInterface->SetAcousticMaterialParameters( iID, oParams );
}
// Geometry
REGISTER_PUBLIC_FUNCTION( create_geometry_mesh_from_file, "Create geometry mesh from file", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_geometry_mesh_from_file, file_path, "string", "Geometry mesh file path" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_geometry_mesh_from_file, geo_mesh_name, "string", "Geometry mesh name", "" );
DECLARE_FUNCTION_OUTARG( create_geometry_mesh_from_file, geo_mesh_id, "double-1x1", "Geometry mesh identifier" );
void create_geometry_mesh_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
std::string sFilePath = matlabGetString( prhs[ 1 ], "file_path" );
std::string sName = matlabGetString( prhs[ 2 ], "geo_mesh_name" );
const int iID = pConnection->pCoreInterface->CreateGeometryMeshFromFile( sFilePath, sName );
plhs[ 0 ] = mxCreateDoubleScalar( iID );
}
REGISTER_PUBLIC_FUNCTION( delete_geometry_mesh, "Delete geometry mesh", "" );
DECLARE_FUNCTION_REQUIRED_INARG( delete_geometry_mesh, geo_mesh_id, "double-1x1", "Geometry mesh identifier" );
DECLARE_FUNCTION_OUTARG( delete_geometry_mesh, success_flag, "logical-1x1", "Removal success" );
void delete_geometry_mesh( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "geo_mesh_id" );
const bool bSuccess = pConnection->pCoreInterface->DeleteGeometryMesh( iID );
plhs[ 0 ] = mxCreateLogicalScalar( bSuccess );
}
REGISTER_PUBLIC_FUNCTION( get_geometry_mesh_enabled, "Geometry mesh enabled getter", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_geometry_mesh_enabled, geo_mesh_id, "integer-1x1", "Geometry mesh identifier" );
DECLARE_FUNCTION_OUTARG( get_geometry_mesh_enabled, result, "logical-1x1", "Enabled flag" );
void get_geometry_mesh_enabled( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "geo_mesh_id" );
const bool bResult = pConnection->pCoreInterface->GetGeometryMeshEnabled( iID );
plhs[ 0 ] = mxCreateLogicalScalar( bResult );
}
REGISTER_PUBLIC_FUNCTION( set_geometry_mesh_enabled, "Geometry mesh enabled setter", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_geometry_mesh_enabled, geo_mesh_id, "integer-1x1", "Geometry mesh identifier" );
DECLARE_FUNCTION_OPTIONAL_INARG( set_geometry_mesh_enabled, enabled, "logical-1x1", "Enabled flag", "1" );
void set_geometry_mesh_enabled( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "geo_mesh_id" );
const bool bMuted = matlabGetBoolScalar( prhs[ 2 ], "enabled" );
pConnection->pCoreInterface->SetGeometryMeshEnabled( iID, bMuted );
}
REGISTER_PUBLIC_FUNCTION( get_geometry_mesh_parameters, "Geometry mesh parameter getter", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_geometry_mesh_parameters, geo_mesh_id, "integer-1x1", "Geometry mesh identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( get_geometry_mesh_parameters, args, "mstruct", "Requested parameters" );
DECLARE_FUNCTION_OUTARG( get_geometry_mesh_parameters, params, "mstruct", "Parameters" );
void get_geometry_mesh_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "geo_mesh_id" );
CVAStruct oArgs = matlabGetStruct( prhs[ 2 ], "args" );
CVAStruct oRet = pConnection->pCoreInterface->GetGeometryMeshParameters( iID, oArgs );
plhs[ 0 ] = matlabCreateStruct( oRet );
}
REGISTER_PUBLIC_FUNCTION( set_geometry_mesh_parameters, "Geometry mesh parameter setter", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_geometry_mesh_parameters, geo_mesh_id, "integer-1x1", "Geometry mesh identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( set_geometry_mesh_parameters, params, "mstruct", "Parameters" );
void set_geometry_mesh_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const int iID = matlabGetIntegerScalar( prhs[ 1 ], "geo_mesh_id" );
CVAStruct oParams = matlabGetStruct( prhs[ 2 ], "params" );
pConnection->pCoreInterface->SetGeometryMeshParameters( iID, oParams );
}
// Global methods
REGISTER_PUBLIC_FUNCTION( get_input_gain, "Returns the gain the audio device input channels", "" );
......@@ -2987,9 +3151,9 @@ void get_reproduction_modules( int, mxArray *plhs[], int nrhs, const mxArray *pr
const size_t nDims = int( voReproductions.size() );
const int nFields = 11;
const char* ppszFieldNames[] = { "id", "class", "enabled", "desc",
"output_detector_enabled", "output_recording_enabled", "output_recording_file_path",
"input_detector_enabled", "input_recording_enabled", "input_recording_file_path",
const char* ppszFieldNames[] = { "id", "class", "enabled", "desc",
"output_detector_enabled", "output_recording_enabled", "output_recording_file_path",
"input_detector_enabled", "input_recording_enabled", "input_recording_file_path",
"parameters" };
plhs[ 0 ] = mxCreateStructArray( 1, &nDims, nFields, ppszFieldNames );
......
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