|
|
@ -16,7 +16,6 @@ namespace QuickPlay
|
|
|
|
class MpdPlayer: IPlayer
|
|
|
|
class MpdPlayer: IPlayer
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MpcCoreClient mpd;
|
|
|
|
MpcCoreClient mpd;
|
|
|
|
Thread serviceThread;
|
|
|
|
|
|
|
|
// MpcCore uses strings, so be it
|
|
|
|
// MpcCore uses strings, so be it
|
|
|
|
string mpdIP, mpdPort;
|
|
|
|
string mpdIP, mpdPort;
|
|
|
|
|
|
|
|
|
|
|
@ -49,7 +48,7 @@ namespace QuickPlay
|
|
|
|
mpdPort = connDetails.Length >=2 ? connDetails[1] : "6600"; // XXX: Unneccessary default here...
|
|
|
|
mpdPort = connDetails.Length >=2 ? connDetails[1] : "6600"; // XXX: Unneccessary default here...
|
|
|
|
// Connecting and monitoring remote player is done in ConnectAsync.
|
|
|
|
// Connecting and monitoring remote player is done in ConnectAsync.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public async Task ConnectAsync(Context ctx)
|
|
|
|
public async Task ConnectAsync()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Create a persistent connection
|
|
|
|
// Create a persistent connection
|
|
|
|
var conn = new MpcCoreConnection(mpdIP, mpdPort);
|
|
|
|
var conn = new MpcCoreConnection(mpdIP, mpdPort);
|
|
|
@ -62,12 +61,8 @@ namespace QuickPlay
|
|
|
|
throw new CannotConnectException("MPD connect failed", e);
|
|
|
|
throw new CannotConnectException("MPD connect failed", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Start the monitoring service
|
|
|
|
// Start the monitoring service
|
|
|
|
Console.WriteLine("Hello! Will run thr.");
|
|
|
|
var ctx = Android.App.Application.Context;
|
|
|
|
serviceThread = new Thread(() =>
|
|
|
|
var intent = new Intent(ctx, typeof(MpdMonitorService));
|
|
|
|
{
|
|
|
|
|
|
|
|
var intent = new Intent(ctx, typeof(MpdMonitorService));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Console.WriteLine("Thread possibly started");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|