This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Models/Media/BaseMedia.cs

63 lines
1.2 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()
{
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
}