Aufgrund einer Wartung wird GitLab am 17.08. zwischen 8:30 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 17.08. between 8:30 and 9:00 am.

Refactoring static matlab methods

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