Marking create_directivity as deprecated and adding versions with _from_file...

Marking create_directivity as deprecated and adding versions with _from_file and _from_parameters to create directivities. Added Matlab compatibility methid with deprecation warning.
parent 1ea1a2ee
classdef itaVA < handle
%ITAVA Remote network interface to VA (Virtual Acoustics), the real-time
%auralization software made by ITA.
%auralization framework.
%
% Find the VA applications, documentation and examples here: http://www.virtualacoustics.org
%
% This class realizes a remote connection to a VA real-time
% auralization server and implements the full VA core interface
% in Matlab. You can connect to to the server
% and control all of its features to perform real-time
% auralization, including live tracking if available.
% In order to get understand to the concepts behind VA
% please refer to the VA documentation or have a look at the example scripts.
% auralization, including integrated live tracking if an OptiTrack tracker is at hand.
%
% See also: itaVA_example_simple, itaVA_example_tracked_sound_receiver,
% itaVA_example_generic_path_renderer, itaVA_example_random_numbers
......@@ -21,13 +21,11 @@ classdef itaVA < handle
% va = itaVA;
% va.connect;
%
% If no error occurs, you can then use the interface to work with
% the VA server.
%
% Now, you can call other methods. For instance create a sound
% source:
% If the connection is established, you can start controlling VA via the interface.
% For instance create an move a sound source:
%
% sourceID = va.create_sound_source( 'My Matlab virtual sound source' )
% va.set_sound_source_position( sourceID, [ 0 0 0 ] );
%
% When everything is done, do not forget to close the connection.
% You can call disconnect on the instance or simply clear it:
......@@ -373,6 +371,15 @@ classdef itaVA < handle
VAMatlab( 'get_tracker_info', this.handle )
end
%% --= Deprecated methods =--
function id = create_directivity( this, filepath )
% Creates a directivity from file [DEPRECATED]
warn( 'This method is marked as deprecated and will be removed in a future version. Please use \'create_directivity_from_file\' instead.' )
id = this.create_directivity_from_file( filepath );
end
%% --= Functions =--
......
......@@ -980,11 +980,11 @@ void add_search_path( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]
return;
}
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[] ) {
REGISTER_PUBLIC_FUNCTION( create_directivity_from_file, "Loads a directivity from a file", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_directivity_from_file, filename, "string", "Filename" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_directivity_from_file, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_directivity_from_file, directivityID, "integer-1x1", "Directivity ID" );
void create_directivity_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 3 );
......@@ -997,7 +997,25 @@ void create_directivity( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
int iDirectivityID = pConnection->pCoreInterface->CreateDirectivityFromFile( sFilename, sName );
plhs[ 0 ] = matlabCreateID( iDirectivityID );
INFO( "Loaded directivity \"%s\" successfully loaded (id: %d)\n", sFilename.c_str(), hHandle );
INFO( "Directivity \"%s\" successfully loaded (id: %d)\n", sFilename.c_str(), iDirectivityID );
}
REGISTER_PUBLIC_FUNCTION( create_directivity_from_parameters, "Creates a directivity based on given parameters", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_directivity_from_parameters, directivity_args, "struct", "Directivity arguments" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_directivity_from_parameters, name, "string", "Displayed name", "''" );
DECLARE_FUNCTION_OUTARG( create_directivity_from_parameters, directivityID, "integer-1x1", "Directivity ID" );
void create_directivity_from_parameters( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
REQUIRE_INPUT_ARGS( 3 );
ConnectionHandle hHandle = GetConnectionHandle( prhs[ 0 ] );
CVAMatlabConnection* pConnection = g_vpConnections[ hHandle ];
CVAStruct oDirectivityArgs = matlabGetStruct( prhs[ 1 ], "directivity_args" );
std::string sName = matlabGetString( prhs[ 2 ], "Name" );
int iDirectivityID = pConnection->pCoreInterface->CreateDirectivityFromParameters( oDirectivityArgs, sName );
plhs[ 0 ] = matlabCreateID( iDirectivityID );
}
// ------------------------------------------------------------
......
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