Global cache for records. More...

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

Public Member Functions

AudioClip GetClip (string key)
 Returns the AudioClip for a given key. More...
 
void RemoveClip (string key)
 Removes an AudioClip for a given key. More...
 
void AddClip (string key, AudioClip data)
 Adds an AudioClip for a given key. More...
 
byte[] GetData (string key)
 Returns the audio data for a given key. More...
 
void RemoveData (string key)
 Removes audio data for a given key. More...
 
void AddData (string key, byte[] data)
 Adds audio data for a given key. More...
 
void ClearDataCache ()
 Clears the audio data cache. More...
 
void ClearClipCache ()
 Clears the clips cache. More...
 
void ClearCache ()
 Clears 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

int CurrentDataCacheSize => AudioDatas.Sum(pair => pair.Value.Length)
 Current size of the data cache in Bytes. More...
 
int CurrentClipCacheSize => Clips.Sum(pair => pair.Value.samples * 2 * 4)
 Current size of the clip cache in Bytes. More...
 

Static Public Attributes

static readonly System.Collections.Generic.Dictionary< string, AudioClip > Clips = new System.Collections.Generic.Dictionary<string, AudioClip>()
 summary>Dictionary with all cached audio data. More...
 
static readonly System.Collections.Generic.Dictionary< string, byte[]> AudioDatas = new System.Collections.Generic.Dictionary<string, byte[]>()
 
- 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...
 

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...
 
int DataCacheSize [get, set]
 
- 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 Protected Attributes inherited from Crosstales.Common.Util.Singleton< GlobalCache >
static T instance
 

Detailed Description

Global cache for records.

Member Function Documentation

◆ AddClip()

void Crosstales.DJ.GlobalCache.AddClip ( string  key,
AudioClip  data 
)

Adds an AudioClip for a given key.

Parameters
keyKey for the AudioClip.
dataAudioClip for the key.

◆ AddData()

void Crosstales.DJ.GlobalCache.AddData ( string  key,
byte[]  data 
)

Adds audio data for a given key.

Parameters
keyKey for the audio data.
dataAudio data for the key.

◆ ClearCache()

void Crosstales.DJ.GlobalCache.ClearCache ( )

Clears the complete cache.

◆ ClearClipCache()

void Crosstales.DJ.GlobalCache.ClearClipCache ( )

Clears the clips cache.

◆ ClearDataCache()

void Crosstales.DJ.GlobalCache.ClearDataCache ( )

Clears the audio data cache.

◆ GetClip()

AudioClip Crosstales.DJ.GlobalCache.GetClip ( string  key)

Returns the AudioClip for a given key.

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

◆ GetData()

byte [] Crosstales.DJ.GlobalCache.GetData ( string  key)

Returns the audio data for a given key.

Parameters
keyKey for the audio data.
Returns
Audio data for the given key.

◆ RemoveClip()

void Crosstales.DJ.GlobalCache.RemoveClip ( string  key)

Removes an AudioClip for a given key.

Parameters
keyKey for the AudioClip.

◆ RemoveData()

void Crosstales.DJ.GlobalCache.RemoveData ( string  key)

Removes audio data for a given key.

Parameters
keyKey for the audio data.

◆ ResetObject()

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

Resets this object.

Member Data Documentation

◆ Clips

readonly System.Collections.Generic.Dictionary<string, AudioClip> Crosstales.DJ.GlobalCache.Clips = new System.Collections.Generic.Dictionary<string, AudioClip>()
static

summary>Dictionary with all cached audio data.

◆ CurrentClipCacheSize

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

Current size of the clip cache in Bytes.

◆ CurrentDataCacheSize

int Crosstales.DJ.GlobalCache.CurrentDataCacheSize => AudioDatas.Sum(pair => pair.Value.Length)

Current size of the data cache in Bytes.

Property Documentation

◆ ClipCacheSize

int Crosstales.DJ.GlobalCache.ClipCacheSize
getset

Size of the clip cache in Bytes.

summary>Size of the data cache in Bytes.


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