Crosstales.DJ.Provider.BaseRecordProviderDB Class Reference

Base class (with DB) for all record providers. More...

Inheritance diagram for Crosstales.DJ.Provider.BaseRecordProviderDB:
Crosstales.DJ.Provider.BaseRecordProvider Crosstales.DJ.Provider.IRecordProviderDB Crosstales.DJ.Provider.IRecordProvider Crosstales.DJ.Provider.RecordProviderPath Crosstales.DJ.Provider.RecordProviderPlaylist

Public Member Functions

override void Load (bool forceReload=false)
 Loads all audio records for this provider. More...
 
virtual void SaveDB (string filePath="")
 Saves all audio records from this provider as a DB file. More...
 
virtual void LoadDB (string filePath="")
 Loads all audio records for this provider from a DB file. More...
 
void DeleteDB ()
 Deletes the DB file. More...
 

Public Attributes

string uid
 
bool hasDBFile => Crosstales.Common.Util.FileHelper.ExistsFile(DBFilePath)
 
string DBFilePath => $"{Application.persistentDataPath}/{uid}.djdb"
 
- Public Attributes inherited from Crosstales.DJ.Provider.BaseRecordProvider
double TotalPlaytime => Records.Aggregate(0d, (current, record) => current + record.Duration)
 
long TotalSize => Records.Sum(record => record.FileSize)
 

Protected Member Functions

virtual void OnDestroy ()
 
- Protected Member Functions inherited from Crosstales.DJ.Provider.BaseRecordProvider
virtual void Awake ()
 
virtual void Start ()
 
abstract void load ()
 
abstract void loadInEditor ()
 
void fillRecords (string[] list)
 
virtual void onRecordsChange ()
 
virtual void onProvider ()
 
virtual void onErrorProvider (string info)
 

Properties

bool UseDatabase [get, set]
 Use a database file to store the processed records. More...
 
- Properties inherited from Crosstales.DJ.Provider.BaseRecordProvider
bool LoadTag [get, set]
 
bool ReadFileSize [get, set]
 
bool AutoUpdate [get, set]
 
bool AutoUpdateInEditor [get, set]
 Auto-update the record list in Editor. More...
 
abstract Crosstales.DJ.RecordsChangeEvent onRecordsChanged [get]
 
abstract Crosstales.DJ.ProviderReadyEvent onProviderReady [get]
 
abstract Crosstales.DJ.ErrorProviderEvent onErrorProviderInfo [get]
 
bool isLoadTag [get, set]
 
bool isReadFileSize [get, set]
 
bool isAutoUpdate [get, set]
 
bool isReady [get, set]
 
System.Collections.Generic.List< Crosstales.DJ.Model.RecordRecords [get]
 
- Properties inherited from Crosstales.DJ.Provider.IRecordProvider
bool LoadTag [get, set]
 Load the tag of every Record in the constructor. This is a time-costly operation and can lead to stuttering. More...
 
bool ReadFileSize [get, set]
 Read the file size of every Record in the constructor. This is a time-costly operation and can lead to stuttering. More...
 
bool AutoUpdate [get, set]
 Auto-update the record list. More...
 
bool isReady [get, set]
 Checks if the provider is ready to work. More...
 
System.Collections.Generic.List< Crosstales.DJ.Model.RecordRecords [get]
 Returns the list of all audio records from this provider. More...
 
double TotalPlaytime [get]
 Returns the total playtime in seconds from the provider. More...
 
long TotalSize [get]
 Returns the total size in bytes from the provider. More...
 
- Properties inherited from Crosstales.DJ.Provider.IRecordProviderDB
bool hasDBFile [get]
 Checks if the provider has a DB-file. More...
 
string DBFilePath [get]
 Path for the DB file. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Crosstales.DJ.Provider.BaseRecordProvider
static string determineAudioFormatExtension (Crosstales.DJ.Model.Enum.AudioFormat audioFormat=Crosstales.DJ.Model.Enum.AudioFormat.MP3)
 
- Protected Attributes inherited from Crosstales.DJ.Provider.BaseRecordProvider
System.Collections.Generic.List< Crosstales.DJ.Model.Recordrecords = new System.Collections.Generic.List<Crosstales.DJ.Model.Record>()
 
bool loading
 
string errorMessage
 
- Events inherited from Crosstales.DJ.Provider.BaseRecordProvider
Crosstales.DJ.RecordsChange OnRecordsChange
 An event triggered whenever the records change. More...
 
ProviderReady OnProviderReady
 An event triggered whenever all providers are ready. More...
 
Crosstales.DJ.ErrorProvider OnErrorProvider
 An event triggered whenever an error occurs. More...
 

Detailed Description

Base class (with DB) for all record providers.

Member Function Documentation

◆ DeleteDB()

void Crosstales.DJ.Provider.BaseRecordProviderDB.DeleteDB ( )

Deletes the DB file.

Implements Crosstales.DJ.Provider.IRecordProviderDB.

◆ Load()

override void Crosstales.DJ.Provider.BaseRecordProviderDB.Load ( bool  forceReload = false)
virtual

Loads all audio records for this provider.

Parameters
forceReloadForce reloading the records (optional).

Reimplemented from Crosstales.DJ.Provider.BaseRecordProvider.

Reimplemented in Crosstales.DJ.Provider.RecordProviderPath.

◆ LoadDB()

virtual void Crosstales.DJ.Provider.BaseRecordProviderDB.LoadDB ( string  filePath = "")
virtual

Loads all audio records for this provider from a DB file.

Parameters
filePathFile path for the DB file (optional).

Implements Crosstales.DJ.Provider.IRecordProviderDB.

◆ SaveDB()

virtual void Crosstales.DJ.Provider.BaseRecordProviderDB.SaveDB ( string  filePath = "")
virtual

Saves all audio records from this provider as a DB file.

Parameters
filePathFile path for the DB file (optional).

Implements Crosstales.DJ.Provider.IRecordProviderDB.

Property Documentation

◆ UseDatabase

bool Crosstales.DJ.Provider.BaseRecordProviderDB.UseDatabase
getset

Use a database file to store the processed records.


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