Adding sound receiver explicit renderer create method

parent 29175ddb
......@@ -34,6 +34,9 @@
#include <windows.h>
#endif
// Unreferenced formal parameters appear a lot with the generic mex API, we will ignore them
#pragma warning( disable : 4100 )
// Maximum number of parallel connections
const int VAMATLAB_MAX_CONNECTIONS = 16;
......@@ -1943,11 +1946,26 @@ void create_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
plhs[ 0 ] = matlabCreateID( isoundreceiverID );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( create_sound_receiver_explicit_renderer, "Creates a sound receiver explicitly for a certain renderer", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_sound_receiver_explicit_renderer, renderer, "string", "Renderer identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( create_sound_receiver_explicit_renderer, name, "string", "Name" );
DECLARE_FUNCTION_OUTARG( create_sound_receiver_explicit_renderer, id, "integer-1x1", "Sound receiver ID" );
void create_sound_receiver_explicit_renderer( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
std::string sRendererID = matlabGetString( prhs[ 1 ], "renderer" );
std::string sName = matlabGetString( prhs[ 2 ], "name" );
int iID = pConnection->pCoreInterface->CreateSoundReceiverExplicitRenderer( sRendererID, sName );
plhs[ 0 ] = matlabCreateID( iID );
}
REGISTER_PUBLIC_FUNCTION( delete_sound_receiver, "Deletes a sound receiver from the scene", "Note: The active sound receiver cannot be deleted!" );
DECLARE_FUNCTION_REQUIRED_INARG( delete_sound_receiver, soundreceiverID, "integer-1x1", "Sound receiver ID" );
void delete_sound_receiver( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......
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