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/Backend/Models/BaseMedia.cs
watsonb8 93be6dc100 See commit description for changes
Added PageContainer to dynamically load pages within the main content. Added player component to control music playback(Half functional). Added playback changed event not the player service.
2019-05-24 10:27:19 -04:00

88 lines
1.9 KiB
C#

using System;
using System.IO;
namespace Aurora.Backend.Models
{
public abstract class BaseMedia
{
private bool _loaded;
private Stream _stream;
public BaseMedia()
{
_loaded = false;
Id = Guid.NewGuid().ToString();
}
#region Properties
public string Id { get; private set; }
/// <summary>
/// The title of the song.
/// </summary>
/// <value></value>
public string Title { get; set; }
/// <summary>
/// The artist of the song.
/// </summary>
/// <value></value>
public string Artist { get; set; }
/// <summary>
/// The album from which the song belongs.
/// </summary>
/// <value></value>
public string Album { get; set; }
/// <summary>
/// The duration of the song.
/// </summary>
/// <value></value>
public string Duration { get; set; }
/// <summary>
/// Extra data associated with a song.
/// </summary>
/// <value></value>
public object Metadata { get; set; }
#endregion Properties
public virtual void Load()
{
_loaded = true;
}
public virtual void Unload()
{
_loaded = false;
}
/// <summary>
/// Gets or sets the data stream that holds the song.
/// </summary>
/// <value>The data stream.</value>
public Stream DataStream
{
get
{
//if (!_loaded)
//{
// throw new InvalidOperationException("Must be loaded first");
//}
return _stream;
}
protected set
{
if (value != _stream)
{
_stream = value;
}
}
}
}
}