diff --git a/Aurora/Design/Views/Party/PartyView.xaml b/Aurora/Design/Views/Party/PartyView.xaml
index e6b7f50..799ce28 100644
--- a/Aurora/Design/Views/Party/PartyView.xaml
+++ b/Aurora/Design/Views/Party/PartyView.xaml
@@ -23,7 +23,8 @@
Members="{Binding Members}"/>
-
+
_members;
+ private ObservableCollection _queue;
+
public PartyViewModel()
{
this.JoinCommand = new Command(OnJoinExecute, CanJoinExecute);
this.HostCommand = new Command(OnHostExecute, CanHostExecute);
_members = new ObservableCollection();
+ _queue = new ObservableCollection();
SetState(PartyState.SelectingHost);
@@ -69,6 +70,21 @@ namespace Aurora.Design.Views.Party
get { return _state != PartyState.SelectingHost; }
}
+ public ObservableCollection Queue
+ {
+ get
+ {
+ return _queue;
+ }
+ set
+ {
+ if (value != _queue)
+ {
+ SetProperty(ref _queue, value);
+ }
+ }
+ }
+
public Command JoinCommand { get; set; }
public Command HostCommand { get; set; }
@@ -189,6 +205,14 @@ namespace Aurora.Design.Views.Party
Console.WriteLine(string.Format("CLIENT {0} - SubscribeToEvents called from client with id", SettingsService.Instance.ClientId));
ClientService.Instance.RemoteEventClient.SubscribeToEvents(req);
+
+ QueueResponse queueResponse = ClientService.Instance.RemotePartyClient.GetQueue(new Empty());
+
+ Queue.Clear();
+ foreach (RemoteMediaData data in queueResponse.MediaList)
+ {
+ Queue.Add(data);
+ }
}
catch (Exception ex)
{
diff --git a/Aurora/Proto/party.proto b/Aurora/Proto/party.proto
index 4d9fc9d..ed0669c 100644
--- a/Aurora/Proto/party.proto
+++ b/Aurora/Proto/party.proto
@@ -9,6 +9,7 @@ service RemotePartyService {
rpc JoinParty(JoinPartyRequest) returns (JoinPartyResponse);
rpc LeaveParty(LeavePartyRequest) returns (LeavePartyResponse);
rpc GetPartyMembers(Aurora.Proto.General.Empty) returns (MembersResponse);
+ rpc GetQueue(Aurora.Proto.General.Empty) returns (QueueResponse);
}
message JoinPartyRequest {
@@ -34,14 +35,22 @@ message PartyMember {
string ipAddress = 3;
int32 port = 4;
}
-
message MembersResponse {
repeated PartyMember members = 1;
}
-
-
enum PartyJoinedStatusEnum {
Connected = 0;
Disconnected = 1;
}
+
+message QueueResponse{
+ repeated RemoteMediaData mediaList = 1;
+}
+
+message RemoteMediaData {
+ string title = 1;
+ string artist = 2;
+ string album = 3;
+ string duration = 4;
+}
diff --git a/Aurora/RemoteImpl/RemotePartyImpl.cs b/Aurora/RemoteImpl/RemotePartyImpl.cs
index 441bcec..efe1974 100644
--- a/Aurora/RemoteImpl/RemotePartyImpl.cs
+++ b/Aurora/RemoteImpl/RemotePartyImpl.cs
@@ -5,6 +5,9 @@ using System.Linq;
using Aurora.Proto.Party;
using Aurora.Proto.Events;
using Aurora.Services.EventManager;
+using Aurora.Services;
+using Aurora.Models.Media;
+using System.Collections;
namespace Aurora.RemoteImpl
{
@@ -82,5 +85,50 @@ namespace Aurora.RemoteImpl
response.Members.AddRange(_partyMembers);
return Task.FromResult(response);
}
+
+ public override Task GetQueue(Proto.General.Empty empty, Grpc.Core.ServerCallContext context)
+ {
+ //This will change as queuing operation gets solidified
+ //Simply return the hosts library
+
+ ObservableCollection queue = LibraryService.Instance.GetLibrary();
+
+ QueueResponse mediaList = new QueueResponse();
+ foreach (BaseMedia media in queue)
+ {
+ AudioMetadata metadata = new AudioMetadata();
+ try
+ {
+ if (media.Metadata is AudioMetadata)
+ {
+ metadata = media.Metadata as AudioMetadata;
+
+ RemoteMediaData data = new RemoteMediaData();
+ data.Title = metadata.Title == null ? metadata.Title : "";
+ if (metadata.Artist != null)
+ {
+ data.Artist = metadata.Artist;
+ }
+ if (metadata.Album != null)
+ {
+ data.Album = metadata.Album;
+ }
+ if (metadata.Duration != null)
+ {
+ data.Duration = metadata.Duration;
+ }
+
+ mediaList.MediaList.Add(data);
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(string.Format("Error preparing queue: {0}", ex.Message));
+ }
+ }
+
+ return Task.FromResult(mediaList);
+
+ }
}
}
\ No newline at end of file