Global cache for wrappers. More...

Inheritance diagram for Crosstales.RTVoice.GlobalCache:
Crosstales.Common.Util.Singleton< GlobalCache >

Public Member Functions

AudioClip GetClip (Crosstales.RTVoice.Model.Wrapper key)
 Returns the AudioClip for a given key. More...
 
void RemoveClip (Crosstales.RTVoice.Model.Wrapper key)
 Removes an AudioClip for a given key. More...
 
void AddClip (Crosstales.RTVoice.Model.Wrapper key, AudioClip data)
 Adds an AudioClip for a given key. More...
 
void ClearClipCache ()
 Clears the clips cache. More...
 
void ClearCache ()
 Clears the complete cache. More...
 
void ClearAndDeleteCache ()
 Clears and deletes the complete cache. More...
 
void SaveCache ()
 Saves the complete cache. More...
 
void LoadCache ()
 Loads the complete cache. More...
 

Static Public Member Functions

static void ResetObject ()
 Resets this object. More...
 
- Static Public Member Functions inherited from Crosstales.Common.Util.Singleton< GlobalCache >
static void CreateInstance (bool searchExistingGameObject=true, bool deleteExistingInstance=false)
 Creates an instance of this object. More...
 
static void DeleteInstance ()
 Deletes the instance of this object. More...
 

Public Attributes

readonly System.Collections.Generic.Dictionary< Crosstales.RTVoice.Model.Wrapper, AudioClip > Clips = new System.Collections.Generic.Dictionary<Crosstales.RTVoice.Model.Wrapper, AudioClip>()
 
int CurrentClipCacheSize => Clips.Sum(pair => pair.Value.samples * 2 * 4)
 Current size of the clip cache in Bytes. More...
 

Protected Member Functions

override void OnApplicationQuit ()
 
- Protected Member Functions inherited from Crosstales.Common.Util.Singleton< GlobalCache >
virtual void Awake ()
 
virtual void OnDestroy ()
 

Properties

int ClipCacheSize [get, set]
 Size of the clip cache in Bytes. More...
 
bool PersistCache [get, set]
 Automatically loads and saves the cache. More...
 
- Properties inherited from Crosstales.Common.Util.Singleton< GlobalCache >
static T Instance [get, protected set]
 Returns the singleton instance of this class. More...
 
bool DontDestroy [get, set]
 Don't destroy gameobject during scene switches. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Crosstales.Common.Util.Singleton< GlobalCache >
static string PrefabPath
 Fully qualified prefab path. More...
 
static string GameObjectName
 Name of the gameobject in the scene. More...
 
- Static Protected Attributes inherited from Crosstales.Common.Util.Singleton< GlobalCache >
static T instance
 

Detailed Description

Global cache for wrappers.

Member Function Documentation

◆ AddClip()

void Crosstales.RTVoice.GlobalCache.AddClip ( Crosstales.RTVoice.Model.Wrapper  key,
AudioClip  data 
)

Adds an AudioClip for a given key.

Parameters
keyKey for the AudioClip.
dataAudioClip for the key.

◆ ClearAndDeleteCache()

void Crosstales.RTVoice.GlobalCache.ClearAndDeleteCache ( )

Clears and deletes the complete cache.

◆ ClearCache()

void Crosstales.RTVoice.GlobalCache.ClearCache ( )

Clears the complete cache.

◆ ClearClipCache()

void Crosstales.RTVoice.GlobalCache.ClearClipCache ( )

Clears the clips cache.

◆ GetClip()

AudioClip Crosstales.RTVoice.GlobalCache.GetClip ( Crosstales.RTVoice.Model.Wrapper  key)

Returns the AudioClip for a given key.

Parameters
keyKey for the AudioClip.
Returns
AudioClip for the given key.

◆ LoadCache()

void Crosstales.RTVoice.GlobalCache.LoadCache ( )

Loads the complete cache.

◆ RemoveClip()

void Crosstales.RTVoice.GlobalCache.RemoveClip ( Crosstales.RTVoice.Model.Wrapper  key)

Removes an AudioClip for a given key.

Parameters
keyKey for the AudioClip.

◆ ResetObject()

static void Crosstales.RTVoice.GlobalCache.ResetObject ( )
static

Resets this object.

◆ SaveCache()

void Crosstales.RTVoice.GlobalCache.SaveCache ( )

Saves the complete cache.

Member Data Documentation

◆ CurrentClipCacheSize

int Crosstales.RTVoice.GlobalCache.CurrentClipCacheSize => Clips.Sum(pair => pair.Value.samples * 2 * 4)

Current size of the clip cache in Bytes.

Property Documentation

◆ ClipCacheSize

int Crosstales.RTVoice.GlobalCache.ClipCacheSize
getset

Size of the clip cache in Bytes.

◆ PersistCache

bool Crosstales.RTVoice.GlobalCache.PersistCache
getset

Automatically loads and saves the cache.


The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/RTVoice/RTVoicePro/Assets/Plugins/crosstales/RTVoice/Scripts/GlobalCache.cs