1 Commits

Author SHA1 Message Date
jwetzell 96adbadbd7 * QCue.cs: Add child cue sorting
* QControlKit.csproj: Update Versions

* QMessage.cs:
* QWorkspace.cs:
* CueListPage.xaml.cs: Cleanup TODO's and Logging
2021-06-20 18:50:39 -05:00
5 changed files with 22 additions and 34 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
<Authors>Joel Wetzell</Authors>
<Version>1.0.0-devel</Version>
<PackOnBuild>true</PackOnBuild>
<PackageVersion>0.0.17</PackageVersion>
<PackageVersion>0.0.18</PackageVersion>
<PackageId>QControlKit</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Summary>Unofficial C# port of Figure53's QLabKit.objc</Summary>
@@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Zeroconf" Version="3.4.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Constants\" />
+3 -4
View File
@@ -186,7 +186,7 @@ namespace QControlKit
childCues.Add(cue);
childCuesUIDMap.Add(uid, cue);
//some sorting of the childCues needs to be done? //TODO
//reset sorting index
//reset sorting index?
}
public void removeChildCue(QCue cue) {
@@ -730,7 +730,8 @@ namespace QControlKit
if (needsSortChildCues)
{
//something about cues needing to be sorted?
childCues.Sort((q1, q2)=> q1.sortIndex.CompareTo(q2.sortIndex));
needsSortChildCues = false;
}
return needsNotifyCueUpdated;
@@ -873,8 +874,6 @@ namespace QControlKit
else
cueData.Remove(key);
//TODO: Cuelistchangedplaybackpositionid?
}
else
{
+4 -9
View File
@@ -129,19 +129,14 @@ namespace QControlKit
{
get
{
if (IsCueUpdate)
{
if (IsCueUpdate) {
return AddressParts[4];
}else if (IsPlaybackPositionUpdate)
{
} else if (IsPlaybackPositionUpdate) {
//TODO: check string cast
return arguments.Count > 0 ? (string)arguments[0] : null;
}else if (IsReplyFromCue)
{
} else if (IsReplyFromCue) {
return AddressParts[2];
}
else
{
} else {
return null;
}
}
+5 -14
View File
@@ -1,5 +1,4 @@
//TODO: workspace connection error handlers
using Newtonsoft.Json;
using Newtonsoft.Json;
using Serilog;
using System;
using System.Collections.Generic;
@@ -160,7 +159,7 @@ namespace QControlKit
public List<QCue> cueLists { get { return root.cues; } }
public string fullNameWithCueList(QCue cueList) { return ""; }
//TODO other convenience methods
public string[] versionParts { get { return version.Split('.'); } }
public bool connectedToQLab3 { get { return versionParts[0] == "3"; } }
@@ -193,10 +192,9 @@ namespace QControlKit
private void finishConnection()
{
//TODO
connected = true;
startReceivingUpdates();
//fetchQLabVersion();
//fetchQLabVersion(); //this is not needed since the version is loaded from the workspace info call
fetchCueLists();
}
@@ -210,7 +208,6 @@ namespace QControlKit
else
connect();
//todo
}
public void disconnect()
@@ -225,9 +222,6 @@ namespace QControlKit
connected = false;
client.disconnect();
//TODO
//root.removeAllChildCues();
}
@@ -256,8 +250,8 @@ namespace QControlKit
public void stopReceivingUpdates() { client.sendMessage($"{workspacePrefix}/updates", 0); }
public void enableAlwaysReply() { client.sendMessage($"{workspacePrefix}/alwaysReply", 1); }
public void disableAlwaysReply() { client.sendMessage($"{workspacePrefix}/alwaysReply", 0); }
public void fetchQLabVersion() { client.sendMessage($"{workspacePrefix}/version"); } //TODO: EventHandler for this? Is this still needed?
public void fetchCueLists() { client.sendMessage($"{workspacePrefix}/cueLists"); } //TODO: EventHandler for CueListUpdated
public void fetchQLabVersion() { client.sendMessage($"{workspacePrefix}/version"); }
public void fetchCueLists() { client.sendMessage($"{workspacePrefix}/cueLists"); }
public void fetchPlaybackPositionForCue(QCue cue) { client.sendMessage(addressForCue(cue, QOSCKey.PlaybackPositionId)); } //EventHandler for this? can I use the CueListPlaybackPosition one?
public void go() { client.sendMessage($"{workspacePrefix}/go"); }
public void save() { client.sendMessage($"{workspacePrefix}/save"); }
@@ -356,8 +350,6 @@ namespace QControlKit
#endregion
#region Property Fetching
//TODO
public void fetchDefaultPropertiesForCue(QCue cue)
{
@@ -536,7 +528,6 @@ namespace QControlKit
cueList.setProperty(args.cueID, QOSCKey.PlaybackPositionId, false);
}
//TODO: need to implement when playbackposition is "none"
Log.Debug($"[workspace] cue list <{args.cueListID}> playback position changed to <{args.cueID}>");
CueListChangedPlaybackPosition?.Invoke(this, new QCueListChangedPlaybackPositionArgs { cueListID = args.cueListID, cueID = args.cueID });
@@ -51,12 +51,15 @@ namespace QControlKitXamDemo
Device.BeginInvokeOnMainThread(() =>
{
QCue selectedCue = connectedWorkspace.cueWithID(args.cueID);
connectedWorkspace.fetchDefaultPropertiesForCue(selectedCue);
selectedCueGrid.BindingContext = new QCueViewModel(selectedCue, false);
if (cueGridDict.ContainsKey(args.cueID))
if(selectedCue != null) //TODO: I think this being null is the result of a race condition?
{
var cueGrid = cueGridDict[args.cueID]; //element to scroll to
cueListScrollView.ScrollToAsync(cueGrid, ScrollToPosition.Center, true);
connectedWorkspace.fetchDefaultPropertiesForCue(selectedCue);
selectedCueGrid.BindingContext = new QCueViewModel(selectedCue, false);
if (cueGridDict.ContainsKey(args.cueID))
{
var cueGrid = cueGridDict[args.cueID]; //element to scroll to
cueListScrollView.ScrollToAsync(cueGrid, ScrollToPosition.Center, true);
}
}
});
}