public AkBankHandle(string name, bool decode, bool save) { bankName = name; bankCallback = null; decodeBank = decode; saveDecodedBank = save; // Verify if the bank has already been decoded if( decodeBank ) { string DecodedBankPath = System.IO.Path.Combine(AkInitializer.GetDecodedBankFullPath(), bankName + ".bnk"); string EncodedBankPath = System.IO.Path.Combine(AkBasePathGetter.GetValidBasePath(), bankName + ".bnk"); if ( System.IO.File.Exists (DecodedBankPath) ) { try { if (System.IO.File.GetLastWriteTime(DecodedBankPath) > System.IO.File.GetLastWriteTime(EncodedBankPath)) { relativeBasePath = AkInitializer.GetDecodedBankFolder(); decodeBank = false; } } catch { // Assume the decoded bank exists, but is not accessible. Re-decode it anyway, so we do nothing. } } } }
public void LoadAsync(AkCallbackManager.BankCallback callback = null) { if (IsValid()) { AkBankManager.LoadBankAsync(Name, callback); } }
public AkBankHandle(string name, bool decode, bool save) { bankName = name; bankCallback = null; decodeBank = decode; saveDecodedBank = save; // Verify if the bank has already been decoded if (decodeBank) { string DecodedBankPath = System.IO.Path.Combine(AkInitializer.GetDecodedBankFullPath(), bankName + ".bnk"); string EncodedBankPath = System.IO.Path.Combine(AkBasePathGetter.GetValidBasePath(), bankName + ".bnk"); if (System.IO.File.Exists(DecodedBankPath)) { try { if (System.IO.File.GetLastWriteTime(DecodedBankPath) > System.IO.File.GetLastWriteTime(EncodedBankPath)) { relativeBasePath = AkInitializer.GetDecodedBankFolder(); decodeBank = false; } } catch { // Assume the decoded bank exists, but is not accessible. Re-decode it anyway, so we do nothing. } } } }
/// Loads a bank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information public void LoadBankAsync(AkCallbackManager.BankCallback callback = null) { if (m_RefCount == 0) { bankCallback = callback; AkSoundEngine.LoadBank(bankName, AkBankManager.GlobalBankCallback, this, AkSoundEngine.AK_DEFAULT_POOL_ID, out m_BankID); } IncRef(); }
public void LoadAsync(AkCallbackManager.BankCallback callback = null) { #if !DISABLE_AKSOUNDENGINE if (IsValid()) { AkBankManager.LoadBankAsync(name, callback); } #endif }
/// Loads a bank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information public void LoadBankAsync(AkCallbackManager.BankCallback callback = null) { if (m_RefCount == 0) { bankCallback = callback; AkSoundEngine.LoadBank(bankName, AkBankManager.GlobalBankCallback, this, AkSoundEngine.AK_DEFAULT_POOL_ID, out m_BankID); } IncRef(); }
public void LoadBankAsync(AkCallbackManager.BankCallback callback = null) { if (this.m_RefCount == 0) { this.bankCallback = callback; AkSoundEngine.LoadBank(this.bankName, new AkCallbackManager.BankCallback(AkBankManager.GlobalBankCallback), this, -1, out this.m_BankID); } this.IncRef(); }
internal AKRESULT LoadAsync(string bankName, AkCallbackManager.BankCallback ayncLoadHandler, System.Object callbckCookie) { AKRESULT result = bankAtomContenter[bankName].LoadAsync(ayncLoadHandler, callbckCookie); if (result == AKRESULT.AK_WaitBankLoadingFinish) { bankAyncLoadingIds.Add(bankName); } return(result); }
public static void GlobalBankCallback(uint in_bankID, IntPtr in_pInMemoryBankPtr, AKRESULT in_eLoadResult, uint in_memPoolId, object in_Cookie) { AkBankManager.m_Mutex.WaitOne(); AkBankHandle akBankHandle = (AkBankHandle)in_Cookie; AkCallbackManager.BankCallback bankCallback = akBankHandle.bankCallback; if (in_eLoadResult != AKRESULT.AK_Success) { AkBankManager.m_BankHandles.Remove(akBankHandle.bankName); } AkBankManager.m_Mutex.ReleaseMutex(); if (bankCallback != null) { bankCallback(in_bankID, in_pInMemoryBankPtr, in_eLoadResult, in_memPoolId, null); } }
public static void LoadBankAsync(string name, AkCallbackManager.BankCallback callback = null) { m_Mutex.WaitOne(); AkBankHandle handle = null; if (!m_BankHandles.TryGetValue(name, out handle)) { handle = new AkBankHandle(name); m_BankHandles.Add(name, handle); m_Mutex.ReleaseMutex(); handle.LoadBankAsync(callback); } else { m_Mutex.ReleaseMutex(); } }
public static void GlobalBankCallback(uint in_bankID, IntPtr in_pInMemoryBankPtr, AKRESULT in_eLoadResult, uint in_memPoolId, object in_Cookie) { m_Mutex.WaitOne(); AkBankHandle handle = (AkBankHandle)in_Cookie; AkCallbackManager.BankCallback bankCallback = handle.bankCallback; if (in_eLoadResult != AKRESULT.AK_Success) { Debug.LogWarning("Wwise: Bank " + handle.bankName + " failed to load (" + in_eLoadResult.ToString() + ")"); m_BankHandles.Remove(handle.bankName); } m_Mutex.ReleaseMutex(); if (bankCallback != null) { bankCallback(in_bankID, in_pInMemoryBankPtr, in_eLoadResult, in_memPoolId, null); } }
/// Loads a SoundBank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information. public static void LoadBankAsync(string name, AkCallbackManager.BankCallback callback = null) { BankHandle handle = null; lock (m_BankHandles) { if (m_BankHandles.TryGetValue(name, out handle)) { // Bank already loaded, increment its ref count. handle.IncRef(); return; } handle = new AsyncBankHandle(name, callback); m_BankHandles.Add(name, handle); } handle.LoadBank(); }
public static void LoadBankAsync(string name, AkCallbackManager.BankCallback callback = null) { AkBankManager.m_Mutex.WaitOne(); AkBankHandle akBankHandle = null; if (!AkBankManager.m_BankHandles.TryGetValue(name, out akBankHandle)) { akBankHandle = new AkBankHandle(name); AkBankManager.m_BankHandles.Add(name, akBankHandle); AkBankManager.m_Mutex.ReleaseMutex(); akBankHandle.LoadBankAsync(callback); } else { akBankHandle.IncRef(); AkBankManager.m_Mutex.ReleaseMutex(); } }
public AkBankHandle(string name, bool decode, bool save) { bankName = name; bankCallback = null; decodeBank = decode; saveDecodedBank = save; #if !UNITY_EDITOR // Verify if the bank has already been decoded if( decodeBank ) { if( System.IO.File.Exists (System.IO.Path.Combine(AkInitializer.GetDecodedBankFullPath(), bankName + ".bnk")) ) { relativeBasePath = AkInitializer.GetDecodedBankFolder(); decodeBank = false; } } #endif }
/// Loads a SoundBank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information. public static void LoadBankAsync(string name, AkCallbackManager.BankCallback callback = null) { m_Mutex.WaitOne(); BankHandle handle = null; if (!m_BankHandles.TryGetValue(name, out handle)) { AsyncBankHandle asyncHandle = new AsyncBankHandle(name, callback); m_BankHandles.Add(name, asyncHandle); m_Mutex.ReleaseMutex(); asyncHandle.LoadBank(); } else { // Bank already loaded, increment its ref count. handle.IncRef(); m_Mutex.ReleaseMutex(); } }
public AkBankHandle(string name, bool decode, bool save) { bankName = name; bankCallback = null; decodeBank = decode; saveDecodedBank = save; #if !UNITY_EDITOR // Verify if the bank has already been decoded if (decodeBank) { if (System.IO.File.Exists(System.IO.Path.Combine(AkInitializer.GetDecodedBankFullPath(), bankName + ".bnk"))) { relativeBasePath = AkInitializer.GetDecodedBankFolder(); decodeBank = false; } } #endif }
/// Loads a bank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information public void LoadBankAsync(AkCallbackManager.BankCallback callback = null) { if (m_RefCount == 0) { // There might be a case where we were asked to unload the SoundBank, but then asked immediately after to load that bank. // If that happens, there will be a short amount of time where the ref count will be 0, but the bank will still be in memory. // In that case, we do not want to unload the bank, so we have to remove it from the list of pending bank unloads. if (AkBankManager.BanksToUnload.Contains(this)) { AkBankManager.BanksToUnload.Remove(this); IncRef(); return; } bankCallback = callback; AkSoundEngine.LoadBank(bankName, AkBankManager.GlobalBankCallback, this, AkSoundEngine.AK_DEFAULT_POOL_ID, out m_BankID); } IncRef(); }
public static AKRESULT LoadBankResAsync(string name, AkCallbackManager.BankCallback callback, System.Object in_cookie) { m_Mutex.WaitOne(); BankHandle handle = null; if (!m_BankHandles.TryGetValue(name, out handle)) { var asyncHandle = new AsyncBankHandle(name, callback, in_cookie); m_BankHandles.Add(name, asyncHandle); m_Mutex.ReleaseMutex(); asyncHandle.DoLoadBank(); return(AKRESULT.AK_WaitBankLoadingFinish); } else { m_Mutex.ReleaseMutex(); return(AKRESULT.AK_BankAlreadyLoaded); } }
public void LoadAsync(AkCallbackManager.BankCallback callback = null) { throw new System.Exception("Wwise Addressables : Use Load() when loading banks with the Wwise Addressables package"); }
public AsyncBankHandle(string name, AkCallbackManager.BankCallback callback) : base(name) { bankCallback = callback; }
public AkBankHandle(string name) { this.bankName = name; this.bankCallback = null; }
public AkBankHandle(string name) { bankName = name; bankCallback = null; m_BankID = AkSoundEngine.GetIDFromString(System.IO.Path.GetFileNameWithoutExtension(name)); }
public static AKRESULT LoadBank(string name, AkCallbackManager.BankCallback callback) { return(LoadBank(name, false, false, callback)); }
public AsyncBankHandle(string name, AkCallbackManager.BankCallback callback, System.Object callback_cookie) : base(name) { hasCookie = true; bankCallback = callback; bankCallback_cookie = callback_cookie; }
/// Loads a bank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information public void LoadBankAsync(AkCallbackManager.BankCallback callback = null) { if (m_RefCount == 0) { // There might be a case where we were asked to unload the SoundBank, but then asked immediately after to load that bank. // If that happens, there will be a short amount of time where the ref count will be 0, but the bank will still be in memory. // In that case, we do not want to unload the bank, so we have to remove it from the list of pending bank unloads. if(AkBankManager.BanksToUnload.Contains(this)) { AkBankManager.BanksToUnload.Remove(this); IncRef(); return; } bankCallback = callback; AkSoundEngine.LoadBank(bankName, AkBankManager.GlobalBankCallback, this, AkSoundEngine.AK_DEFAULT_POOL_ID, out m_BankID); } IncRef(); }
public BankCallbackPackage(AkCallbackManager.BankCallback in_cb, object in_cookie) { this.m_Callback = in_cb; this.m_Cookie = in_cookie; AkCallbackManager.m_mapBankCallbacks.set_Item(this.GetHashCode(), this); }
public AsyncBankHandle(string name, AkCallbackManager.BankCallback callback, System.Object in_Cookie) : base(name) { bankCallback = callback; Cookie = in_Cookie; }
/// Loads a SoundBank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information. public static AKRESULT LoadBank(string name, bool decodeBank, bool saveDecodedBank, AkCallbackManager.BankCallback callback = null) { m_Mutex.WaitOne(); if (m_AyncloadingBanks.Count > 0) { foreach (var lAyncloadingBank in m_AyncloadingBanks) { if (lAyncloadingBank.bankName == name) { return(AKRESULT.AK_BankAsyncLoading); } } } BankHandle handle = null; if (!m_BankHandles.TryGetValue(name, out handle)) { if (callback != null) { handle = new AsyncBankHandle(name, callback, null); } else if (decodeBank) { handle = new DecodableBankHandle(name, saveDecodedBank); } else { handle = new BankHandle(name); } if (callback == null) { m_BankHandles.Add(name, handle); } m_Mutex.ReleaseMutex(); return(handle.LoadBank()); } else { // Bank already loaded, increment its ref count. m_Mutex.ReleaseMutex(); return(AKRESULT.AK_BankAlreadyLoaded); } }
public BankCallbackPackage(AkCallbackManager.BankCallback in_cb, object in_cookie) { this.m_Callback = in_cb; this.m_Cookie = in_cookie; AkCallbackManager.m_mapBankCallbacks[this.GetHashCode()] = this; }
public AkBankHandle(string name) { bankName = name; bankCallback = null; m_BankID = AkSoundEngine.GetIDFromString(System.IO.Path.GetFileNameWithoutExtension(name)); }
public AkBankHandle(string name) { bankName = name; bankCallback = null; }
internal AKRESULT LoadAsync(AkCallbackManager.BankCallback ayncLoadHandler, System.Object callbckCookie) { return(AkBankManager.LoadBankResAsync(BankData.Name, ayncLoadHandler, callbckCookie)); }