From fef0e60f9de3458f6c824a43d841312a167df9ce Mon Sep 17 00:00:00 2001 From: "maurice.andreas" <maurice.andreas@rwth-aachen.de> Date: Fri, 9 Dec 2016 16:04:33 +0100 Subject: [PATCH] ## --- VACS.cs | 28 ++++++++++++-- VAUListener.cs | 74 ------------------------------------- VAUReverbZone.cs | 10 ----- VAUReverbZonePrefab.prefab | Bin 5112 -> 0 bytes 4 files changed, 24 insertions(+), 88 deletions(-) delete mode 100644 VAUListener.cs delete mode 100644 VAUReverbZone.cs delete mode 100644 VAUReverbZonePrefab.prefab diff --git a/VACS.cs b/VACS.cs index b874df2..42acf09 100644 --- a/VACS.cs +++ b/VACS.cs @@ -21,7 +21,9 @@ namespace VA public bool Connect() { - return NativeConnectLocalNetClient(_NetClient); + bool b = NativeConnectLocalNetClient(_NetClient); + Debug.Assert(b, "Not Connected to VA."); + return b; } public bool Connect( string HostIP , int Port ) @@ -159,7 +161,7 @@ namespace VA return sIdentifier.ToString(); } - public void SetSoundSourceVolume(int iSoundSourceID, int dGain) + public void SetSoundSourceVolume(int iSoundSourceID, double dGain) { NativeSetSoundSourceVolume(_NetClient, iSoundSourceID, dGain); } @@ -243,9 +245,19 @@ namespace VA NativeSetSoundSourceAuralizationMode(_NetClient, iSoundSourceID, sAuralizationMode); } - public void SetArtificalReverbarationTime(string sRenderer, float fReverTime) + public void SetArtificalReverbarationTime(string Renderer, double ReverbTime) + { + NativeSetArtificalReverbarationTime(_NetClient, Renderer, ReverbTime); + } + + public void SetInputMuted(bool bMuted) { + NativeSetInputMuted(_NetClient, bMuted); + } + public void SetOutputMuted(bool bMuted) + { + NativeSetOutputMuted(_NetClient, bMuted); } /* * Native imported functions from C++ unmanaged library declared private, so they can not be accessed @@ -314,7 +326,7 @@ namespace VA [ DllImport( "VANetCSWrapper" ) ] private static extern int NativeGetSoundSourceDirectivity( IntPtr pClient, int iSoundSourceID ); [ DllImport( "VANetCSWrapper" ) ] private static extern void NativeSetSoundSourceDirectivity( IntPtr pClient, int iSoundSourceID, int iDirectivityID ); [ DllImport( "VANetCSWrapper" ) ] private static extern double NativeGetSoundSourceVolume( IntPtr pClient, int iSoundSourceID ); - [ DllImport( "VANetCSWrapper" ) ] private static extern void NativeSetSoundSourceVolume( IntPtr pClient, int iSoundSourceID, int dGain ); + [ DllImport( "VANetCSWrapper" ) ] private static extern void NativeSetSoundSourceVolume( IntPtr pClient, int iSoundSourceID, double dGain ); [ DllImport( "VANetCSWrapper" ) ] private static extern bool NativeIsSoundSourceMuted( IntPtr pClient, int iSoundSourceID ); [ DllImport( "VANetCSWrapper" ) ] private static extern void NativeSetSoundSourceMuted( IntPtr pClient, int iSoundSourceID, bool bMuted ); [ DllImport( "VANetCSWrapper" ) ] private static extern void NativeGetSoundSourcePosition( IntPtr pClient, int iSoundSourceID, double x, double y, double z ); @@ -461,5 +473,13 @@ namespace VA [ DllImport( "VANetCSWrapper" ) ] private static extern bool NativeIsReproductionModuleMuted( IntPtr pClient, string sModuleID ); [ DllImport( "VANetCSWrapper" ) ] private static extern void NativeSetReproductionModuleGain( IntPtr pClient, string sModuleID, double dGain ); [ DllImport( "VANetCSWrapper" ) ] private static extern double NativeGetReproductionModuleGain( IntPtr pClient, string sModuleID ); + + + [DllImport("VANetCSWrapper")] + private static extern void NativeSetArtificalReverbarationTime(IntPtr pClient, string sRendererID, double dReverberationTime); + [DllImport("VANetCSWrapper")] + private static extern void NativeSetArtificalRoomVolume(IntPtr pClient, string sRendererID, double dVolume); + [DllImport("VANetCSWrapper")] + private static extern void NativeSetArtificalSurfaceArea(IntPtr pClient, string sRendererID, double dArea); } } diff --git a/VAUListener.cs b/VAUListener.cs deleted file mode 100644 index 7c78ff2..0000000 --- a/VAUListener.cs +++ /dev/null @@ -1,74 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; -using VA; - - -public class VAUListener : MonoBehaviour { - - public string listenername = "Listener"; - private int Listener; - private VANet _VA = null; - private Quaternion q; - private Transform t; - - public int ID - { - get - { - return Listener; - } - } - - // Use this for initialization - void Start() - { - _VA = VAUAdapter.VA; - Listener = _VA.CreateListener(listenername, 0, VAUAdapter.DefaultHRIR); - listenername += " " + Listener; - _VA.SetListenerAuralizationMode(Listener, "all"); - Debug.Log(listenername + " created"); - _VA.SetListenerHRIRDataset(Listener, VAUAdapter.DefaultHRIR); - SetListenerPositionOrientation(); - if (GetComponent<VAUAuralizationMode>() != null) - GetComponent<VAUAuralizationMode>().AuraStringChanged += OnListenerAuralizationModeChanged; - - } - - // Update is called once per frame - void Update () - { - SetListenerPositionOrientation(); - } - //uses the View- and Up-Vector to transmit the position of the listener to VA - void SetListenerPositionOrientation() - { - t = GetComponent<Transform>(); - q = t.rotation; - Vector3 up = q * Vector3.up; - Vector3 view = q * Vector3.forward; - Vector3 view_ogl = new Vector3(view.x, view.y, -view.z); - Vector3 up_ogl = new Vector3(up.x, up.y, -up.z); - _VA.SetListenerPosition(Listener, t.transform.position.x, t.transform.position.y, -t.transform.position.z); - _VA.SetListenerOrientationVU(Listener, view_ogl.x, view_ogl.y, view_ogl.z, up_ogl.x, up_ogl.y, up_ogl.z); - } - - void OnListenerAuralizationModeChanged(string AuraMode) - { - _VA.SetListenerAuralizationMode(Listener, AuraMode); - } - - void OnDisable() - { - if (GetComponent<VAUAuralizationMode>() != null) - GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnListenerAuralizationModeChanged; - } - - void OnDestroy() - { - if (_VA.IsConnected()) - { - _VA.DeleteListener(Listener); - } - } -} diff --git a/VAUReverbZone.cs b/VAUReverbZone.cs deleted file mode 100644 index 1311376..0000000 --- a/VAUReverbZone.cs +++ /dev/null @@ -1,10 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class VAUReverbZone : MonoBehaviour { - - void OnTriggerEnter(Collider col) - { - GetComponent<AudioReverbZone>().reve - } -} diff --git a/VAUReverbZonePrefab.prefab b/VAUReverbZonePrefab.prefab deleted file mode 100644 index ca66b72101277c9c268879f2fabdcb6bb5c94b34..0000000000000000000000000000000000000000 GIT binary patch liter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