Crosstales.DJ.Model.Record Class Reference

Model for an audio record. More...

Public Member Functions

 Record ()
 Default-constructor for a Record. More...
 
 Record (string filePath, bool loadTag=false, bool readFileSize=false)
 Constructor for a Record. More...
 
 Record (Crosstales.DJ.Model.M3UEntry entry, bool loadTag, bool readFileSize)
 Constructor for a Record from an M3UEntry. More...
 
 Record (Crosstales.DJ.Model.PLSEntry entry, bool loadTag, bool readFileSize)
 Constructor for a Record from a PLSEntry. More...
 
 Record (AudioClip clip)
 Constructor for a Record from an AudioClip. More...
 
string MusicInfo (bool forceTag=true, bool withLabel=true, int maxLength=0, bool shortInfo=false)
 Shows the complete record data. More...
 
string MusicInfoLabels (bool forceTag=true, bool shortInfo=false)
 Shows the complete record label data. More...
 
string ToShortString ()
 ToString()-variant for displaying the object in the Editor. More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 

Public Attributes

string FilePath
 File path or URL of the audio record. More...
 
AudioClip Clip
 AudioClip of the audio record. More...
 
float Rating
 Your rating of the audio record. More...
 
Sprite Icon
 Icon representing the audio record. More...
 
string IconUrl
 Icon url for the audio record. More...
 
RecordData Data
 Container for the record data. More...
 
bool isLocalFile => !string.IsNullOrEmpty(FilePath) && !FilePath.StartsWith("http", System.StringComparison.OrdinalIgnoreCase)
 Returns true if the file is local. More...
 
string Url => !string.IsNullOrEmpty(FilePath) ? Crosstales.Common.Util.NetworkHelper.GetURLFromFile(FilePath) : string.Empty
 Returns the URL of the audio record. More...
 
bool HasTag => hasID3Tag || hasXiphComment || hasAiffTag
 Has the audio record a tag? More...
 
string TrackInfo => Title + " - " + Artist
 Shows the track info (for UI). More...
 

Properties

bool isTagLoaded [get, set]
 Returns the loading state of the tag. More...
 
bool isFileSizeLoaded [get, set]
 Returns the loading state of the file size. More...
 
bool isInfoLoaded [get, set]
 Returns the loading state of the information. More...
 
string? Name [get, set]
 Returns the name of the audio record. More...
 
string Title [get, set]
 Returns the title of the audio record. More...
 
string Artist [get, set]
 Returns the artist of the audio record. More...
 
string Album [get, set]
 Returns the album of the audio record. More...
 
float? Duration [get, set]
 Duration in seconds of the audio record. More...
 
string Genre [get, set]
 Returns the genre of the audio record. More...
 
int Year [get, set]
 Returns the year of the audio record. More...
 
long FileSize [get, set]
 The file size in bytes of the audio record. This is a time-costly operation for the first call. More...
 
Crosstales.TagLib.Tag Tag [get]
 Returns the tag of the audio record. This is a time-costly operation for the first call. More...
 
Texture? CoverAsTexture [get]
 Returns the cover image of the audio record as Texture. More...
 
Sprite? CoverAsSprite [get]
 Returns the cover image of the audio record as Sprite. More...
 
Crosstales.DJ.Model.Enum.AudioFormat Format [get, set]
 Returns the audio format of the record. More...
 
int Channels [get, set]
 Returns the channels of the audio record. More...
 
int SampleRate [get, set]
 Returns the sample rate of the audio record. More...
 
string SpotifyUrl [get, set]
 Returns the Spotify-url for the record. More...
 
string LyricsUrl [get, set]
 Returns the lyrics-url for the record. More...
 
int Bitrate [get, set]
 Bitrate in kbit/s. More...
 

Detailed Description

Model for an audio record.

Constructor & Destructor Documentation

◆ Record() [1/5]

Crosstales.DJ.Model.Record.Record ( )

Default-constructor for a Record.

◆ Record() [2/5]

Crosstales.DJ.Model.Record.Record ( string  filePath,
bool  loadTag = false,
bool  readFileSize = false 
)

Constructor for a Record.

Parameters
filePathFile path to the record.
loadTagLoad the tag of the Record. This is a time-costly operation and can lead to stuttering (default: false).
readFileSizeRead the file size of the Record. This is a time-costly operation and can lead to stuttering (default: false).

◆ Record() [3/5]

Crosstales.DJ.Model.Record.Record ( Crosstales.DJ.Model.M3UEntry  entry,
bool  loadTag,
bool  readFileSize 
)

Constructor for a Record from an M3UEntry.

Parameters
entryM3UEntry.
loadTagLoad the tag of the Record. This is a time-costly operation and can lead to stuttering.
readFileSizeRead the file size of the Record. This is a time-costly operation and can lead to stuttering.

◆ Record() [4/5]

Crosstales.DJ.Model.Record.Record ( Crosstales.DJ.Model.PLSEntry  entry,
bool  loadTag,
bool  readFileSize 
)

Constructor for a Record from a PLSEntry.

Parameters
entryPLSEntry.
loadTagLoad the tag of the Record. This is a time-costly operation and can lead to stuttering.
readFileSizeRead the file size of the Record. This is a time-costly operation and can lead to stuttering.

◆ Record() [5/5]

Crosstales.DJ.Model.Record.Record ( AudioClip  clip)

Constructor for a Record from an AudioClip.

Parameters
clipAudioClip.

Member Function Documentation

◆ MusicInfo()

string Crosstales.DJ.Model.Record.MusicInfo ( bool  forceTag = true,
bool  withLabel = true,
int  maxLength = 0,
bool  shortInfo = false 
)

Shows the complete record data.

Parameters
forceTagForce using tag information (default: true, optional)
withLabelAdd the label for every information (default: true, optional)
maxLengthMaximal length of a row (default: 0 (= unlimited), optional)
shortInfoReduced information (default: false, optional)
Returns
The complete record data.

◆ MusicInfoLabels()

string Crosstales.DJ.Model.Record.MusicInfoLabels ( bool  forceTag = true,
bool  shortInfo = false 
)

Shows the complete record label data.

Parameters
forceTagForce using tag information (default: true, optional)
shortInfoReduced information (default: false, optional)
Returns
The complete record label data.

◆ ToShortString()

string Crosstales.DJ.Model.Record.ToShortString ( )

ToString()-variant for displaying the object in the Editor.

Returns
Text description of the object.

Member Data Documentation

◆ Clip

AudioClip Crosstales.DJ.Model.Record.Clip

AudioClip of the audio record.

◆ Data

RecordData Crosstales.DJ.Model.Record.Data

Container for the record data.

◆ FilePath

string Crosstales.DJ.Model.Record.FilePath

File path or URL of the audio record.

◆ HasTag

bool Crosstales.DJ.Model.Record.HasTag => hasID3Tag || hasXiphComment || hasAiffTag

Has the audio record a tag?

Returns
True if the audio record has a tag.

◆ Icon

Sprite Crosstales.DJ.Model.Record.Icon

Icon representing the audio record.

◆ IconUrl

string Crosstales.DJ.Model.Record.IconUrl

Icon url for the audio record.

◆ isLocalFile

bool Crosstales.DJ.Model.Record.isLocalFile => !string.IsNullOrEmpty(FilePath) && !FilePath.StartsWith("http", System.StringComparison.OrdinalIgnoreCase)

Returns true if the file is local.

Returns
True if the file is local.

◆ Rating

float Crosstales.DJ.Model.Record.Rating

Your rating of the audio record.

◆ TrackInfo

string Crosstales.DJ.Model.Record.TrackInfo => Title + " - " + Artist

Shows the track info (for UI).

Returns
The the track info (for UI).

◆ Url

string Crosstales.DJ.Model.Record.Url => !string.IsNullOrEmpty(FilePath) ? Crosstales.Common.Util.NetworkHelper.GetURLFromFile(FilePath) : string.Empty

Returns the URL of the audio record.

Returns
The URL of the audio record.

Property Documentation

◆ Album

string Crosstales.DJ.Model.Record.Album
getset

Returns the album of the audio record.

Returns
Album of the audio record.

◆ Artist

string Crosstales.DJ.Model.Record.Artist
getset

Returns the artist of the audio record.

Returns
Artist of the audio record.

◆ Bitrate

int Crosstales.DJ.Model.Record.Bitrate
getset

Bitrate in kbit/s.

Returns
Bitrate in kbit/s.

◆ Channels

int Crosstales.DJ.Model.Record.Channels
getset

Returns the channels of the audio record.

Returns
Channels of the audio record.

◆ CoverAsSprite

Sprite? Crosstales.DJ.Model.Record.CoverAsSprite
get

Returns the cover image of the audio record as Sprite.

Returns
The cover image of the audio record as Sprite.

◆ CoverAsTexture

Texture? Crosstales.DJ.Model.Record.CoverAsTexture
get

Returns the cover image of the audio record as Texture.

Returns
The cover image of the audio record as Texture.

◆ Duration

float? Crosstales.DJ.Model.Record.Duration
getset

Duration in seconds of the audio record.

◆ FileSize

long Crosstales.DJ.Model.Record.FileSize
getset

The file size in bytes of the audio record. This is a time-costly operation for the first call.

Returns
The file size in bytes of the audio record.

◆ Format

Crosstales.DJ.Model.Enum.AudioFormat Crosstales.DJ.Model.Record.Format
getset

Returns the audio format of the record.

Returns
The audio format of the record.

◆ Genre

string Crosstales.DJ.Model.Record.Genre
getset

Returns the genre of the audio record.

Returns
Genre of the audio record.

◆ isFileSizeLoaded

bool Crosstales.DJ.Model.Record.isFileSizeLoaded
getset

Returns the loading state of the file size.

Returns
The loading state of the file size.

◆ isInfoLoaded

bool Crosstales.DJ.Model.Record.isInfoLoaded
getset

Returns the loading state of the information.

Returns
The loading state of the information.

◆ isTagLoaded

bool Crosstales.DJ.Model.Record.isTagLoaded
getset

Returns the loading state of the tag.

Returns
The loading state of the tag.

◆ LyricsUrl

string Crosstales.DJ.Model.Record.LyricsUrl
getset

Returns the lyrics-url for the record.

Returns
Lyrics-url for the record.

◆ Name

string? Crosstales.DJ.Model.Record.Name
getset

Returns the name of the audio record.

Returns
The name of the audio record.

◆ SampleRate

int Crosstales.DJ.Model.Record.SampleRate
getset

Returns the sample rate of the audio record.

Returns
Sample rate of the audio record.

◆ SpotifyUrl

string Crosstales.DJ.Model.Record.SpotifyUrl
getset

Returns the Spotify-url for the record.

Returns
Spotify-url for the record.

◆ Tag

Crosstales.TagLib.Tag Crosstales.DJ.Model.Record.Tag
get

Returns the tag of the audio record. This is a time-costly operation for the first call.

Returns
The tag of the audio record.

◆ Title

string Crosstales.DJ.Model.Record.Title
getset

Returns the title of the audio record.

Returns
Title of the audio record.

◆ Year

int Crosstales.DJ.Model.Record.Year
getset

Returns the year of the audio record.

Returns
Year of the audio record.

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