|
|
|
@ -104,6 +104,11 @@ namespace QuickPlay
|
|
|
|
|
}
|
|
|
|
|
#pragma warning restore CS0659
|
|
|
|
|
|
|
|
|
|
public enum PlayerType
|
|
|
|
|
{
|
|
|
|
|
MPD,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Configuration of the player.
|
|
|
|
|
///
|
|
|
|
@ -111,8 +116,10 @@ namespace QuickPlay
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class PlayerConfiguration
|
|
|
|
|
{
|
|
|
|
|
Dictionary<string, IPlayable> songs;
|
|
|
|
|
string playerName;
|
|
|
|
|
public Dictionary<string, IPlayable> songs;
|
|
|
|
|
public string playerName;
|
|
|
|
|
public PlayerType playerType;
|
|
|
|
|
public string playerConnectionDetails; // This is opaque to this class, the player will make sense of it.
|
|
|
|
|
|
|
|
|
|
public static PlayerConfiguration FromFile(StreamReader reader)
|
|
|
|
|
{
|
|
|
|
@ -125,6 +132,8 @@ namespace QuickPlay
|
|
|
|
|
if (elem.Key == "general")
|
|
|
|
|
{
|
|
|
|
|
result.playerName = elem.Value["name"];
|
|
|
|
|
result.playerType = PlayerType.MPD; //FIXME: not always.
|
|
|
|
|
result.playerConnectionDetails = elem.Value["connection"];
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
var song = new Song(elem.Key, elem.Value);
|
|
|
|
@ -136,7 +145,16 @@ namespace QuickPlay
|
|
|
|
|
|
|
|
|
|
public IPlayer GetPlayer()
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
IPlayer result;
|
|
|
|
|
switch (playerType)
|
|
|
|
|
{
|
|
|
|
|
case PlayerType.MPD:
|
|
|
|
|
result = new MpdPlayer(this);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new InvalidOperationException("Cannot happen: Player had no type.");
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|