a4276a0d5d
Set up data structures for holding and playing music
39 lines
838 B
C#
39 lines
838 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace Aurora.Backend.Models
|
|
{
|
|
public class LocalSong : BaseSong
|
|
{
|
|
public LocalSong(FileInfo fileInfo)
|
|
{
|
|
File = fileInfo;
|
|
}
|
|
|
|
#region Properties
|
|
public FileInfo File { get; private set; }
|
|
|
|
#endregion Properties
|
|
|
|
public override void Load()
|
|
{
|
|
if (this.DataStream != null)
|
|
{
|
|
DataStream.Close();
|
|
DataStream = null;
|
|
}
|
|
this.DataStream = System.IO.File.OpenRead(File.FullName);
|
|
base.Load();
|
|
}
|
|
|
|
public override void Unload()
|
|
{
|
|
if (this.DataStream != null)
|
|
{
|
|
DataStream.Close();
|
|
DataStream = null;
|
|
}
|
|
base.Unload();
|
|
}
|
|
}
|
|
} |