Imrpoving behavior if VAMatlab executable not found

parent d148207a
classdef itaVA < handle classdef itaVA < handle
%ITAVA Remote interface for VA real-time auralization servers %ITAVA Remote network interface to VA (Virtual Acoustics), the real-time
%auralization software made by ITA.
% %
% This class realizes a remote connection to a VA real-time % This class realizes a remote connection to a VA real-time
% auralization server and implements the full VA core interface % auralization server and implements the full VA core interface
% in Matlab. This way you connect to an auralization server % in Matlab. You can connect to to the server
% and control all of its features to perform a real-time % and control all of its features to perform real-time
% auralization. In order to get understand to the concepts behind VA % auralization, including live tracking if available.
% please refer to the VA documentation. % In order to get understand to the concepts behind VA
% please refer to the VA documentation or have a look at the example scripts.
% %
% Usage & examples: % See also: itaVA_example_simple, itaVA_example_tracked_listener,
% itaVA_example_generic_path_renderer, itaVA_example_random_numbers
%
% Quick usage:
% %
% - Create an interface and connect to the server running on the % - Create an interface and connect to the server running on the
% same computer (localhost) % same computer (localhost)
% %
% va = itaVA('localhost'); % va = itaVA;
% va.connect;
% %
% If no error occurs, you can then use the interface to work with % If no error occurs, you can then use the interface to work with
% the VA server. Best practice is to reset it first: % the VA server.
%
% va.reset
% %
% Then you can call other methods. For instance create a sound % Now, you can call other methods. For instance create a sound
% source: % source:
% %
% sourceID = va.createSoundSource('Virtual sound source') % sourceID = va.createSoundSource( 'My Matlab virtual sound source' )
% %
% When everything is done, do not forget to close the connection. % When everything is done, do not forget to close the connection.
% You can call disconnect on the instance or simply clear it: % You can call disconnect on the instance or simply clear it:
% %
% clear va % clear va
% %
% - You can find more examples in the demo files
%
% Questions? Contact the author: Frank.Wefers@akustik.rwth-aachen.de
%
% Otherwise => Enjoy!
% %
properties(Hidden = true, Access = private) properties(Hidden = true, Access = private)
handle = int32(0); % Connection handle handle = int32(0); % Connection handle
% Connection defaults % Connection defaults
DEFAULT_SERVER_PORT = 12340; DEFAULT_SERVER_PORT = 12340;
end end
methods(Static) methods(Static)
function [ ok ] = check_for_mex_file()
% Checks if VAMatlab executable can be found.
if ~exist( 'VAMatlab', 'var' )
disp( 'Matlab binding for VA not complete (missing VAMatlab executable).' )
ok = false;
% file dialog
else
ok = true;
end
end
function [version] = getVersion() function [version] = getVersion()
% Return the version of the VA Matlab interface % Return the version of the VA Matlab interface
% %
...@@ -100,6 +113,10 @@ classdef itaVA < handle ...@@ -100,6 +113,10 @@ classdef itaVA < handle
% core = itaVA('localhost:12340'); % core = itaVA('localhost:12340');
% %
if ~check_for_mex_file() )
error( 'Matlab binding for VA requires VAMatlab executable.' );
end
if (nargin > 0) if (nargin > 0)
this.connect(addressstring) this.connect(addressstring)
end end
......
...@@ -14,7 +14,16 @@ ...@@ -14,7 +14,16 @@
% Clear everything first, so that no inconsistens % Clear everything first, so that no inconsistens
% class instances can exist (we have to use % class instances can exist (we have to use
clear all; clear all
if exist( 'VAMatlab', 'var' )
warn( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
else
if isdir( '../dist/win32-x64.vc12/bin' )
addpath( '../dist/win32-x64.vc12/bin' )
addpath( '../dist/win32-x64.vc12/lib' )
end
end
% Uncomment the path you are building your matlab executable against. It is % Uncomment the path you are building your matlab executable against. It is
% sufficient to execute this once for a matlab session. It is always recommended % sufficient to execute this once for a matlab session. It is always recommended
......
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