Migrate aurora-sharp-desktop
This commit is contained in:
63
aurora-sharp-desktop/Aurora/Models/Media/BaseMedia.cs
Normal file
63
aurora-sharp-desktop/Aurora/Models/Media/BaseMedia.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Aurora.Models.Media
|
||||
{
|
||||
public abstract class BaseMedia
|
||||
{
|
||||
private Stream _stream;
|
||||
|
||||
public BaseMedia()
|
||||
{
|
||||
//TODO need to make sure this is unique
|
||||
Id = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
#region Properties
|
||||
public string Id { get; protected set; }
|
||||
|
||||
public abstract MediaTypeEnum MediaType { get; }
|
||||
|
||||
public abstract BaseMetadata Metadata { get; protected set; }
|
||||
|
||||
public bool IsLoaded
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataStream != null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
public virtual Task Load()
|
||||
{
|
||||
return Task.FromResult(default(object));
|
||||
}
|
||||
|
||||
public virtual void Unload()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data stream that holds the song.
|
||||
/// </summary>
|
||||
/// <value>The data stream.</value>
|
||||
public Stream DataStream
|
||||
{
|
||||
get
|
||||
{
|
||||
return _stream;
|
||||
}
|
||||
protected set
|
||||
{
|
||||
if (value != _stream)
|
||||
{
|
||||
_stream = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user