More documentation

parent 68454f53
......@@ -7,7 +7,7 @@ using VA;
// Adapter to VA (singleton)
/**
* Drop this file onto any GameObject. Add a VAUConfig script to the same object to control parameters.
* Drop this file onto any GameObject. Add a VAUConfig script to the same object for special settings. Add VAUControl to control the running core.
* */
public class VAUAdapter : MonoBehaviour
{
......
......@@ -4,10 +4,19 @@ using UnityEngine;
public class VAUConfig : MonoBehaviour {
[Tooltip("Name or IP address where the VA server is running.")]
public string Server = VAUAdapter.Server;
[Tooltip("TCP/IP port where the VA server is communicating.")]
public int Port = VAUAdapter.Port;
[Tooltip("Add an additional path where to find files")]
public string AdditionalSearchPath = "";
[Tooltip("Resets server on startup")]
public bool ResetOnStart = true;
[Tooltip("Resets server when stopping")]
public bool ResetOnStop = true;
// Use this for initialization
......
......@@ -4,16 +4,16 @@ using UnityEngine;
public class VAUController : MonoBehaviour
{
[Tooltip("Mute global input")]
[Tooltip("Mute global input (audio in)")]
public bool InputMuted = false;
[Tooltip("Control global input gain")]
[Tooltip("Control global input gain (audio in level)")]
public double InputGain = 1.0;
[Tooltip("Mute global output")]
[Tooltip("Mute global output (audio out)")]
public bool OutputMuted = false;
[Tooltip("Control global output gain")]
[Tooltip("Control global output gain (audio out level)")]
public double OutputGain = 1.0;
private bool InputMutedShadow;
......
......@@ -4,13 +4,7 @@ using UnityEngine;
public class VAUDefaultHRIR : VAUDirectivity
{
[Tooltip("Absolute or relative path (relative to Assets folder), also use AddSearchPath for special folders.")]
public string HRIRFilePath = "$(DefaultHRIR)";
[Tooltip("Versatile name for this directivity")]
public string HRIRName = "Default head-related transfer function";
// The default HRIR create a HRIR database using the default macro $(DefaultHRIR), which is usually defined in the server configuration"
VAUDefaultHRIR()
{
FilePath = "$(DefaultHRIR)";
......
......@@ -5,10 +5,10 @@ using UnityEngine;
public class VAUDirectivity : MonoBehaviour
{
[Tooltip("Absolute or relative path (relative to Assets folder), also use AddSearchPath for special folders.")]
protected string FilePath = "";
public string FilePath = "";
[Tooltip("Versatile name for this directivity")]
protected string Name = "";
public string Name = "";
protected int _ID = -1; // Stores the internal id that is assigned by VA
......@@ -22,12 +22,18 @@ public class VAUDirectivity : MonoBehaviour
void OnEnable()
{
if (!VAUAdapter.VA.IsConnected())
return;
if (FilePath.Length > 0)
_ID = VAUAdapter.VA.CreateDirectivityFromFile(FilePath);
}
private void OnDestroy()
{
if (!VAUAdapter.VA.IsConnected())
return;
if (_ID != -1)
VAUAdapter.VA.DeleteDirectivity(_ID);
_ID = -1;
......
......@@ -16,13 +16,18 @@ public class VAUSignalSourceAudioFile : VAUSignalSource
{
if (!VAUAdapter.VA.IsConnected())
{
Debug.LogError( 'Could not create signal source "' + FilePath + '", not connected to VA' );
Debug.LogError( "Could not awake signal source '" + FilePath + "', not connected to VA" );
return;
}
}
void OnEnable()
{
if (!VAUAdapter.VA.IsConnected())
{
Debug.LogError( "Could not enable signal source '" + FilePath + "', not connected to VA" );
return;
}
_ID = VAUAdapter.VA.CreateSignalSourceBufferFromFile (FilePath, Name);
Debug.Assert (_ID.Length > 0, "Could not create audio file signal source '" + Name + "' from file path " + FilePath);
VAUAdapter.VA.SetSignalSourceBufferLooping (_ID, IsLooping);
......
......@@ -38,7 +38,7 @@ public class VAUSoundSource : MonoBehaviour
if (!_VA.IsConnected())
{
Debug.LogError( 'Could not create sound source, not connected to VA' );
Debug.LogError( "Could not create sound source, not connected to VA" );
return;
}
......
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