diff --git a/QuickPlay/Interfaces.cs b/QuickPlay/Interfaces.cs
index 6c25806..1d0e079 100644
--- a/QuickPlay/Interfaces.cs
+++ b/QuickPlay/Interfaces.cs
@@ -25,11 +25,8 @@ namespace QuickPlay
/// Since this operation can be asynchronous, we cannot put it in th
/// constructor. And this allows for some tweaks before connecting.
///
- ///
- /// Context to run possible services from.
- ///
///
- Task ConnectAsync(Context context);
+ Task ConnectAsync();
}
///
/// A simple dataclass to hold auxiliary data of the Playable objects.
diff --git a/QuickPlay/MainActivity.cs b/QuickPlay/MainActivity.cs
index 4420148..40d146c 100644
--- a/QuickPlay/MainActivity.cs
+++ b/QuickPlay/MainActivity.cs
@@ -40,7 +40,7 @@ namespace QuickPlay
currentPlayer = playerConfig.GetPlayer();
try
{
- await currentPlayer.ConnectAsync(this);
+ await currentPlayer.ConnectAsync();
} catch (CannotConnectException e)
{
//TODO: View a toast with details and change some colors?
diff --git a/QuickPlay/MpdMonitorService.cs b/QuickPlay/MpdMonitorService.cs
index 6de4936..3075524 100644
--- a/QuickPlay/MpdMonitorService.cs
+++ b/QuickPlay/MpdMonitorService.cs
@@ -17,6 +17,7 @@ namespace QuickPlay
public override void OnCreate()
{
base.OnCreate();
+ // TODO: Create the watching thread
}
public override IBinder OnBind(Intent intent)
{
diff --git a/QuickPlay/MpdPlayer.cs b/QuickPlay/MpdPlayer.cs
index b83bcb1..228710f 100644
--- a/QuickPlay/MpdPlayer.cs
+++ b/QuickPlay/MpdPlayer.cs
@@ -16,7 +16,6 @@ namespace QuickPlay
class MpdPlayer: IPlayer
{
MpcCoreClient mpd;
- Thread serviceThread;
// MpcCore uses strings, so be it
string mpdIP, mpdPort;
@@ -49,7 +48,7 @@ namespace QuickPlay
mpdPort = connDetails.Length >=2 ? connDetails[1] : "6600"; // XXX: Unneccessary default here...
// Connecting and monitoring remote player is done in ConnectAsync.
}
- public async Task ConnectAsync(Context ctx)
+ public async Task ConnectAsync()
{
// Create a persistent connection
var conn = new MpcCoreConnection(mpdIP, mpdPort);
@@ -62,12 +61,8 @@ namespace QuickPlay
throw new CannotConnectException("MPD connect failed", e);
}
// Start the monitoring service
- Console.WriteLine("Hello! Will run thr.");
- serviceThread = new Thread(() =>
- {
- var intent = new Intent(ctx, typeof(MpdMonitorService));
- });
- Console.WriteLine("Thread possibly started");
+ var ctx = Android.App.Application.Context;
+ var intent = new Intent(ctx, typeof(MpdMonitorService));
}
}
}
\ No newline at end of file