Added GetQueue method that returns the hosts library
This commit is contained in:
@ -23,7 +23,8 @@
|
||||
Members="{Binding Members}"/>
|
||||
<Label
|
||||
Text="Queue"/>
|
||||
<qu:Queue/>
|
||||
<qu:Queue
|
||||
ItemsSource="{Binding Queue}"/>
|
||||
</StackLayout>
|
||||
<hs:HostSelector
|
||||
Grid.Row="0"
|
||||
|
@ -1,16 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System.Linq;
|
||||
using Xamarin.Forms;
|
||||
using Grpc.Core;
|
||||
using Aurora.Services;
|
||||
using Aurora.Proto.General;
|
||||
using Aurora.Proto.Party;
|
||||
using Aurora.Proto.Playback;
|
||||
using Aurora.Proto.Events;
|
||||
using Aurora.Services.ClientService;
|
||||
using Aurora.Models.Media;
|
||||
|
||||
namespace Aurora.Design.Views.Party
|
||||
{
|
||||
@ -27,12 +25,15 @@ namespace Aurora.Design.Views.Party
|
||||
private string _hostname;
|
||||
private ObservableCollection<PartyMember> _members;
|
||||
|
||||
private ObservableCollection<RemoteMediaData> _queue;
|
||||
|
||||
public PartyViewModel()
|
||||
{
|
||||
this.JoinCommand = new Command(OnJoinExecute, CanJoinExecute);
|
||||
this.HostCommand = new Command(OnHostExecute, CanHostExecute);
|
||||
|
||||
_members = new ObservableCollection<PartyMember>();
|
||||
_queue = new ObservableCollection<RemoteMediaData>();
|
||||
|
||||
SetState(PartyState.SelectingHost);
|
||||
|
||||
@ -69,6 +70,21 @@ namespace Aurora.Design.Views.Party
|
||||
get { return _state != PartyState.SelectingHost; }
|
||||
}
|
||||
|
||||
public ObservableCollection<RemoteMediaData> 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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user