diff --git a/QControlKit/QClient.cs b/QControlKit/QClient.cs index 7ec54db..84cf8ea 100644 --- a/QControlKit/QClient.cs +++ b/QControlKit/QClient.cs @@ -196,7 +196,7 @@ namespace QControlKit protected virtual void OnWorkspaceUpdated() { - Log.Debug($"[client] Workspace Updated"); + //Log.Debug($"[client] Workspace Updated"); WorkspaceUpdated?.Invoke(this, new QWorkspaceUpdatedArgs()); } diff --git a/QControlKit/QServerInfo.cs b/QControlKit/QServerInfo.cs new file mode 100644 index 0000000..13e021e --- /dev/null +++ b/QControlKit/QServerInfo.cs @@ -0,0 +1,8 @@ +namespace QControlKit +{ + public class QServerInfo + { + public string host { get; set; } + public int port { get; set; } + } +} diff --git a/QControlKit/QWorkspace.cs b/QControlKit/QWorkspace.cs index e353316..025e734 100644 --- a/QControlKit/QWorkspace.cs +++ b/QControlKit/QWorkspace.cs @@ -98,6 +98,26 @@ namespace QControlKit return didUpdate; } + public QWorkspaceInfo getWorkspaceInfo() + { + return new QWorkspaceInfo + { + displayName = name, + hasPasscode = hasPasscode, + version = version, + uniqueID = uniqueID, + }; + } + + public QServerInfo GetServerInfo() + { + return new QServerInfo + { + host = server.host, + port = server.port + }; + } + public string description { get { return $"{name} : {uniqueID}"; } } public bool isOlderThanVersion(string version) diff --git a/QControlKitXamDemo/QControlKitXamDemo/CueListPage.xaml.cs b/QControlKitXamDemo/QControlKitXamDemo/CueListPage.xaml.cs index 7e7f339..73c4cf0 100644 --- a/QControlKitXamDemo/QControlKitXamDemo/CueListPage.xaml.cs +++ b/QControlKitXamDemo/QControlKitXamDemo/CueListPage.xaml.cs @@ -64,24 +64,20 @@ namespace QControlKitXamDemo void Workspace_WorkspaceUpdated(object source, QWorkspaceUpdatedArgs args) { - foreach (var cue in connectedWorkspace.cueLists) + if(connectedWorkspace.cueLists.Count > 0) { - if(cue.cues.Count > 0) + List cueAddTasks = new List(); + foreach(var aCue in connectedWorkspace.cueLists) { - List cueAddTasks = new List(); - foreach(var aCue in cue.cues) + Grid cueGrid = cueToGrid(aCue); + cueGridDict.Add(aCue.uid, cueGrid); + MainThread.InvokeOnMainThreadAsync(() => { - Grid cueGrid = cueToGrid(aCue); - cueGridDict.Add(aCue.uid, cueGrid); - MainThread.InvokeOnMainThreadAsync(() => - { - cueListsGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); - cueListsGrid.Children.Add(cueGrid, 0, aCue.sortIndex); - }).Wait(); - } - connectedWorkspace.valueForKey(cue, QOSCKey.PlaybackPositionId); //fetch playback position for cueList once all cue loading is done. - break; //only load first cue list with cues. + cueListsGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); + cueListsGrid.Children.Add(cueGrid, 0, aCue.sortIndex); + }).Wait(); } + connectedWorkspace.valueForKey(connectedWorkspace.firstCueList, QOSCKey.PlaybackPositionId); //fetch playback position for cueList once all cue loading is done. } }