Table of Contents

Class Song

Namespace
RadioExt_Helper.models
Assembly
RadioExt-Helper.dll
Represents a single song entry. Song information is read from the file on disk.
public sealed class Song : IEquatable<Song>, ICloneable
Inheritance
Song
Implements
Inherited Members

Properties

Artist

The artist of the song or audio file.
[JsonProperty("artist")]
public string Artist { get; set; }

Property Value

string

Duration

The duration of the song or audio file.
[JsonProperty("duration")]
public TimeSpan Duration { get; set; }

Property Value

TimeSpan

FilePath

The original file path of the song or audio file on disk.
[JsonProperty("file_path")]
public string FilePath { get; set; }

Property Value

string

FileSize

The file size (in bytes) of the song or audio file.
[JsonProperty("file_size")]
public ulong FileSize { get; set; }

Property Value

ulong

Title

The name of the song.
[JsonProperty("title")]
public string Title { get; set; }

Property Value

string

Methods

Clone()

Creates a new object that is a copy of the current instance.
public object Clone()

Returns

object
A new object that is a copy of this instance.

Equals(Song?)

Indicates whether the current object is equal to another object of the same type.
public bool Equals(Song? other)

Parameters

other Song
An object to compare with this object.

Returns

bool
true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)

Parameters

obj object
The object to compare with the current object.

Returns

bool
true if the specified object is equal to the current object; otherwise, false.

FromFile(string)

Get metadata about an audio file and return a new Song object.
public static Song? FromFile(string filePath)

Parameters

filePath string
The path to the audio file.

Returns

Song
A new Song with the metadata or null if an exception occurred.

GetHashCode()

Serves as the default hash function.
public override int GetHashCode()

Returns

int
A hash code for the current object.

ToString()

Get a display friendly value representing this song.
public override string ToString()

Returns

string
The Title of the song.