Refactoring static matlab methods

parent 11d25980
...@@ -10,7 +10,7 @@ classdef itaVA < handle ...@@ -10,7 +10,7 @@ classdef itaVA < handle
% In order to get understand to the concepts behind VA % In order to get understand to the concepts behind VA
% please refer to the VA documentation or have a look at the example scripts. % please refer to the VA documentation or have a look at the example scripts.
% %
% See also: itaVA_example_simple, itaVA_example_tracked_listener, % See also: itaVA_example_simple, itaVA_example_tracked_sound_receiver,
% itaVA_example_generic_path_renderer, itaVA_example_random_numbers % itaVA_example_generic_path_renderer, itaVA_example_random_numbers
% %
% Quick usage: % Quick usage:
...@@ -60,7 +60,7 @@ classdef itaVA < handle ...@@ -60,7 +60,7 @@ classdef itaVA < handle
end end
end end
function [version] = getVersion() function [version] = get_version()
% Return the version of the VA Matlab interface % Return the version of the VA Matlab interface
% %
% Parameters: % Parameters:
...@@ -75,10 +75,10 @@ classdef itaVA < handle ...@@ -75,10 +75,10 @@ classdef itaVA < handle
error( 'Matlab binding for VA requires VAMatlab executable.' ); error( 'Matlab binding for VA requires VAMatlab executable.' );
end end
version = VAMatlab('getVersion'); version = VAMatlab('get_version');
end end
function [] = setVerboseMode(mode) function [] = set_verbose_mode(mode)
% Sets the verbose level of the VA Matlab interface % Sets the verbose level of the VA Matlab interface
% %
% Parameters: % Parameters:
...@@ -99,7 +99,7 @@ classdef itaVA < handle ...@@ -99,7 +99,7 @@ classdef itaVA < handle
error( 'Matlab binding for VA requires VAMatlab executable.' ); error( 'Matlab binding for VA requires VAMatlab executable.' );
end end
VAMatlab('setVerboseMode', mode); VAMatlab('set_verbose_mode', mode);
end end
end end
...@@ -139,9 +139,9 @@ classdef itaVA < handle ...@@ -139,9 +139,9 @@ classdef itaVA < handle
this.disconnect this.disconnect
end end
function [connected] = isConnected(this) function [connected] = is_connected(this)
% Returns if a connection to a server is established % Returns if a connection to a server is established
connected = VAMatlab('isConnected', this.handle); connected = VAMatlab('is_connected', this.handle);
end end
function connect(this, addressstring) function connect(this, addressstring)
...@@ -182,7 +182,7 @@ classdef itaVA < handle ...@@ -182,7 +182,7 @@ classdef itaVA < handle
this.handle = int32(0); this.handle = int32(0);
end end
function [state] = getServerState(this) function [state] = get_server_state(this)
% Returns the state of the connected server % Returns the state of the connected server
% %
% Use this function to check whether the server is % Use this function to check whether the server is
...@@ -203,18 +203,18 @@ classdef itaVA < handle ...@@ -203,18 +203,18 @@ classdef itaVA < handle
% - 2 = Connected, but server has failure. % - 2 = Connected, but server has failure.
% %
if this.handle==0, error('Not connected.'); end; if this.handle==0, error('Not connected.'); end;
state = VAMatlab('getServerState', this.handle); state = VAMatlab('get_server_state', this.handle);
end end
function connectTracker( this, remote_ip, local_ip ) function connectTracker( this, remote_ip, local_ip )
% Connects to a local NatNet tracking server % Connects to a local NatNet tracking server
% %
% The server will update a virtual listener for real-time % The server will update a virtual sound receiver for real-time
% sound synthesis and the real world listener position for % sound synthesis and the real world sound receiver position for
% those sound reproductions that need this information, like % those sound reproductions that need this information, like
% Crosstalk-Cancellation. % Crosstalk-Cancellation.
% %
% See also setTrackedListener. % See also set_tracked_sound_receiver.
% %
% Parameters (optional): % Parameters (optional):
% %
...@@ -227,48 +227,48 @@ classdef itaVA < handle ...@@ -227,48 +227,48 @@ classdef itaVA < handle
local_ip = '127.0.0.1'; local_ip = '127.0.0.1';
end end
VAMatlab( 'ConnectTracker', this.handle, remote_ip, local_ip ); VAMatlab( 'connect_tracker', this.handle, remote_ip, local_ip );
end end
function [connected] = isTrackerConnected( this ) function [connected] = get_tracker_connected( this )
% Returns true, if tracker is connected % Returns true, if tracker is connected
connected = VAMatlab( 'IsTrackerConnected', this.handle ); connected = VAMatlab( 'get_tracker_connected', this.handle );
end end
function disconnectTracker( this ) function disconnect_tracker( this )
% Disconnects from the NatNet tracking server % Disconnects from the NatNet tracking server
VAMatlab( 'DisconnectTracker', this.handle ) VAMatlab( 'disconnect_tracker', this.handle )
end end
% -- Tracked listener -- % % -- Tracked sound receiver -- %
function setTrackedListener( this, listener_id ) function set_tracked_sound_receiver( this, sound_receiver_id )
% Connects a VA listener with the tracked listener rigid body % Connects a VA sound receiver with the tracked sound receiver rigid body
% %
% Parameters: % Parameters:
% %
% listener_id [integer-1x1] VA listener id % sound_receiver_id [integer-1x1] VA sound receiver id
% %
VAMatlab( 'SetTrackedListener', this.handle, listener_id ); VAMatlab( 'set_tracked_sound_receiver', this.handle, sound_receiver_id );
end end
function setTrackedListenerRigidBodyIndex( this, index ) function set_tracked_sound_receiver_rigid_body_index( this, index )
% Sets the index of the rigid body to be tracked for listener (default is 1) % Sets the index of the rigid body to be tracked for sound receiver (default is 1)
VAMatlab( 'SetTrackedListenerRigidBodyIndex', this.handle, index ) VAMatlab( 'set_tracked_sound_receiver_rigid_body_index', this.handle, index )
end end
function setTrackedListenerRigidBodyTranslation( this, translation ) function set_tracked_sound_receiver_rigid_body_translation( this, translation )
% Sets the pivot point translation for the tracked listener rigid body % Sets the pivot point translation for the tracked sound receiver rigid body
% %
% Parameters: % Parameters:
% %
% translation [double-3x1] Translation in local coordinate system of rigid body [m] % translation [double-3x1] Translation in local coordinate system of rigid body [m]
% %
VAMatlab( 'SetTrackedListenerRigidBodyTranslation', this.handle, translation ) VAMatlab( 'set_tracked_sound_receiver_rigid_body_translation', this.handle, translation )
end end
function setTrackedListenerRigidBodyRotation( this, rotation ) function set_tracked_sound_receiver_rigid_body_rotation( this, rotation )
% Sets the rotation of orientation for the tracked listener rigid body % Sets the rotation of orientation for the tracked sound receiver rigid body
% %
% Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k) % Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k)
% %
...@@ -276,38 +276,38 @@ classdef itaVA < handle ...@@ -276,38 +276,38 @@ classdef itaVA < handle
% %
% rotation [quaternion] Rotation of rigid body % rotation [quaternion] Rotation of rigid body
% %
VAMatlab( 'SetTrackedListenerRigidBodyRotation', this.handle, rotation ) VAMatlab( 'set_tracked_sound_receiver_rigid_body_rotation', this.handle, rotation )
end end
% -- Tracked real-world listener -- % % -- Tracked real-world sound receiver -- %
function setTrackedRealWorldListener( this, listener_id ) function set_tracked_real_world_sound_receiver( this, sound_receiver_id )
% Connects a VA real-world listener with the tracked real-world rigid body % Connects a VA real-world sound receiver with the tracked real-world rigid body
% %
% Parameters: % Parameters:
% %
% listener_id [integer-1x1] VA real-world listener id % sound_receiver_id [integer-1x1] VA real-world sound receiver id
% %
VAMatlab( 'SetTrackedRealWorldListener', this.handle, listener_id ); VAMatlab( 'set_tracked_real_world_sound_receiver', this.handle, sound_receiver_id );
end end
function setTrackedRealWorldListenerRigidBodyIndex( this, index ) function set_tracked_real_world_sound_receiver_rigid_body_index( this, index )
% Sets the index of the rigid body to be tracked for real-world listener (default is 1) % Sets the index of the rigid body to be tracked for real-world sound receiver (default is 1)
VAMatlab( 'SetTrackedRealWorldListenerRigidBodyIndex', this.handle, index ) VAMatlab( 'set_tracked_real_world_sound_receiver_rigid_body_index', this.handle, index )
end end
function setTrackedRealWorldListenerRigidBodyTranslation( this, translation ) function set_tracked_real_world_sound_receiver_rigid_body_translation( this, translation )
% Sets the pivot point translation for the tracked real-world listener rigid body % Sets the pivot point translation for the tracked real-world sound receiver rigid body
% %
% Parameters: % Parameters:
% %
% translation [double-3x1] Translation in local coordinate system of rigid body [m] % translation [double-3x1] Translation in local coordinate system of rigid body [m]
% %
VAMatlab( 'SetTrackedRealWorldListenerRigidBodyTranslation', this.handle, translation ) VAMatlab( 'set_tracked_real_world_sound_receiver_rigid_body_translation', this.handle, translation )
end end
function setTrackedRealWorldListenerRigidBodyRotation( this, rotation ) function set_tracked_real_world_sound_receiver_rigid_body_rotation( this, rotation )
% Sets the rotation of orientation for the tracked real-world listener rigid body % Sets the rotation of orientation for the tracked real-world sound receiver rigid body
% %
% Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k) % Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k)
% %
...@@ -315,37 +315,37 @@ classdef itaVA < handle ...@@ -315,37 +315,37 @@ classdef itaVA < handle
% %
% rotation [quaternion] Rotation of rigid body % rotation [quaternion] Rotation of rigid body
% %
VAMatlab( 'SetTrackedRealWorldListenerRigidBodyRotation', this.handle, rotation ) VAMatlab( 'set_tracked_real_world_sound_receiver_rigid_body_rotation', this.handle, rotation )
end end
% -- Tracked source -- % % -- Tracked source -- %
function setTrackedSource( this, source_id ) function set_tracked_sound_source( this, source_id )
% Connects a VA source with the tracked source rigid body % Connects a VA source with the tracked source rigid body
% %
% Parameters: % Parameters:
% %
% source_id [integer-1x1] VA source id % source_id [integer-1x1] VA source id
% %
VAMatlab( 'SetTrackedSource', this.handle, source_id ); VAMatlab( 'set_tracked_sound_source', this.handle, source_id );
end end
function setTrackedSourceRigidBodyIndex( this, index ) function set_tracked_source_rigid_body_index( this, index )
% Sets the index of the rigid body to be tracked for source (default is 1) % Sets the index of the rigid body to be tracked for source (default is 1)
VAMatlab( 'SetTrackedSourceRigidBodyIndex', this.handle, index ) VAMatlab( 'set_tracked_source_rigid_body_index', this.handle, index )
end end
function setTrackedSourceRigidBodyTranslation( this, translation ) function set_tracked_source_rigid_body_translation( this, translation )
% Sets the pivot point translation for the tracked source rigid body % Sets the pivot point translation for the tracked source rigid body
% %
% Parameters: % Parameters:
% %
% translation [double-3x1] Translation in local coordinate system of rigid body [m] % translation [double-3x1] Translation in local coordinate system of rigid body [m]
% %
VAMatlab( 'SetTrackedSourceRigidBodyTranslation', this.handle, translation ) VAMatlab( 'set_tracked_source_rigid_body_translation', this.handle, translation )
end end
function setTrackedSourceRigidBodyRotation( this, rotation ) function set_tracked_source_rigid_body_rotation( this, rotation )
% Sets the rotation of orientation for the tracked source rigid body % Sets the rotation of orientation for the tracked source rigid body
% %
% Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k) % Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k)
...@@ -354,7 +354,7 @@ classdef itaVA < handle ...@@ -354,7 +354,7 @@ classdef itaVA < handle
% %
% rotation [quaternion] Rotation of rigid body % rotation [quaternion] Rotation of rigid body
% %
VAMatlab( 'SetTrackedSourceRigidBodyRotation', this.handle, rotation ) VAMatlab( 'set_tracked_source_rigid_body_rotation', this.handle, rotation )
end end
...@@ -365,7 +365,7 @@ classdef itaVA < handle ...@@ -365,7 +365,7 @@ classdef itaVA < handle
function display(this) function display(this)
% TODO: Define nice behaviour % TODO: Define nice behaviour
% if this.handle % if this.handle
% fprintf('Connection established to server ''%s''\n', this.getServerAddress()) % fprintf('Connection established to server ''%s''\n', this.get_server_address())
% else % else
% fprintf('Not connected\n'); % fprintf('Not connected\n');
% end % end
......
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