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