Fixes where references to old itaVA (now VA) classes where used

parent 722bf6a1
......@@ -99,29 +99,29 @@ endif( )
# VA matlab scripts file
set( VAMATLAB_BASE_DIR "${CMAKE_INSTALL_PREFIX}" )
configure_file( "matlab/itaVA_build.m.proto" "${CMAKE_CURRENT_SOURCE_DIR}/matlab/itaVA_build_absolute.m" @ONLY )
configure_file( "matlab/VA_build.m.proto" "${CMAKE_CURRENT_SOURCE_DIR}/matlab/VA_build_absolute.m" @ONLY )
set( VAMATLAB_BASE_DIR ".." ) # relative path from matlab folder
configure_file( "matlab/itaVA_build.m.proto" "${CMAKE_CURRENT_SOURCE_DIR}/matlab/itaVA_build.m" @ONLY )
configure_file( "matlab/VA_build.m.proto" "${CMAKE_CURRENT_SOURCE_DIR}/matlab/VA_build.m" @ONLY )
# Install specialties
install( FILES "matlab/itaVA_build.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA.m.proto" DESTINATION "matlab" )
install( FILES "matlab/itaVA_generateStubs.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_example_simple.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_example_tracked_listener.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_example_offline_simulation.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_example_offline_simulation_ir.m" DESTINATION "matlab" )
install( FILES "matlab/itaVA_setup.fig" DESTINATION "matlab" )
install( FILES "matlab/itaVA_setup.m" DESTINATION "matlab" )
install( FILES "matlab/VA_build.m" DESTINATION "matlab" )
install( FILES "matlab/VA.m.proto" DESTINATION "matlab" )
install( FILES "matlab/VA_generateStubs.m" DESTINATION "matlab" )
install( FILES "matlab/VA_example_simple.m" DESTINATION "matlab" )
install( FILES "matlab/VA_example_tracked_listener.m" DESTINATION "matlab" )
install( FILES "matlab/VA_example_offline_simulation.m" DESTINATION "matlab" )
install( FILES "matlab/VA_example_offline_simulation_ir.m" DESTINATION "matlab" )
install( FILES "matlab/VA_setup.fig" DESTINATION "matlab" )
install( FILES "matlab/VA_setup.m" DESTINATION "matlab" )
# Build Matlab class using Matlab (future work)
if( ITA_VAMATLAB_POSTBUILD_CREATE_MATLAB_CLASS )
set( MATLAB_BUILD_CLASS_COMMAND "matlab -nodisplay -nosplash -nodesktop -r \"run( 'matlab/itaVA_build_absolute.m' )\"" )
add_custom_command( TARGET VAMatlab POST_BUILD COMMAND ${MATLAB_BUILD_CLASS_COMMAND} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Running matlab itaVA installer" VERBATIM )
set( MATLAB_BUILD_CLASS_COMMAND "matlab -nodisplay -nosplash -nodesktop -r \"run( 'matlab/VA_build_absolute.m' )\"" )
add_custom_command( TARGET VAMatlab POST_BUILD COMMAND ${MATLAB_BUILD_CLASS_COMMAND} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Running matlab VA installer" VERBATIM )
else( )
message( STATUS "To make the itaVA convenience class available, after deploy, please run the 'matlab/itaVA_build.m' ccript once in Matlab. It will generate the itavA.m class file in the matlab folder." )
message( STATUS "To make the VA convenience class available, after deploy, please run the 'matlab/VA_build.m' ccript once in Matlab. It will generate the VA.m class file in the matlab folder." )
endif( )
if( EXISTS "matlab/itaVA.m" )
install( FILES "matlab/itaVA.m" DESTINATION "matlab" )
if( EXISTS "matlab/VA.m" )
install( FILES "matlab/VA.m" DESTINATION "matlab" )
endif( )
\ No newline at end of file
classdef itaVA < handle
%ITAVA Remote network interface to VA (Virtual Acoustics), the real-time
classdef VA < handle
%VA Remote network interface to VA (Virtual Acoustics), the real-time
%auralization framework.
%
% Find the VA applications, documentation and examples here: http://www.virtualacoustics.org
......@@ -10,15 +10,15 @@ classdef itaVA < handle
% and control all of its features to perform real-time
% 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
% See also: VA_example_simple, VA_example_tracked_sound_receiver,
% VA_example_generic_path_renderer, VA_example_random_numbers
%
% Quick usage:
%
% - Create an interface and connect to the server running on the
% same computer (localhost)
%
% va = itaVA;
% va = VA;
% va.connect;
%
% If the connection is established, you can start controlling VA via the interface.
......@@ -49,7 +49,7 @@ classdef itaVA < handle
disp( 'Matlab binding for VA not complete (missing VAMatlab executable).' )
% file dialog
itaVA_setup()
VA_setup()
% Re-check
ok = exist( 'VAMatlab', 'file' ) > 0;
......@@ -69,7 +69,7 @@ classdef itaVA < handle
%
% version [string] Version string
if ~itaVA.check_for_mex_file()
if ~VA.check_for_mex_file()
error( 'Matlab binding for VA requires VAMatlab executable.' );
end
......@@ -93,7 +93,7 @@ classdef itaVA < handle
% set the verbose mode to 'quiet'
%
if ~itaVA.check_for_mex_file()
if ~VA.check_for_mex_file()
error( 'Matlab binding for VA requires VAMatlab executable.' );
end
......@@ -103,7 +103,7 @@ classdef itaVA < handle
end
methods
function this = itaVA(addressstring)
function this = VA(addressstring)
% Initialization constructor. Initiiates a new connection.
%
% Parameters:
......@@ -120,11 +120,11 @@ classdef itaVA < handle
% - You can leave the argument 'address' undefined, in order
% to create an clear, unconnected instance and connect to
% a server later using the method 'connect'
% - Example: core = itaVA;
% core = itaVA('localhost:12340');
% - Example: core = VA;
% core = VA('localhost:12340');
%
if ~itaVA.check_for_mex_file()
if ~VA.check_for_mex_file()
error( 'Matlab binding for VA requires VAMatlab executable.' );
end
......
......@@ -41,7 +41,7 @@ outputFile = fullfile( va_script_dir, 'VA.m' );
fprintf( 'Generating code for VA Matlab class ''%s'' ...\n', outputFile );
code = fileread( templateFile );
stubCode = VA_generate_stubs();
stubCode = VA_generateStubs();
code = strrep( code, '###STUBCODE###', stubCode );
......
......@@ -24,7 +24,7 @@ if exist( va_script_dir, 'dir' ) ~= 7
end
if exist( [ 'VAMatlab' '.' mexext ], 'file' )
warning( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
warning( 'VAMatlab already found at location "%s", are you sure to build VA against this executable? Will proceed now.', which( 'VAMatlab' ) )
else
% Add to PATH temporarily and attempt to move lib to bin dir
addpath( va_script_dir, va_bin_dir )
......@@ -36,12 +36,12 @@ else
end
% Parameters
templateFile = 'itaVA.m.proto';
outputFile = fullfile( va_script_dir, 'itaVA.m' );
templateFile = 'VA.m.proto';
outputFile = fullfile( va_script_dir, 'VA.m' );
fprintf( 'Generating code for itaVA Matlab class ''%s'' ...\n', outputFile );
fprintf( 'Generating code for VA Matlab class ''%s'' ...\n', outputFile );
code = fileread( templateFile );
stubCode = itaVA_generateStubs();
stubCode = VA_generateStubs();
code = strrep( code, '###STUBCODE###', stubCode );
......
......@@ -41,7 +41,7 @@ outputFile = fullfile( va_script_dir, 'VA.m' );
fprintf( 'Generating code for VA Matlab class ''%s'' ...\n', outputFile );
code = fileread( templateFile );
stubCode = VA_generate_stubs();
stubCode = VA_generateStubs();
code = strrep( code, '###STUBCODE###', stubCode );
......
%% itaVA simple example code
% Create itaVA
va = itaVA;
% Connect to VA application (start the application first)
va.connect( 'localhost' )
% Reset VA to clear the scene
va.reset()
% Control output gain
va.set_output_gain( .25 )
% Add the current absolute folder path to VA application
va.add_search_path( pwd );
% Create a signal source and start playback
X = va.create_signal_source_buffer_from_file( '$(DemoSound)' );
va.set_signal_source_buffer_playback_action( X, 'play' )
va.set_signal_source_buffer_looping( X, true );
% Create a virtual sound source and set a position
S = va.create_sound_source( 'itaVA_Source' );
va.set_sound_source_position( S, [ 2 1.7 2 ] )
% Create a listener with a HRTF and position him
L = va.create_sound_receiver( 'itaVA_Listener' );
va.set_sound_receiver_position( L, [ 0 1.7 0 ] )
H = va.create_directivity( '$(DefaultHRIR)' );
va.set_sound_receiver_directivity( L, H );
% Connect the signal source to the virtual sound source
va.set_sound_source_signal_source( S, X )
% More information
disp( 'Type ''doc itaVA'' for more information.' )
%% itaVA tracked listener example code
% This assumes you already have set up a virtual scene without listener
% Create itaVA and connect
va = itaVA( 'localhost' );
% Create a sound receiver
L = va.create_sound_receiver( 'itaVA_Tracked_Listener' );
% OptiTrack tracker conneection and sound receiver updates
va.set_tracked_sound_receiver( L ) % For virtual scene / rendering
va.set_tracked_real_world_sound_receiver( L ) % For CTC reproductions
va.connect_tracker
pause( 12 ) % Observe how you can move the virtual sound receiver
va.disconnect_tracker
% Remove listener again
va.delete_sound_receiver( L )
% Stub generator for the VA Matlab facade class
% Author: Frank Wefers (fwefers@akustik.rwth-aachen.de)
function [output] = generateStubs()
% Get interface describtion
d = VAMatlab('enumerate_functions');
code = '';
for i=1:length(d)
% Concatenate the input and output argument lists
inargs = '';
ninargs = length(d(i).inargs);
for j=1:ninargs
if (j>1) inargs = strcat(inargs, ', '); end
inargs = strcat(inargs, sprintf('%s', d(i).inargs(j).name));
end
outargs = '';
noutargs = length(d(i).outargs);
for j=1:noutargs
if (j>1) outargs = strcat(outargs, ', '); end
outargs = strcat(outargs, sprintf('%s', d(i).outargs(j).name));
end
if ninargs > 0
code = [code sprintf('\tfunction [%s] = %s(this, %s)\n', outargs, d(i).name, inargs)];
else
code = [code sprintf('\tfunction [%s] = %s(this)\n', outargs, d(i).name)];
end
code = [code sprintf('\t\t%% %s\n', d(i).desc)];
% Argument and return value documentation
code = [code sprintf('\t\t%%\n\t\t%% Parameters:\n\t\t%%\n')];
if (ninargs == 0)
code = [code sprintf('\t\t%% \tNone\n')];
else
for j=1:ninargs
if (d(i).inargs(j).optional)
code = [code sprintf('\t\t%% \t%s [%s] %s (optional, default: %s)\n', ...
d(i).inargs(j).name, ...
d(i).inargs(j).type, ...
d(i).inargs(j).desc, ...
d(i).inargs(j).default)];
else
code = [code sprintf('\t\t%% \t%s [%s] %s\n', ...
d(i).inargs(j).name, ...
d(i).inargs(j).type, ...
d(i).inargs(j).desc)];
end
end
end
code = [code sprintf('\t\t%%\n\t\t%% Return values:\n\t\t%%\n')];
if (noutargs == 0)
code = [code sprintf('\t\t%% \tNone\n')];
else
for j=1:noutargs
code = [code sprintf('\t\t%% \t%s [%s] %s\n', ...
d(i).outargs(j).name, ...
d(i).outargs(j).type, ...
d(i).outargs(j).desc)];
end
end
code = [code sprintf('\t\t%%\n\n')];
% Matlab code that checks that a connection is established
code = [code sprintf('\t\tif this.handle==0, error(''Not connected.''); end;\n\n')];
% Matlab code for default values in optional input parameters
for j=1:ninargs
if (d(i).inargs(j).optional)
code = [code sprintf('\t\tif ~exist(''%s'',''var''), %s = %s; end\n', ...
d(i).inargs(j).name, d(i).inargs(j).name, d(i).inargs(j).default)];
end
end
% Matlab code calling the MEX
if (noutargs > 0)
if (ninargs > 0)
code = [code sprintf('\t\t[%s] = VAMatlab(''%s'', this.handle, %s);\n', outargs, d(i).name, inargs)];
else
code = [code sprintf('\t\t[%s] = VAMatlab(''%s'', this.handle);\n', outargs, d(i).name)];
end
else
if (ninargs > 0)
code = [code sprintf('\t\tVAMatlab(''%s'', this.handle, %s);\n', d(i).name, inargs)];
else
code = [code sprintf('\t\tVAMatlab(''%s'', this.handle);\n', d(i).name)];
end
end
code = [code sprintf('\tend\n\n')];
end
output = code;
end
\ No newline at end of file
This diff is collapsed.
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