Adding homogeneous medium methods

parent fc95340f
......@@ -16,7 +16,7 @@
#include "VAMatlabConnection.h"
#include "VAMatlabTracking.h"
// Matlab includes
// Matlab includes
#include <mex.h>
#include <matrix.h>
......@@ -61,7 +61,7 @@ int g_iVerboseLevel = VERBOSE_LEVEL_NORMAL; // Verbosity level
| |
+------------------------------------------------------+ */
// Verbose functions
// Verbose functions
void INFO( const char * format, ... )
{
......@@ -225,8 +225,8 @@ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
| |
+------------------------------------------------------+ */
// Reflexion function. Returns cell-array of structs with information on the command functions.
// Used for code generation of the Matlab MEX facade class [private]
// Reflexion function. Returns cell-array of structs with information on the command functions.
// Used for code generation of the Matlab MEX facade class [private]
REGISTER_PRIVATE_FUNCTION( enumerateFunctions );
......@@ -574,7 +574,7 @@ void connect_tracker( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]
}
REGISTER_PRIVATE_FUNCTION( disconnect_tracker );
void disconnect_tracker( int , mxArray *[], int nrhs, const mxArray *prhs[] )
void disconnect_tracker( int, mxArray *[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
......@@ -795,16 +795,9 @@ void set_tracked_sound_source_rigid_body_rotation( int nlhs, mxArray *plhs[], in
}
/* +----------------------------------------------------------+ *
* | | *
* | Base functions | *
* | | *
* +----------------------------------------------------------+ */
REGISTER_PRIVATE_FUNCTION( get_server_state );
void get_server_state( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
void get_server_state( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
......@@ -815,12 +808,11 @@ void get_server_state( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( reset, "Resets the VA server", "" );
#if VAMATLAB_INTEGRATED == 1
void reset( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
#ifdef VAMATLAB_INTEGRATED
REGISTER_PUBLIC_FUNCTION( reset, "Resets the VA server", "" );
void reset( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
INFO( "Resetting VA core\n" );
......@@ -830,6 +822,7 @@ void reset( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
#else // VAMATLAB_INTEGRATED
REGISTER_PUBLIC_FUNCTION( reset, "Resets the VA server", "" );
void reset( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
......@@ -844,12 +837,6 @@ void reset( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
#endif // VAMATLAB_INTEGRATED
/* +----------------------------------------------------------+ *
* | | *
* | Module interface | *
* | | *
* +----------------------------------------------------------+ */
REGISTER_PUBLIC_FUNCTION( get_modules, "Enumerates internal modules of the VA server", "" );
DECLARE_FUNCTION_OUTARG( get_modules, modules, "cell-array of struct-1x1", "Module informations (names, descriptions, etc.)" );
void get_modules( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
......@@ -931,17 +918,10 @@ void add_search_path( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]
return;
}
/* +----------------------------------------------------------+ *
* | | *
* | Directivities | *
* | | *
* +----------------------------------------------------------+ */
REGISTER_PUBLIC_FUNCTION( create_directivity, "Loads a directivity from a file", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_directivity, filename, "string", "Filename" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_directivity, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_directivity, directivityID, "integer-1x1", "Directivity ID" );
void create_directivity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 3 );
......@@ -963,7 +943,6 @@ void create_directivity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
REGISTER_PUBLIC_FUNCTION( delete_directivity, "Frees a directivity and releases its memory", "This is only possible if the directivity is not in use. Otherwise the method will do nothing." );
DECLARE_FUNCTION_REQUIRED_INARG( delete_directivity, directivityID, "integer-1x1", "Directivity ID" );
DECLARE_FUNCTION_OUTARG( delete_directivity, result, "logical-1x1", "Directivity freed?" );
void delete_directivity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 2 );
......@@ -977,14 +956,11 @@ void delete_directivity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
plhs[ 0 ] = mxCreateLogicalScalar( bResult );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_directivity_info, "Returns information on a loaded directivity", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_directivity_info, directivityID, "integer-1x1", "Directivity ID" );
DECLARE_FUNCTION_OUTARG( get_directivity_info, info, "struct-1x1", "Information struct (name, filename, resolution, etc.)" );
void get_directivity_info( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
void get_directivity_info( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
......@@ -995,13 +971,10 @@ void get_directivity_info( int nlhs, mxArray *plhs[], int nrhs, const mxArray *p
plhs[ 0 ] = matlabCreateDirectivityInfo( di );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( get_directivity_infos, "Returns information on all loaded directivities", "" );
DECLARE_FUNCTION_OUTARG( get_directivity_infos, info, "cell-array of struct-1x1", "Information structs (name, filename, resolution, etc.)" );
void get_directivity_infos( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
void get_directivity_infos( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
......@@ -1018,17 +991,11 @@ void get_directivity_infos( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
plhs[ 0 ] = pCell;
}
/* +----------------------------------------------------------+ *
* | | *
* | Signal sources | *
* | | *
* +----------------------------------------------------------+ */
REGISTER_PUBLIC_FUNCTION( create_signal_source_buffer_from_file, "Creates a signal source which plays an audiofile", "Note: The audiofile must be mono and its sampling rate must match that of the server." );
DECLARE_FUNCTION_REQUIRED_INARG( create_signal_source_buffer_from_file, filename, "string", "Filename" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_signal_source_buffer_from_file, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_signal_source_buffer_from_file, signalSourceID, "string", "Signal source ID" );
void create_signal_source_buffer_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
......@@ -1043,11 +1010,9 @@ void create_signal_source_buffer_from_file( int nlhs, mxArray *plhs[], int nrhs,
plhs[ 0 ] = mxCreateString( sID.c_str() );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( create_signal_source_text_to_speech, "Creates a text to speech signal", "Note: depending on mode, either Speech WAV files are generated and then played back, or TTS sentence is directly played back." );
DECLARE_FUNCTION_OPTIONAL_INARG( create_signal_source_text_to_speech, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_signal_source_text_to_speech, signalSourceID, "string", "Signal source ID" );
void create_signal_source_text_to_speech( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -1059,13 +1024,10 @@ void create_signal_source_text_to_speech( int nlhs, mxArray *plhs[], int nrhs, c
plhs[ 0 ] = mxCreateString( sID.c_str() );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( create_signal_source_buffer_from_parameters, "Creates an buffer signal source", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_signal_source_buffer_from_parameters, params, "struct", "Parameters" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_signal_source_buffer_from_parameters, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_signal_source_buffer_from_parameters, signalSourceID, "string", "Signal source ID" );
void create_signal_source_buffer_from_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
......@@ -1080,13 +1042,10 @@ void create_signal_source_buffer_from_parameters( int nlhs, mxArray *plhs[], int
plhs[ 0 ] = mxCreateString( sID.c_str() );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( create_signal_source_engine, "Creates an engine signal source", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_signal_source_engine, params, "struct", "Parameters" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_signal_source_engine, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_signal_source_engine, signalSourceID, "string", "Signal source ID" );
void create_signal_source_engine( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 3 );
......@@ -1101,12 +1060,9 @@ void create_signal_source_engine( int nlhs, mxArray *plhs[], int nrhs, const mxA
plhs[ 0 ] = mxCreateString( sID.c_str() );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( create_signal_source_sequencer, "Creates a sequencer signal source", "" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_signal_source_sequencer, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_signal_source_sequencer, signalSourceID, "string", "Signal source ID" );
void create_signal_source_sequencer( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 2 );
......@@ -1120,16 +1076,13 @@ void create_signal_source_sequencer( int nlhs, mxArray *plhs[], int nrhs, const
plhs[ 0 ] = mxCreateString( sID.c_str() );
}
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( create_signal_source_network_stream, "Creates a signal source which receives audio samples via network", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_signal_source_network_stream, address, "string", "Hostname or IP address of the audio streaming server" );
DECLARE_FUNCTION_REQUIRED_INARG( create_signal_source_network_stream, port, "integer-1x1", "Server port" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_signal_source_network_stream, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_signal_source_network_stream, signalSourceID, "string", "Signal source ID" );
void create_signal_source_network_stream( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
void create_signal_source_network_stream( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 4 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
......@@ -2261,7 +2214,7 @@ REGISTER_PUBLIC_FUNCTION( set_sound_receiver_pose, "Sets the position and orient
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_pose, soundreceiverID, "integer-1x1", "Sound receiver ID" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_pose, pos, "double-3", "Position vector [x, y, z] (unit: meters)" );
DECLARE_FUNCTION_REQUIRED_INARG( set_sound_receiver_pose, ypr, "double-4", "Rotation angles [w,x,y,z]" );
void set_sound_receiver_pose( int , mxArray *[], int nrhs, const mxArray *prhs[] )
void set_sound_receiver_pose( int, mxArray *[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 4 );
......@@ -2379,23 +2332,186 @@ void set_sound_portal_name( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
}
/* +----------------------------------------------------------+ *
* | | *
* | Global functions | *
* | | *
* +----------------------------------------------------------+ */
// Homogeneous medium
REGISTER_PUBLIC_FUNCTION( get_input_gain, "Returns the gain the audio device input channels", "" );
DECLARE_FUNCTION_OUTARG( get_input_gain, gain, "double-1x1", "Input gain (amplification factor >=0)" );
REGISTER_PUBLIC_FUNCTION( set_homogeneous_medium_sound_speed, "Set homogeneous medium sound speed", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_homogeneous_medium_sound_speed, sound_speed, "double-1x1", "Sound speed [m/s]" );
void set_homogeneous_medium_sound_speed( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dSoundSpeed = matlabGetRealScalar( prhs[ 1 ], "sound_speed" );
pConnection->pCoreInterface->SetHomogeneousMediumSoundSpeed( dSoundSpeed );
}
REGISTER_PUBLIC_FUNCTION( get_homogeneous_medium_sound_speed, "Get homogeneous medium sound speed", "" );
DECLARE_FUNCTION_OUTARG( get_homogeneous_medium_sound_speed, sound_speed, "double-1x1", "Sound speed [m/s]" );
void get_homogeneous_medium_sound_speed( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dSoundSpeed = pConnection->pCoreInterface->GetHomogeneousMediumSoundSpeed();
plhs[ 0 ] = mxCreateDoubleScalar( dSoundSpeed );
}
REGISTER_PUBLIC_FUNCTION( set_homogeneous_medium_temperature, "Set homogeneous medium temperature", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_homogeneous_medium_temperature, temperature, "double-1x1", "Temperature [degree Celsius]" );
void set_homogeneous_medium_temperature( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dTemperature = matlabGetRealScalar( prhs[ 1 ], "temperature" );
pConnection->pCoreInterface->SetHomogeneousMediumTemperature( dTemperature );
}
REGISTER_PUBLIC_FUNCTION( get_homogeneous_medium_temperature, "Get homogeneous medium temperature", "" );
DECLARE_FUNCTION_OUTARG( get_homogeneous_medium_temperature, temperature, "double-1x1", "Temperature [degree Celsius]" );
void get_homogeneous_medium_temperature( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dTemperature = pConnection->pCoreInterface->GetHomogeneousMediumTemperature();
plhs[ 0 ] = mxCreateDoubleScalar( dTemperature );
}
REGISTER_PUBLIC_FUNCTION( set_homogeneous_medium_static_pressure, "Set homogeneous medium static pressure", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_homogeneous_medium_static_pressure, static_pressure, "double-1x1", "Static pressure [Pa]" );
void set_homogeneous_medium_static_pressure( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dStaticPressure = matlabGetRealScalar( prhs[ 1 ], "static_pressure" );
pConnection->pCoreInterface->SetHomogeneousMediumStaticPressure( dStaticPressure );
}
REGISTER_PUBLIC_FUNCTION( get_homogeneous_medium_static_pressure, "Get homogeneous medium static pressure", "" );
DECLARE_FUNCTION_OUTARG( get_homogeneous_medium_static_pressure, static_pressure, "double-1x1", "Static pressure [Pa]" );
void get_homogeneous_medium_static_pressure( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dStaticPressure = pConnection->pCoreInterface->GetHomogeneousMediumStaticPressure();
plhs[ 0 ] = mxCreateDoubleScalar( dStaticPressure );
}
REGISTER_PUBLIC_FUNCTION( set_homogeneous_medium_relative_humidity, "Set homogeneous medium relative humidity", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_homogeneous_medium_relative_humidity, shift_speed, "double-1x1", "Relative humidity [Percent]" );
void set_homogeneous_medium_relative_humidity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dRelativeHumidity = matlabGetRealScalar( prhs[ 1 ], "shift_speed" );
pConnection->pCoreInterface->SetHomogeneousMediumRelativeHumidity( dRelativeHumidity );
}
REGISTER_PUBLIC_FUNCTION( get_homogeneous_medium_relative_humidity, "Get homogeneous medium relative humidity", "" );
DECLARE_FUNCTION_OUTARG( get_homogeneous_medium_relative_humidity, shift_speed, "double-1x1", "Relative humidity [Percent]" );
void get_homogeneous_medium_relative_humidity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dRelativeHumidity = pConnection->pCoreInterface->GetHomogeneousMediumRelativeHumidity();
plhs[ 0 ] = mxCreateDoubleScalar( dRelativeHumidity );
}
REGISTER_PUBLIC_FUNCTION( set_homogeneous_medium_shift_speed, "Set homogeneous medium shift speed", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_homogeneous_medium_shift_speed, shift_speed, "double-3x1", "Shift speed vector [m/s]" );
void set_homogeneous_medium_shift_speed( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
VAVec3 v3ShiftSpeed;
matlabGetRealVector3( prhs[ 1 ], "shift_speed", v3ShiftSpeed );
void get_input_gain( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
pConnection->pCoreInterface->SetHomogeneousMediumShiftSpeed( v3ShiftSpeed );
}
REGISTER_PUBLIC_FUNCTION( get_homogeneous_medium_shift_speed, "Get homogeneous medium shift speed", "" );
DECLARE_FUNCTION_OUTARG( get_homogeneous_medium_shift_speed, shift_speed, "double-3x1", "Shift speed vector [m/s]" );
void get_homogeneous_medium_shift_speed( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
double dGain = pConnection->pCoreInterface->GetInputGain();
VAVec3 v3ShiftSpeed = pConnection->pCoreInterface->GetHomogeneousMediumShiftSpeed();
plhs[ 0 ] = matlabCreateRealVector3( v3ShiftSpeed );
}
REGISTER_PUBLIC_FUNCTION( get_homogeneous_medium_shift_parameters, "Returns homogeneous medium parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( get_homogeneous_medium_shift_parameters, args, "mstruct", "Requested parameters" );
DECLARE_FUNCTION_OUTARG( get_homogeneous_medium_shift_parameters, params, "mstruct", "Parameters" );
void get_homogeneous_medium_shift_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
CVAStruct oArgs = matlabGetStruct( prhs[ 1 ], "args" );
CVAStruct oRet = pConnection->pCoreInterface->GetHomogeneousMediumParameters( oArgs );
plhs[ 0 ] = matlabCreateStruct( oRet );
}
REGISTER_PUBLIC_FUNCTION( set_homogeneous_medium_shift_parameters, "Sets homogeneous medium parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_homogeneous_medium_shift_parameters, params, "mstruct", "Parameters" );
void set_homogeneous_medium_shift_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
CVAStruct oParams = matlabGetStruct( prhs[ 1 ], "params" );
pConnection->pCoreInterface->SetHomogeneousMediumParameters( oParams );
}
// Global methods
REGISTER_PUBLIC_FUNCTION( get_input_gain, "Returns the gain the audio device input channels", "" );
DECLARE_FUNCTION_OUTARG( get_input_gain, gain, "double-1x1", "Input gain (amplification factor >=0)" );
void get_input_gain( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 1 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
const double dGain = pConnection->pCoreInterface->GetInputGain();
plhs[ 0 ] = mxCreateDoubleScalar( dGain );
}
......@@ -2617,20 +2733,12 @@ void set_core_clock( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]
pConnection->pCoreInterface->SetCoreClock( dClk );
}
// ------------------------------------------------------------
/* +----------------------------------------------------------+ *
* | | *
* | Renderer & Reproduction | *
* | | *
* +----------------------------------------------------------+ */
// Rendering
// Rendering
REGISTER_PUBLIC_FUNCTION( set_rendering_module_gain, "Sets the output gain of a reproduction module", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_rendering_module_gain, sModuleID, "string", "Module identifier" );
DECLARE_FUNCTION_REQUIRED_INARG( set_rendering_module_gain, dGain, "double-1x1", "gain (factor)" );
void set_rendering_module_gain( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
......@@ -2802,7 +2910,7 @@ void get_reproduction_module_gain( int nlhs, mxArray *plhs[], int nrhs, const mx
REGISTER_PUBLIC_FUNCTION( get_reproduction_modules, "Get list of rendering modules", "" );
DECLARE_FUNCTION_OPTIONAL_INARG( get_reproduction_modules, bFilterEnabled, "boolean-1x1", "Filter activated (true)", "1" );
DECLARE_FUNCTION_OUTARG( get_reproduction_modules, reproductionmodules, "cell-array of struct-1x1", "Reproduction module infos (names, descriptions, etc.)" );
void get_reproduction_modules( int , mxArray *plhs[], int nrhs, const mxArray *prhs[] )
void get_reproduction_modules( int, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
bool bFilterEnabled = true;
if( nrhs > 1 )
......@@ -2836,8 +2944,8 @@ void get_reproduction_modules( int , mxArray *plhs[], int nrhs, const mxArray *p
* | | *
* +----------------------------------------------------------+ */
// Timer momentan nur unter Windows verfgbar
// TODO: Weitere Platform-Implementierungen
// Timer momentan nur unter Windows verfgbar
// TODO: Weitere Platform-Implementierungen
#ifdef WIN32
// Wchter, der automatisch das Kernel-Handle freigibt, wenn die DLL entladen wird
......@@ -2871,7 +2979,7 @@ static HandleGuard g_oTimerHandle;
REGISTER_PUBLIC_FUNCTION( set_timer, "Sets up the high-precision timer", "" );
DECLARE_FUNCTION_REQUIRED_INARG( set_timer, period, "double-1x1", "Timer period (unit: seconds)" );
void set_timer( int , mxArray *[], int nrhs, const mxArray *prhs[] )
void set_timer( int, mxArray *[], int nrhs, const mxArray *prhs[] )
{
REQUIRE_INPUT_ARGS( 2 );
......@@ -2908,7 +3016,7 @@ void set_timer( int , mxArray *[], int nrhs, const mxArray *prhs[] )
// ------------------------------------------------------------
REGISTER_PUBLIC_FUNCTION( wait_for_timer, "Wait for a signal of the high-precision timer", "" );
void wait_for_timer( int , mxArray *[], int nrhs, const mxArray *[] )
void wait_for_timer( int, mxArray *[], int nrhs, const mxArray *[] )
{
REQUIRE_INPUT_ARGS( 1 );
......
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