From 331c7483577ecfd2bc28ad4ecd07dc4a7348c7fc Mon Sep 17 00:00:00 2001 From: osadsanu Date: Wed, 5 Jun 2019 18:38:35 -0500 Subject: [PATCH] JackAudio load OSX plugin Opening by default the project on OSX, gives the error that the dll is not found. The plugin's on the correct folder but the JackWrapper only load the plugin for Windows. Adding the compiler "if" allows loading both plugins on any platform ( win or osx). --- .../Assets/JackAudio/JackWrapper.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sample_jackscene/Assets/JackAudio/JackWrapper.cs b/sample_jackscene/Assets/JackAudio/JackWrapper.cs index c3e8511..1d1bf29 100644 --- a/sample_jackscene/Assets/JackAudio/JackWrapper.cs +++ b/sample_jackscene/Assets/JackAudio/JackWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Rodrigo Diaz +// Copyright (C) 2016 Rodrigo Diaz // // This file is part of JackAudioUnity. // @@ -51,7 +51,17 @@ static public void GetMixedData(float[] buffer) } #region DllImport - [DllImport("AudioPlugin-JackAudioForUnity")] + #if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX + [DllImport("JackAudioForUnity")] + private static extern bool CreateClient(int inchannels, int outchannels); + [DllImport("JackAudioForUnity")] + private static extern bool DestroyClient(); + [DllImport("JackAudioForUnity")] + private static extern void GetAllData(float[] buffer); + [DllImport("JackAudioForUnity")] + private static extern void SetAllData(float[] buffer); + #else + [DllImport("AudioPlugin-JackAudioForUnity")] private static extern bool CreateClient(int inchannels, int outchannels); [DllImport("AudioPlugin-JackAudioForUnity")] private static extern bool DestroyClient(); @@ -59,7 +69,7 @@ static public void GetMixedData(float[] buffer) private static extern void GetAllData(float[] buffer); [DllImport("AudioPlugin-JackAudioForUnity")] private static extern void SetAllData(float[] buffer); - + #endif // [DllImport("UnityJackAudio")] // public static extern void SetDebugFunction(IntPtr fp); // [DllImport("UnityJackAudio")] @@ -86,4 +96,4 @@ static public void GetMixedData(float[] buffer) } -} \ No newline at end of file +}