aurora/Aurora/Models/Media/BaseMedia.cs

64 lines
1.3 KiB
C#
Raw Normal View History

2019-05-20 00:21:54 +00:00
using System;
using System.IO;
using System.Threading.Tasks;
2019-07-05 18:17:09 +00:00
namespace Aurora.Models.Media
{
public abstract class BaseMedia
{
private Stream _stream;
public BaseMedia()
{
//TODO need to make sure this is unique
2019-05-20 00:21:54 +00:00
Id = Guid.NewGuid().ToString();
}
2019-05-20 00:21:54 +00:00
#region Properties
2019-11-04 04:17:34 +00:00
public string Id { get; protected set; }
2019-05-20 00:21:54 +00:00
public abstract MediaTypeEnum MediaType { get; }
public abstract BaseMetadata Metadata { get; protected set; }
public bool IsLoaded
{
get
{
return DataStream != null;
}
}
2019-05-20 00:21:54 +00:00
#endregion Properties
public virtual Task Load()
{
return Task.FromResult(default(object));
}
public virtual void Unload()
{
}
2019-05-20 00:21:54 +00:00
/// <summary>
/// Gets or sets the data stream that holds the song.
2019-05-20 00:21:54 +00:00
/// </summary>
/// <value>The data stream.</value>
public Stream DataStream
{
get
{
return _stream;
}
protected set
{
if (value != _stream)
{
_stream = value;
}
}
}
}
2019-05-20 00:21:54 +00:00
}