mirror of
https://github.com/jwetzell/QControlKit.git
synced 2026-08-04 15:07:59 +00:00
Add Network Cue class. Closes #12
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user