Import basic interface files

develop
LEdoian 4 years ago
parent 14aef4cccb
commit 5b73f1750f

@ -0,0 +1,59 @@
using System;
using System.IO;
namespace QuickPlayer
{
/// <summary>
/// Application (global) configuration data class
/// </summary>
class AppConfiguration
{
}
/// <summary>
/// Configuration of the player.
///
/// Contains details about connection, configured songs &c.
/// </summary>
class PlayerConfiguration
{
public static PlayerConfiguration FromFile(StreamReader reader)
{
return null; // FIXME: Implement
}
}
interface IPlayerConfigurationProvider
{
PlayerConfiguration GetConfiguration();
}
sealed class NetworkConfigurationProvider : IPlayerConfigurationProvider
{
}
sealed class FileConfigurationProvider : IPlayerConfigurationProvider
{
public readonly StreamReader reader;
public FileConfigurationProvider(StreamReader reader)
{
this.reader = reader;
}
public FileConfigurationProvider(string filename)
{
this.reader = new StreamReader(filename);
}
public PlayerConfiguration GetConfiguration()
{
return PlayerConfiguration.FromFile(reader);
}
}
sealed class DummyConfigurationProvider : IPlayerConfigurationProvider
{
public PlayerConfiguration GetConfiguration() => null;
}
}

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
// MPD client abstractions and simplifications
namespace QuickPlayer
{
/// <summary>
/// Simplified abstraction of possible players. Only methods needed are included.
///
/// That means that the interface may be extended in the future, which is sad.
/// </summary>
interface IPlayer
{
void Play(string identifier);
float CurrentProgress { get; }
bool IsReady { get; }
void SetReasonableOptions(); //TODO
}
/// <summary>
/// A simple dataclass to hold auxiliary data of the Playable objects.
/// </summary>
// This is not really an interface, but since it is a dataclass, I treat it
// more as a part of interface, so it belongs to this file.
class PlayableMetadata
{
public readonly TimeSpan usualPlayingTime;
}
interface IPlayable
{
void Play();
string Identifier { get; }
PlayableMetadata Metadata { get; }
}
interface ILayout
{
// TODO
}
interface ILayoutStrategy
{
ILayout LayOut(ICollection<IPlayable> playables);
}
}
Loading…
Cancel
Save