Remote playback almost working
This commit is contained in:
@ -4,7 +4,6 @@ using System.Threading;
|
||||
using Grpc.Core;
|
||||
using Aurora.Proto.Events;
|
||||
using Aurora.Proto.Party;
|
||||
using Aurora.Proto.Playback;
|
||||
using Aurora.Services.ClientService;
|
||||
|
||||
namespace Aurora.Services.ClientService
|
||||
@ -12,7 +11,6 @@ namespace Aurora.Services.ClientService
|
||||
public class ClientService : BaseService<ClientService>
|
||||
{
|
||||
private RemotePartyService.RemotePartyServiceClient _remotePartyClient;
|
||||
private RemotePlaybackService.RemotePlaybackServiceClient _remotePlaybackClient;
|
||||
private RemoteEventService.RemoteEventServiceClient _remoteEventsClient;
|
||||
private Channel _channel;
|
||||
CancellationTokenSource _eventCancellationTokenSource;
|
||||
@ -32,14 +30,6 @@ namespace Aurora.Services.ClientService
|
||||
}
|
||||
}
|
||||
|
||||
public RemotePlaybackService.RemotePlaybackServiceClient RemotePlaybackServiceClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return _remotePlaybackClient;
|
||||
}
|
||||
}
|
||||
|
||||
public RemoteEventService.RemoteEventServiceClient RemoteEventClient
|
||||
{
|
||||
get { return _remoteEventsClient; }
|
||||
@ -50,8 +40,7 @@ namespace Aurora.Services.ClientService
|
||||
get
|
||||
{
|
||||
return _remoteEventsClient != null &&
|
||||
_remotePartyClient != null &&
|
||||
_remotePlaybackClient != null;
|
||||
_remotePartyClient != null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +49,6 @@ namespace Aurora.Services.ClientService
|
||||
_channel = new Channel(string.Format("{0}:{1}", hostname, port), ChannelCredentials.Insecure);
|
||||
|
||||
_remotePartyClient = new RemotePartyService.RemotePartyServiceClient(_channel);
|
||||
_remotePlaybackClient = new RemotePlaybackService.RemotePlaybackServiceClient(_channel);
|
||||
_remoteEventsClient = new RemoteEventService.RemoteEventServiceClient(_channel);
|
||||
|
||||
//Assign but don't start task
|
||||
@ -73,7 +61,6 @@ namespace Aurora.Services.ClientService
|
||||
await _channel.ShutdownAsync();
|
||||
|
||||
_remotePartyClient = null;
|
||||
_remotePlaybackClient = null;
|
||||
_remoteEventsClient = null;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,12 @@ namespace Aurora.Services
|
||||
return collection;
|
||||
}
|
||||
|
||||
public BaseMedia GetSong(string Id)
|
||||
{
|
||||
_library.TryGetValue(Id, out BaseMedia song);
|
||||
return song;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads library from files.
|
||||
/// </summary>
|
||||
|
@ -6,7 +6,6 @@ using Grpc.Core;
|
||||
using Aurora.RemoteImpl;
|
||||
using Aurora.Proto.Events;
|
||||
using Aurora.Proto.Party;
|
||||
using Aurora.Proto.Playback;
|
||||
|
||||
|
||||
namespace Aurora.Services
|
||||
@ -19,7 +18,6 @@ namespace Aurora.Services
|
||||
|
||||
//Implementation class declarations
|
||||
RemotePartyServiceImpl _remotePartyServiceImpl;
|
||||
RemotePlaybackServiceImpl _remotePlaybackImpl;
|
||||
RemoteEventServiceImpl _remoteEventImpl;
|
||||
|
||||
/// <summary>
|
||||
@ -58,7 +56,6 @@ namespace Aurora.Services
|
||||
{
|
||||
return (_remoteEventImpl != null &&
|
||||
_remotePartyServiceImpl != null &&
|
||||
_remotePlaybackImpl != null &&
|
||||
_server != null);
|
||||
}
|
||||
}
|
||||
@ -78,12 +75,10 @@ namespace Aurora.Services
|
||||
{
|
||||
//Construct implementations
|
||||
_remotePartyServiceImpl = new RemotePartyServiceImpl();
|
||||
_remotePlaybackImpl = new RemotePlaybackServiceImpl();
|
||||
_remoteEventImpl = new RemoteEventServiceImpl();
|
||||
|
||||
// Register grpc RemoteService with singleton server service
|
||||
RegisterService(RemotePartyService.BindService(_remotePartyServiceImpl));
|
||||
RegisterService(RemotePlaybackService.BindService(_remotePlaybackImpl));
|
||||
RegisterService(RemoteEventService.BindService(_remoteEventImpl));
|
||||
}
|
||||
_server.Start();
|
||||
|
Reference in New Issue
Block a user