Add Network Cue class. Closes #12

This commit is contained in:
2021-07-17 20:33:27 -05:00
parent e455b42b72
commit cd6115bfbc
2 changed files with 103 additions and 0 deletions
+12
View File
@@ -229,6 +229,18 @@
public const string OutputSize = "outputSize"; //Implement on Text Cue
//Light Cue Keys
public const string AlwaysCollate = "alwaysCollate";
public const string CollateAndStart = "collateAndStart";
public const string LightCommandText = "lightCommandText";
public const string Prune = "prune";
public const string PruneCommands = "pruneCommands";
public const string RemoveLightCommandsMatching = "removeLightCommandsMatching";
public const string ReplaceLightCommand = "replaceLightCommand";
public const string SafeSort = "safeSort";
public const string SafeSortCommands = "safeSortCommands";
public const string SetLight = "setLight";
public const string UpdateLightCommand = "updateLightCommand";
//Fade Cue Keys
//Network Cue Keys
public const string CustomString = "customString";
+91
View File
@@ -0,0 +1,91 @@
using QControlKit.Constants;
namespace QControlKit.Cue
{
public class QLightCue : QCue
{
public bool alwaysCollate
{
get
{
return (bool)propertyForKey(QOSCKey.AlwaysCollate);
}
set
{
setProperty(value, QOSCKey.AlwaysCollate);
}
}
public string lightCommandText
{
get
{
return propertyForKey(QOSCKey.LightCommandText).ToString();
}
set
{
setProperty(value, QOSCKey.LightCommandText);
}
}
public void collateAndStart()
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.CollateAndStart}");
}
public void prune()
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.Prune}");
}
public void pruneCommands()
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.PruneCommands}");
}
public void removeLightCommandsMatching(string match)
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.RemoveLightCommandsMatching}", match);
}
public void replaceLightCommand(string oldCommand, string newCommand)
{
if(this.workspace.versionParts[0] == "4" && int.Parse(this.workspace.versionParts[1]) >= 4)
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.ReplaceLightCommand}", oldCommand, newCommand);
}
else
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.UpdateLightCommand}", oldCommand, newCommand);
}
}
public void safeSort()
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.SafeSort}");
}
public void safeSortCommands()
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.SafeSortCommands}");
}
public void setLight(string light, object setting)
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.SetLight}", light, setting);
}
public void updateLightCommand(string oldCommand, string newCommand)
{
if (int.Parse(this.workspace.versionParts[0]) >= 4 && int.Parse(this.workspace.versionParts[1]) >= 4)
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.ReplaceLightCommand}", oldCommand, newCommand);
}
else
{
workspace.sendMessage($"/cue_id/{this.propertyForKey(QOSCKey.UID)}/{QOSCKey.UpdateLightCommand}", oldCommand, newCommand);
}
}
}
}