mirror of
https://github.com/jwetzell/QControlKit.git
synced 2026-08-02 22:18:06 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff498f83d0 | |||
| 19794f40a7 | |||
| 6057105f44 | |||
| 66ae48cf33 | |||
| 9601d59d81 | |||
| 406bcc9e7f | |||
| 015913b2a1 | |||
| 6f20d7ba19 | |||
| 6dd0f766e8 | |||
| bd099a2162 | |||
| effd9d3f92 | |||
| e7f60ba782 | |||
| cd6115bfbc | |||
| e455b42b72 | |||
| 6f683ba6e8 | |||
| 3656a9f9b7 | |||
| c750297cf5 | |||
| b639dc401f |
@@ -11,6 +11,7 @@
|
||||
public const string Cue = "Cue";
|
||||
public const string CueList = "Cue List";
|
||||
public const string Cart = "Cart";
|
||||
public const string CueCart = "Cue Cart";
|
||||
public const string Group = "Group";
|
||||
public const string Audio = "";
|
||||
public const string Mic = "Mic";
|
||||
@@ -46,73 +47,231 @@
|
||||
|
||||
public static class QOSCKey
|
||||
{
|
||||
public const string UID = "uniqueID";
|
||||
public const string Type = "type";
|
||||
public const string Parent = "parent";
|
||||
public const string Name = "name";
|
||||
public const string Number = "number";
|
||||
public const string Notes = "notes";
|
||||
public const string FileTarget = "fileTarget";
|
||||
public const string CueTargetNumber = "cueTargetNumber";
|
||||
public const string CurrentCueTarget = "currentCueTarget";
|
||||
public const string ColorName = "colorName";
|
||||
public const string Flagged = "flagged";
|
||||
public const string ActionElapsed = "actionElapsed";
|
||||
public const string AllowsEditingDuration = "allowsEditingDuration";
|
||||
public const string Armed = "armed";
|
||||
public const string AutoLoad = "autoLoad"; //implement on QCue
|
||||
|
||||
public const string CartPosition = "cartPosition";
|
||||
public const string ColorName = "colorName";
|
||||
public const string Cues = "cues";
|
||||
public const string CueTargetNumber = "cueTargetNumber";
|
||||
public const string CueTargetId = "cueTargetId"; //implement on QCue
|
||||
|
||||
public const string CurrentCueTarget = "currentCueTarget";
|
||||
public const string CurrentFileTime = "currentFileTime"; //implement on QCue
|
||||
public const string ContinueMode = "continueMode";
|
||||
public const string CurrentDuration = "currentDuration";
|
||||
|
||||
public const string DefaultName = "defaultName"; //implement on QCue
|
||||
public const string DisplayName = "displayName"; //implement on QCue
|
||||
public const string DuckLevel = "duckLevel"; //implement on QCue
|
||||
public const string DuckOthers = "duckOthers"; //implement on QCue
|
||||
public const string DuckTime = "duckTime"; //implement on QCue
|
||||
|
||||
|
||||
public const string FileTarget = "fileTarget";
|
||||
public const string Flagged = "flagged";
|
||||
public const string FadeAndStopOthers = "fadeAndStopOthers"; //implement on QCue
|
||||
public const string FadeAndStopOthersTime = "fadeAndStopOthersTime"; //implement on QCue
|
||||
|
||||
|
||||
public const string HasFileTargets = "hasFileTargets";
|
||||
public const string HasCueTargets = "hasCueTargets";
|
||||
|
||||
public const string IsActionRunning = "isActionRunning"; //implement on QCue
|
||||
public const string IsBroken = "isBroken";
|
||||
public const string IsLoaded = "isLoaded";
|
||||
public const string IsOverridden = "isOverridden";
|
||||
public const string IsPanicking = "isPanicking";
|
||||
public const string IsPaused = "isPaused";
|
||||
public const string IsRunning = "isRunning";
|
||||
public const string IsTailingOut = "isTailingOut";
|
||||
|
||||
public const string ListName = "listName";
|
||||
public const string LoadAt = "loadAt"; //implement on QCue
|
||||
public const string LoadActionAt = "loadActionAt"; //implement on QCue
|
||||
|
||||
public const string MaxTimeInCueSequence = "maxTimeInCueSequence"; //implement on QCue
|
||||
|
||||
|
||||
public const string Name = "name";
|
||||
public const string Notes = "notes";
|
||||
public const string Number = "number";
|
||||
|
||||
public const string PanicInTime = "panicInTime"; //implement on QCue
|
||||
public const string PreWait = "preWait";
|
||||
public const string PostWait = "postWait";
|
||||
public const string CurrentDuration = "currentDuration";
|
||||
public const string PercentPreWaitElapsed = "percentPreWaitElapsed";
|
||||
public const string PercentPostWaitElapsed = "percentPostWaitElapsed";
|
||||
public const string PercentActionElapsed = "percentActionElapsed";
|
||||
public const string PreWaitElapsed = "preWaitElapsed";
|
||||
public const string Parent = "parent";
|
||||
public const string PostWaitElapsed = "postWaitElapsed";
|
||||
public const string ActionElapsed = "actionElapsed";
|
||||
public const string GroupMode = "mode";
|
||||
public const string CartPosition = "cartPosition";
|
||||
public const string CartRows = "cartRows";
|
||||
public const string CartColumns = "cartColumns";
|
||||
public const string HasFileTargets = "hasFileTargets";
|
||||
public const string HasCueTargets = "hasCueTargets";
|
||||
public const string AllowsEditingDuration = "allowsEditingDuration";
|
||||
public const string IsPanicking = "isPanicking";
|
||||
public const string IsTailingOut = "isTailingOut";
|
||||
public const string IsRunning = "isRunning";
|
||||
public const string IsLoaded = "isLoaded";
|
||||
public const string IsPaused = "isPaused";
|
||||
public const string IsBroken = "isBroken";
|
||||
public const string IsOverridden = "isOverridden";
|
||||
public const string TranslationX = "translationX";
|
||||
public const string TranslationY = "translationY";
|
||||
public const string ScaleX = "scaleX";
|
||||
public const string ScaleY = "scaleY";
|
||||
public const string OriginX = "originX";
|
||||
public const string OriginY = "originY";
|
||||
public const string Quaternion = "quaternion";
|
||||
public const string SurfaceSize = "surfaceSize";
|
||||
public const string CueSize = "cueSize";
|
||||
public const string PreserveAspectRatio = "preserveAspectRatio";
|
||||
public const string Layer = "layer";
|
||||
public const string Patch = "patch";
|
||||
public const string PatchList = "patchList";
|
||||
public const string SurfaceList = "surfaceList";
|
||||
public const string Cues = "cues";
|
||||
public const string Children = "children";
|
||||
public const string ListName = "listName";
|
||||
public const string SurfaceID = "surfaceID";
|
||||
public const string FullSurface = "fullSurface";
|
||||
public const string Opacity = "opacity";
|
||||
public const string RotationZ = "rotationZ";
|
||||
public const string RotationY = "rotationY";
|
||||
public const string RotationX = "rotationX";
|
||||
public const string PlaybackPositionId = "playbackPositionId";
|
||||
|
||||
|
||||
public const string StartNextCueWhenSliceEnds = "startNextCueWhenSliceEnds";
|
||||
public const string StopTargetWhenSliceEnds = "stopTargetWhenSliceEnds";
|
||||
public const string SliderLevel = "sliderLevel";
|
||||
public const string SecondTriggerAction = "secondTriggerAction"; //implement on QCue
|
||||
public const string SecondTriggerOnRelease = "secondTriggerOnRelease"; //implement on QCue
|
||||
public const string SoloCueInTime = "soloCueInTime"; //implement on QCue
|
||||
|
||||
|
||||
public const string TempCueTargetNumber = "tempCueTargetNumber"; //implement on QCue
|
||||
public const string TempCueTargetId = "tempCueTargetId"; //implement on QCue
|
||||
public const string TempDuration = "tempDuration"; //implement on QCue
|
||||
public const string Type = "type";
|
||||
|
||||
public const string UID = "uniqueID";
|
||||
public const string UniqueID = "uniqueID";
|
||||
public const string ValuesForKeys = "valuesForKeys";
|
||||
public const string ValuesForKeysWithArguments = "valuesForKeysWithArguments";
|
||||
|
||||
//Group Cue Keys
|
||||
public const string CartColumns = "cartColumns";
|
||||
public const string CartRows = "cartRows";
|
||||
public const string Children = "children";
|
||||
public const string Go = "go";
|
||||
public const string Mode = "mode";
|
||||
public const string MoveCartCue = "moveCartCue";
|
||||
public const string PlaybackPositionId = "playbackPositionId";
|
||||
public const string PlaybackPosition = "playbackPosition"; //Implement on Group Cue
|
||||
public const string PlayheadId = "playheadId"; //Implement on Group Cue
|
||||
public const string Playhead = "playhead"; //Implement on Group Cue
|
||||
|
||||
//Audio Cue Keys
|
||||
public const string DoFade = "doFade"; //Implement on Audio Cue and Video Cue
|
||||
public const string DoPitchShift = "doPitchShift"; //Implement on Audio Cue and Video Cue
|
||||
public const string EndTime = "endTime"; //Implement on Audio Cue and Video Cue
|
||||
public const string Gang = "gang"; //Implement on Audio Cue and Video Cue
|
||||
public const string InfiniteLoop = "infiniteLoop"; //Implement on Audio Cue and Video Cue
|
||||
public const string Level = "level"; //Implement on Audio Cue and Video Cue
|
||||
public const string Levels = "levels"; //Implement on Audio Cue and Video Cue
|
||||
public const string LiveAverageLevel = "liveAverageLevel"; //Implement on Audio Cue and Video Cue
|
||||
public const string LockFadeToCue = "lockFadeToCue"; //Implement on Audio Cue and Video Cue
|
||||
public const string NumChannelsIn = "numChannelsIn"; //Implement on Audio Cue and Video Cue
|
||||
public const string PatchList = "patchList"; //Implement on Audio Cue and Video Cue
|
||||
public const string PlayCount = "playCount"; //Implement on Audio Cue and Video Cue
|
||||
public const string LiveRate = "liveRate"; //Implement on Audio Cue and Video Cue
|
||||
public const string SliceMarkers = "sliceMarkers"; //Implement on Audio Cue and Video Cue
|
||||
public const string SliceMarker = "sliceMarker"; //Implement on Audio Cue and Video Cue
|
||||
public const string Time = "time"; //Implement on Audio Cue related to slicemarker and Video Cue
|
||||
public const string LastSlicePlayCount = "lastSlicePlayCount"; //Implement on Audio Cue and Video Cue
|
||||
public const string LastSliceInfiniteLoop = "lastSliceInfiniteLoop"; //Implement on Audio Cue and Video Cue
|
||||
public const string SliderLevel = "sliderLevel"; // Implement on Video Cue
|
||||
public const string SliderLevels = "sliderLevels"; //Implement on Audio Cue and Video Cue
|
||||
public const string StartTime = "startTime"; // Implement on Audio Cue and Video Cue
|
||||
|
||||
//Mic Cue Keys
|
||||
public const string ChannelOffset = "channelOffset"; //Implement on Mic Cue
|
||||
public const string Channels = "channels"; //Implement on Mic Cue
|
||||
|
||||
//Video Cue Keys
|
||||
public const string CueSize = "cueSize"; //Implement on Video Cue
|
||||
public const string DoEffect = "doEffect"; //Implement on Video Cue
|
||||
public const string EffectIndex = "effectIndex"; //Implement on Video Cue
|
||||
public const string EffectSet = "effectSet"; //Implement on Video Cue
|
||||
public const string liveEffectSet = "liveEffectSet"; //Implement on Video Cue
|
||||
public const string FullSurface = "fullSurface"; //Implement on Video Cue
|
||||
public const string HoldLastFrame = "holdLastFrame"; //Implement on Video Cue
|
||||
public const string Layer = "layer"; //Implement on Video Cue
|
||||
public const string Opacity = "opacity"; //Implement on Video Cue
|
||||
public const string OriginX = "originX"; //Implement on Video Cue
|
||||
public const string OriginY = "originY"; //Implement on Video Cue
|
||||
public const string Origin = "origin"; //Implement on Video Cue
|
||||
public const string PreserveAspectRatio = "preserveAspectRatio"; //Implement on Video Cue
|
||||
public const string Quaternion = "quaternion"; //Implement on Video Cue
|
||||
public const string RotateZ = "rotateZ"; //Implement on Video Cue
|
||||
public const string RotateY = "rotateY"; //Implement on Video Cue
|
||||
public const string RotateX = "rotateX"; //Implement on Video Cue
|
||||
public const string LiveRotation = "liveRotation"; //Implement on Video Cue
|
||||
public const string XAxis = "Xaxis"; //Implement on Video Cue
|
||||
public const string YAxis = "Yaxis"; //Implement on Video Cue
|
||||
public const string ZAxis = "Zaxis"; //Implement on Video Cue
|
||||
public const string X = "x"; //Implement on Video Cue
|
||||
public const string Y = "y"; //Implement on Video Cue
|
||||
public const string Z = "z"; //Implement on Video Cue
|
||||
public const string ScaleX = "scaleX"; //Implement on Video Cue
|
||||
public const string LiveScaleX = "liveScaleX"; //Implement on Video Cue
|
||||
public const string ScaleY = "scaleY"; //Implement on Video Cue
|
||||
public const string LiveScaleY = "liveScaleY"; //Implement on Video Cue
|
||||
public const string Scale = "scale"; //Implement on Video Cue
|
||||
public const string LiveScale = "liveScale"; //Implement on Video Cue
|
||||
public const string SurfaceID = "surfaceID"; //Implement on Video Cue
|
||||
public const string SurfaceList = "surfaceList"; //Implement on Video Cue
|
||||
public const string SurfaceName = "surfaceName"; //Implement on Video Cue
|
||||
public const string SurfaceSize = "surfaceSize"; //Implement on Video Cue
|
||||
public const string TranslationX = "translationX";
|
||||
public const string LiveTranslationX = "liveTranslationX"; //Implement on Video Cue
|
||||
public const string TranslationY = "translationY";
|
||||
public const string LiveTranslationY = "liveTranslationY"; //Implement on Video Cue
|
||||
public const string Translation = "translation"; //Implement on Video Cue
|
||||
public const string LiveTranslation = "liveTranslation"; //Implement on Video Cue
|
||||
|
||||
//Camera Cue Keys (Extension of Video Cue
|
||||
public const string CameraPatch = "cameraPatch";
|
||||
|
||||
//Text Cue Keys
|
||||
public const string FixedWidth = "fixedWidth"; //Implement on Text Cue
|
||||
public const string Text = "text"; //Implement on Text Cue
|
||||
public const string LiveText = "liveText"; //Implement on Text Cue
|
||||
public const string Format = "format"; //Implement on Text Cue
|
||||
public const string Alignment = "alignment"; //Implement on Text Cue
|
||||
public const string FontFamily = "fontFamily"; //Implement on Text Cue
|
||||
public const string FontStyle = "fontStyle"; //Implement on Text Cue
|
||||
public const string FontFamilyAndStyle = "fontFamilyAndStyle"; //Implement on Text Cue
|
||||
public const string FontName = "fontName"; //Implement on Text Cue
|
||||
public const string FontSize = "fontSize"; //Implement on Text Cue
|
||||
public const string LineSpacing = "lineSpacing"; //Implement on Text Cue
|
||||
public const string Color = "color"; //Implement on Text Cue
|
||||
public const string BackgroundColor = "backgroundColor"; //Implement on Text Cue
|
||||
public const string StrikethroughColor = "strikethroughColor"; //Implement on Text Cue
|
||||
public const string UnderlineColor = "underlineColor"; //Implement on Text Cue
|
||||
public const string StrikethroughStyle = "strikethroughStyle"; //Implement on Text Cue
|
||||
public const string UnderlineStyle = "underlineStyle"; //Implement on Text Cue
|
||||
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";
|
||||
public const string MessageType = "messageType";
|
||||
public const string QLabCommand = "qlabCommand";
|
||||
public const string QLabCueNumber = "qlabCueNumber";
|
||||
public const string QLabCueParameters = "qlabCueParameters";
|
||||
public const string RawString = "rawString";
|
||||
public const string UdpString = "udpString";
|
||||
|
||||
//MIDI Cue Keys
|
||||
|
||||
//Midi File Cue Keys
|
||||
public const string Patch = "patch"; //Implement on Audio Cue and Video Cue and Network Cue
|
||||
public const string Rate = "rate"; //Implement on Audio Cue and Video Cue
|
||||
|
||||
//Devamp Cue Keys
|
||||
public const string startNextCueWhenSliceEnds = "startNextCueWhenSliceEnds";
|
||||
public const string stopTargetWhenSliceEnds = "stopTargetWhenSliceEnds";
|
||||
|
||||
//Script Cue Keys
|
||||
public const string ScriptSource = "scriptSource";
|
||||
|
||||
|
||||
// v3
|
||||
public const string Duration = "duration";
|
||||
public const string FullScreen = "fullScreen";
|
||||
public const string FullScreen = "fullScreen"; //Implement on Video Cue
|
||||
|
||||
}
|
||||
|
||||
public static class QIdentifiers
|
||||
@@ -143,16 +302,191 @@
|
||||
public const string Default = "default"; //is this even an option?
|
||||
}
|
||||
|
||||
enum QFadeMode
|
||||
public enum QTriggerAction
|
||||
{
|
||||
Nothing = 0,
|
||||
Panics = 1,
|
||||
Stops = 2,
|
||||
Hard_Stops = 3,
|
||||
Hard_Stops_And_Restarts = 4
|
||||
}
|
||||
|
||||
public enum QFadeMode
|
||||
{
|
||||
Absolute = 0,
|
||||
Relative = 1
|
||||
}
|
||||
|
||||
enum QContinueMode
|
||||
public enum QContinueMode
|
||||
{
|
||||
NoContinue = 0,
|
||||
AutoContinue = 1,
|
||||
AutoFollow = 2
|
||||
}
|
||||
|
||||
public enum QMSCCommand
|
||||
{
|
||||
GO = 1,
|
||||
STOP = 2,
|
||||
RESUME = 3,
|
||||
TIMED_GO = 4,
|
||||
LOAD = 5,
|
||||
SET = 6,
|
||||
FIRE = 7,
|
||||
ALL_OFF =8,
|
||||
RESTORE = 9,
|
||||
RESET = 10,
|
||||
GO_OFF = 11,
|
||||
GO_OR_JAM_CLOCK = 16,
|
||||
STANDBY_PLUSS = 17,
|
||||
STANDBY_MINUS = 18,
|
||||
SEQUENCE_PLUS = 19,
|
||||
SEQUENCE_MINUS = 20,
|
||||
START_CLOCK = 21,
|
||||
STOP_CLOCK = 22,
|
||||
ZERO_CLOCK = 23,
|
||||
SET_CLOCK = 24,
|
||||
MTC_CHASE_ON = 25,
|
||||
MTC_CHASE_OFF = 26,
|
||||
OPEN_CUE_LIST = 27,
|
||||
CLOSE_CUE_LIST = 28,
|
||||
OPEN_CUE_PATH = 29,
|
||||
CLOSE_CUE_PATH = 30,
|
||||
}
|
||||
|
||||
public enum QMSCCommandFormat
|
||||
{
|
||||
All_Types = 127,
|
||||
Lighting_General = 1,
|
||||
Moving_Lights = 2,
|
||||
Color_Changers = 3,
|
||||
Strobes = 4,
|
||||
Lasers = 5,
|
||||
Chasers = 6,
|
||||
Sound_General = 16,
|
||||
Music = 17,
|
||||
CD_Players = 18,
|
||||
EPROM_Playback = 19,
|
||||
Audio_Tape_Machines = 20,
|
||||
Intercoms = 21,
|
||||
Amplifiers = 22,
|
||||
Audio_Effects_Devices = 23,
|
||||
Equalizers = 24,
|
||||
Machinery_General = 32,
|
||||
Rigging = 33,
|
||||
Flys = 34,
|
||||
Lifts = 35,
|
||||
Turntables = 36,
|
||||
Trusses = 37,
|
||||
Robots = 38,
|
||||
Animation = 39,
|
||||
Floats = 40,
|
||||
Breakaways = 41,
|
||||
Barges = 42,
|
||||
Video_General = 48,
|
||||
Video_Tape_Machines = 49,
|
||||
Video_Cassette_Machines = 50,
|
||||
Video_Disc_Players = 51,
|
||||
Video_Switchers = 52,
|
||||
Video_Effects = 53,
|
||||
Video_Character_Generators = 54,
|
||||
Video_Still_Stores = 55,
|
||||
Video_Monitors = 56,
|
||||
Projection_General = 64,
|
||||
Film_Projectors = 65,
|
||||
Slide_Projectors = 66,
|
||||
Video_Projectors = 67,
|
||||
Dissolvers = 68,
|
||||
Shutter_Controls = 69,
|
||||
Process_Control_General = 80,
|
||||
Hydraulic_Oil = 81,
|
||||
H2O = 82,
|
||||
CO2 = 83,
|
||||
Compressed_Air = 84,
|
||||
Natural_Gas = 85,
|
||||
Fog = 86,
|
||||
Smoke = 87,
|
||||
Cracked_Haze = 88,
|
||||
Pyrotechnics_General = 96,
|
||||
Fireworks = 97,
|
||||
Explosions = 98,
|
||||
Flame = 99,
|
||||
Smoke_Pots = 100
|
||||
}
|
||||
|
||||
public enum QNetworkMessageType
|
||||
{
|
||||
QLAB = 1,
|
||||
OSC = 2,
|
||||
UDP = 3
|
||||
}
|
||||
|
||||
public enum QNetworkQLabCommand
|
||||
{
|
||||
start = 1,
|
||||
stop = 2,
|
||||
hardStop = 3,
|
||||
pause = 4,
|
||||
resume = 5,
|
||||
togglePause = 6,
|
||||
load = 7,
|
||||
preview = 8,
|
||||
reset = 9,
|
||||
panic = 10,
|
||||
number = 11,
|
||||
name = 12,
|
||||
notes = 13,
|
||||
cueTargetNumber = 14,
|
||||
preWait = 15,
|
||||
duration = 16,
|
||||
postWait = 17,
|
||||
continueMode = 18,
|
||||
flagged = 19,
|
||||
armed = 20,
|
||||
colorName = 21
|
||||
}
|
||||
|
||||
public enum QRotationType
|
||||
{
|
||||
THREE_D = 0,
|
||||
X = 1,
|
||||
Y = 2,
|
||||
Z = 3
|
||||
}
|
||||
|
||||
public enum QVideoEffect
|
||||
{
|
||||
Color_Controls = 1,
|
||||
Exposure = 2,
|
||||
Gamma = 3,
|
||||
Sepia_Monochrome = 4,
|
||||
Min_Max_Invert = 5,
|
||||
White_point = 6,
|
||||
Box_Disc_Gaussian_Blurs = 7,
|
||||
Motion_Blur = 8,
|
||||
Sharpen_Luminance = 9,
|
||||
Unsharp_Mask = 10,
|
||||
Zoom_Blur = 11,
|
||||
Pixellation = 12,
|
||||
Screen = 13,
|
||||
Bloom_and_Gloom = 14,
|
||||
CMYK_Halftone = 15,
|
||||
Color_Posterize = 16,
|
||||
Crystallize_and_Pointillize = 17,
|
||||
Edge_Work = 18,
|
||||
Kaleidoscope = 1,
|
||||
Median_and_Comic_Effect = 19,
|
||||
Noise_Reduction = 20,
|
||||
Circle_Splash_Hole_Distortion = 21,
|
||||
Pinch_Bump_Distortion = 22,
|
||||
Torus_Lens_Distortion = 23,
|
||||
Twirl_Circular_Wrap_Vortex = 24,
|
||||
Glass_Lozenge = 25,
|
||||
Op_Tile = 26,
|
||||
Perspective_Tile = 27,
|
||||
Quad_Tiles = 28,
|
||||
Reflected_Tiles = 29,
|
||||
Rotated_Tiles = 30,
|
||||
Titles = 31
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QDevampCue : QCue
|
||||
{
|
||||
public bool startNextCueWhenSliceEnds
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)propertyForKey(QOSCKey.startNextCueWhenSliceEnds);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.startNextCueWhenSliceEnds);
|
||||
}
|
||||
}
|
||||
|
||||
public bool stopTargetWhenSliceEnds
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)propertyForKey(QOSCKey.stopTargetWhenSliceEnds);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.stopTargetWhenSliceEnds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QGroupCue : QCue
|
||||
{
|
||||
public int cartColumns
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.CartColumns);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.CartColumns);
|
||||
}
|
||||
}
|
||||
|
||||
public int cartRows
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.CartRows);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.CartRows);
|
||||
}
|
||||
}
|
||||
|
||||
public List<QCue> children
|
||||
{
|
||||
get
|
||||
{
|
||||
return cues;
|
||||
}
|
||||
}
|
||||
|
||||
public void go()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.Go}");
|
||||
}
|
||||
|
||||
public int mode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.Mode);
|
||||
}
|
||||
set
|
||||
{
|
||||
if(value > 0 && value < 5)
|
||||
{
|
||||
setProperty(value, QOSCKey.Mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void moveCartCue(QCue cart, int row, int column)
|
||||
{
|
||||
if(cart.type.Equals(QCueType.CueCart) || cart.type.Equals(QCueType.Cart))
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.MoveCartCue}/{cart.uid}", row, column);
|
||||
}
|
||||
}
|
||||
|
||||
public string playhead
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.Playhead).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.Playhead);
|
||||
}
|
||||
}
|
||||
|
||||
public string playheadId
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.PlayheadId).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.PlayheadId);
|
||||
}
|
||||
}
|
||||
|
||||
public string playbackPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.PlaybackPosition).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.PlaybackPosition);
|
||||
}
|
||||
}
|
||||
|
||||
public string playbackPositionId
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.PlaybackPositionId).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.PlaybackPositionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.uid}/{QOSCKey.CollateAndStart}");
|
||||
}
|
||||
|
||||
public void prune()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.Prune}");
|
||||
}
|
||||
|
||||
public void pruneCommands()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.PruneCommands}");
|
||||
}
|
||||
|
||||
public void removeLightCommandsMatching(string match)
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.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.uid}/{QOSCKey.ReplaceLightCommand}", oldCommand, newCommand);
|
||||
}
|
||||
else
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.UpdateLightCommand}", oldCommand, newCommand);
|
||||
}
|
||||
}
|
||||
|
||||
public void safeSort()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.SafeSort}");
|
||||
}
|
||||
|
||||
public void safeSortCommands()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.SafeSortCommands}");
|
||||
}
|
||||
|
||||
public void setLight(string light, object setting)
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.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.uid}/{QOSCKey.ReplaceLightCommand}", oldCommand, newCommand);
|
||||
}
|
||||
else
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/{QOSCKey.UpdateLightCommand}", oldCommand, newCommand);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QMicCue : QCue
|
||||
{
|
||||
public int channelOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.ChannelOffset);
|
||||
}
|
||||
}
|
||||
|
||||
public int channels
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.Channels);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.Channels);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaultLevels()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/setDefaultLevels");
|
||||
}
|
||||
|
||||
public void setSilientLevels()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/setSilentLevels");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QMidiFileCue :QCue
|
||||
{
|
||||
public bool patch
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)propertyForKey(QOSCKey.Patch);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.Patch);
|
||||
}
|
||||
}
|
||||
|
||||
public bool rate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)propertyForKey(QOSCKey.Rate);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.Rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QNetworkCue : QCue
|
||||
{
|
||||
public string customString
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.CustomString).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.CustomString);
|
||||
}
|
||||
}
|
||||
|
||||
public QNetworkMessageType messageType
|
||||
{
|
||||
get
|
||||
{
|
||||
return (QNetworkMessageType)propertyForKey(QOSCKey.MessageType);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.MessageType);
|
||||
}
|
||||
}
|
||||
|
||||
public QNetworkQLabCommand qlabCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return (QNetworkQLabCommand)propertyForKey(QOSCKey.QLabCommand);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.QLabCommand);
|
||||
}
|
||||
}
|
||||
|
||||
public int patch
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.Patch);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.Patch);
|
||||
}
|
||||
}
|
||||
|
||||
public string qlabCueNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.QLabCueNumber).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.QLabCueNumber);
|
||||
}
|
||||
}
|
||||
|
||||
public string qlabCueParameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.QLabCueParameters).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.QLabCueParameters);
|
||||
}
|
||||
}
|
||||
|
||||
public string rawString
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.RawString).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.RawString);
|
||||
}
|
||||
}
|
||||
|
||||
public string udpString
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.UdpString).ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.UdpString);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QScriptCue : QCue
|
||||
{
|
||||
public string scriptSource
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.ScriptSource).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public void compileSource()
|
||||
{
|
||||
workspace.sendMessage($"/cue_id/{this.uid}/compileSource");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections.Generic;
|
||||
using QControlKit.Constants;
|
||||
|
||||
namespace QControlKit.Cue
|
||||
{
|
||||
public class QTextCue : QCue
|
||||
{
|
||||
|
||||
public int fixedWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)propertyForKey(QOSCKey.FixedWidth);
|
||||
}
|
||||
set
|
||||
{
|
||||
if(fixedWidth > 0)
|
||||
{
|
||||
setProperty(value, QOSCKey.FixedWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
public string text
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.Text).ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.Text);
|
||||
}
|
||||
}
|
||||
|
||||
public string liveText
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.LiveText).ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.LiveText);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO:
|
||||
/* https://qlab.app/docs/v4/scripting/osc-dictionary-v4/#text-cue-methods
|
||||
* /cue/{cue_number}/text/format {json_string}
|
||||
* /cue/{cue_number}/text/format/alignment {alignment}
|
||||
* /cue/{cue_number}/text/format/fontFamily
|
||||
* /cue/{cue_number}/text/format/fontStyle
|
||||
* /cue/{cue_number}/text/format/fontFamilyAndStyle {family} {style}
|
||||
* /cue/{cue_number}/text/format/fontName {name}
|
||||
* /cue/{cue_number}/text/format/fontSize {number}
|
||||
* /cue/{cue_number}/text/format/lineSpacing {number}
|
||||
* /cue/{cue_number}/text/format/color {red} {green} {blue} {alpha}
|
||||
* /cue/{cue_number}/text/format/backgroundColor {red} {green} {blue} {alpha}
|
||||
* /cue/{cue_number}/text/format/strikethroughColor {red} {green} {blue} {alpha}
|
||||
* /cue/{cue_number}/text/format/underlineColor {red} {green} {blue} {alpha}
|
||||
* /cue/{cue_number}/text/format/strikethroughStyle {style}
|
||||
* /cue/{cue_number}/text/format/underlineStyle {style}
|
||||
* /cue/{cue_number}/text/outputSize
|
||||
* /cue/{cue_number}/liveText/outputSize
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace QControlKit.Events
|
||||
using System;
|
||||
|
||||
namespace QControlKit.Events
|
||||
{
|
||||
public delegate void QServerFoundHandler(object source, QServerFoundArgs args);
|
||||
public delegate void QServerLostHandler(object source, QServerLostArgs args);
|
||||
@@ -16,7 +18,6 @@
|
||||
public delegate void QWorkspaceConnectionErrorHandler(object source, QWorkspaceConnectionErrorArgs args);
|
||||
public delegate void QQLabPreferencesUpdatedHandler(object source, QQLabPreferencesUpdatedArgs args);
|
||||
|
||||
|
||||
public delegate void QCueUpdatedHandler(object source, QCueUpdatedArgs args);
|
||||
public delegate void QCuePropertiesUpdatedHandler(object source, QCuePropertiesUpdatedArgs args);
|
||||
public delegate void QCueListsUpdatesHandler(object source, QCueListsUpdatedArgs args);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>AnyCPU</LastUsedPlatform>
|
||||
<publishUrl>bin/Release/netstandard2.0/publish</publishUrl>
|
||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<SelfContained>false</SelfContained>
|
||||
<_IsPortable>true</_IsPortable>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
+13
-12
@@ -26,13 +26,17 @@ namespace QControlKit
|
||||
|
||||
public async void ProbeForQLabInstances()
|
||||
{
|
||||
Log.Debug("[qbrowser] probing for instances");
|
||||
|
||||
IReadOnlyList<IZeroconfHost> results = await
|
||||
ZeroconfResolver.ResolveAsync(QBonjour.TCPService,TimeSpan.FromSeconds(3));
|
||||
|
||||
foreach (var zeroconfHost in results)
|
||||
{
|
||||
Log.Debug($"[qbrowser] found host {zeroconfHost.IPAddress}:{zeroconfHost.DisplayName}");
|
||||
foreach (var service in zeroconfHost.Services)
|
||||
{
|
||||
Log.Debug($"[qbrowser] found {service.Key}:{service.Value}");
|
||||
if (service.Key.Equals(QBonjour.TCPService))
|
||||
{
|
||||
|
||||
@@ -62,19 +66,15 @@ namespace QControlKit
|
||||
|
||||
foreach(var server in qServers)
|
||||
{
|
||||
bool serverToBeRemoved = true;
|
||||
foreach(var zeroconfHost in results){
|
||||
QServer existingServer = serverForAddress(zeroconfHost.IPAddress);
|
||||
if(server != null)
|
||||
{
|
||||
serverToBeRemoved = false;
|
||||
}
|
||||
}
|
||||
if (serverToBeRemoved)
|
||||
IZeroconfHost found = results.ToList().Find(x => x.IPAddress.Equals(server.host));
|
||||
|
||||
if (found == null)
|
||||
{
|
||||
server.disconnect();
|
||||
servers.Remove(server);
|
||||
Log.Information($"[qbrowser] Lost {server.name} : {server.host} : {server.port}");
|
||||
server.disconnect();
|
||||
Log.Information($"[qbrowser] after server disconnect()");
|
||||
|
||||
servers.Remove(server);
|
||||
OnServerLost(server);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,8 @@ namespace QControlKit
|
||||
|
||||
public void Close()
|
||||
{
|
||||
foreach(var server in servers)
|
||||
Log.Information($"[qbrowser] Close requested");
|
||||
foreach (var server in servers)
|
||||
{
|
||||
server.disconnect();
|
||||
}
|
||||
|
||||
@@ -52,15 +52,15 @@ namespace QControlKit
|
||||
|
||||
public void disconnect()
|
||||
{
|
||||
Log.Debug($"[client] disconnecting from {tcpClient.Address}");
|
||||
Log.Information($"[client] disconnecting from {tcpClient.Address}");
|
||||
tcpClient.Close();
|
||||
}
|
||||
|
||||
|
||||
public void sendMessage(string address, params object[] args)
|
||||
{
|
||||
tcpClient.Send(new OscMessage(address, args));
|
||||
Log.Debug($"[client] send message {address} : {args}");
|
||||
tcpClient.QueueForSending(new OscMessage(address, args));
|
||||
Log.Information($"[client] send message {address} : {args}");
|
||||
}
|
||||
|
||||
private void ProcessMessage(object source, MessageEventArgs args)
|
||||
@@ -97,7 +97,7 @@ namespace QControlKit
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"[client] unhandled reply from cue: Type: {data.Type} value: {message.response}");
|
||||
Log.Error($"[client] unhandled reply from cue: Type: {data.Type} value: {message.response}");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace QControlKit
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"[client] unhandled reply message: {message.address}");
|
||||
Log.Error($"[client] unhandled reply message: {message.address}");
|
||||
}
|
||||
}
|
||||
else if(message.IsUpdate) {
|
||||
@@ -162,12 +162,12 @@ namespace QControlKit
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"[client] unhandled update message: {message.address}");
|
||||
Log.Error($"[client] unhandled update message: {message.address}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"[client] unhandled message: {message.address}");
|
||||
Log.Error($"[client] unhandled message: {message.address}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<Authors>Joel Wetzell</Authors>
|
||||
<Version>1.0.0-devel</Version>
|
||||
<PackOnBuild>true</PackOnBuild>
|
||||
<PackageVersion>0.0.18</PackageVersion>
|
||||
<PackageVersion>0.0.24</PackageVersion>
|
||||
<PackageId>QControlKit</PackageId>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<Summary>Unofficial C# port of Figure53's QLabKit.objc</Summary>
|
||||
@@ -16,10 +16,21 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Zeroconf" Version="3.4.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Zeroconf" Version="3.5.11" />
|
||||
<PackageReference Include="SuperSimpleTcp" Version="2.6.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Constants\" />
|
||||
<Folder Include="Cue\" />
|
||||
<Folder Include="SharpOSC\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Cue\" />
|
||||
<None Remove="SharpOSC" />
|
||||
<None Remove="Zeroconf" />
|
||||
<None Remove="SharpOSC\" />
|
||||
<None Remove="SimpleTCP" />
|
||||
<None Remove="SuperSimpleTcp" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
+133
-78
@@ -18,6 +18,7 @@ namespace QControlKit
|
||||
public List<QCue> childCues;
|
||||
public Dictionary<string, QCue> childCuesUIDMap;
|
||||
|
||||
|
||||
public int sortIndex;
|
||||
public int nestLevel;
|
||||
|
||||
@@ -43,32 +44,9 @@ namespace QControlKit
|
||||
{
|
||||
init();
|
||||
this.workspace = workspace;
|
||||
|
||||
//this breaks things???
|
||||
//it definitely is in the original but somehow the recursion is not working as I expect..
|
||||
//but cue population still works without this as child cues are populated later
|
||||
|
||||
/*JToken children = dict[QOSCKey.Cues];
|
||||
if(children != null && children.Type == JTokenType.Array)
|
||||
{
|
||||
Log.Debug($"[cue] new cue being created with {children.Count()} childCues");
|
||||
foreach (var aChildDict in children)
|
||||
{
|
||||
string uid = (string)aChildDict[QOSCKey.UID];
|
||||
//Log.Debug($"[cue] childDict with uid: {uid} being processed");
|
||||
if (uid == null)
|
||||
continue;
|
||||
string name = dict[QOSCKey.UID].ToString();
|
||||
Log.Debug($"[cue] calling new cue from {name}");
|
||||
|
||||
//QCue child = new QCue(aChildDict, workspace);
|
||||
|
||||
*//*childCues.Add(child);
|
||||
childCuesUIDMap.Add(uid, child);*//*
|
||||
}
|
||||
}*/
|
||||
|
||||
updatePropertiesWithDictionary(dict);
|
||||
workspace.fetchBasicPropertiesForCue(this);
|
||||
|
||||
}
|
||||
|
||||
public QCue(JToken dict, QWorkspace workspace, int nestLevel)
|
||||
@@ -76,31 +54,8 @@ namespace QControlKit
|
||||
init();
|
||||
this.workspace = workspace;
|
||||
this.nestLevel = nestLevel + 1;
|
||||
//this breaks things???
|
||||
//it definitely is in the original but somehow the recursion is not working as I expect..
|
||||
//but cue population still works without this as child cues are populated later
|
||||
|
||||
/*JToken children = dict[QOSCKey.Cues];
|
||||
if(children != null && children.Type == JTokenType.Array)
|
||||
{
|
||||
Log.Debug($"[cue] new cue being created with {children.Count()} childCues");
|
||||
foreach (var aChildDict in children)
|
||||
{
|
||||
string uid = (string)aChildDict[QOSCKey.UID];
|
||||
//Log.Debug($"[cue] childDict with uid: {uid} being processed");
|
||||
if (uid == null)
|
||||
continue;
|
||||
string name = dict[QOSCKey.UID].ToString();
|
||||
Log.Debug($"[cue] calling new cue from {name}");
|
||||
|
||||
//QCue child = new QCue(aChildDict, workspace);
|
||||
|
||||
*//*childCues.Add(child);
|
||||
childCuesUIDMap.Add(uid, child);*//*
|
||||
}
|
||||
}*/
|
||||
|
||||
updatePropertiesWithDictionary(dict);
|
||||
workspace.fetchBasicPropertiesForCue(this);
|
||||
}
|
||||
|
||||
public void init()
|
||||
@@ -244,7 +199,14 @@ namespace QControlKit
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.Parent).ToString();
|
||||
if(propertyForKey(QOSCKey.Parent) != null)
|
||||
{
|
||||
return propertyForKey(QOSCKey.Parent).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
public string playbackPositionID {
|
||||
@@ -301,7 +263,14 @@ namespace QControlKit
|
||||
{
|
||||
get
|
||||
{
|
||||
return propertyForKey(QOSCKey.ListName).ToString();
|
||||
if(propertyForKey(QOSCKey.ListName) == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyForKey(QOSCKey.ListName).ToString();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -353,46 +322,39 @@ namespace QControlKit
|
||||
if (workspace.connectedToQLab3 || workspace.isOlderThanVersion("4.2.0"))
|
||||
return false;
|
||||
|
||||
bool overridden = (bool)propertyForKey(QOSCKey.IsOverridden);
|
||||
|
||||
if (overridden)
|
||||
return true;
|
||||
foreach (var cue in cues)
|
||||
{
|
||||
if (cue.IsOverridden)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return getBoolForKey(QOSCKey.IsOverridden);
|
||||
}
|
||||
}
|
||||
public bool IsBroken
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((bool)propertyForKey(QOSCKey.IsBroken))
|
||||
return true;
|
||||
foreach(var cue in cues)
|
||||
foreach (var cue in cues)
|
||||
{
|
||||
if (cue.IsBroken)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return getBoolForKey(QOSCKey.IsBroken);
|
||||
}
|
||||
}
|
||||
public bool IsRunning
|
||||
{
|
||||
get
|
||||
{
|
||||
bool running = (bool)propertyForKey(QOSCKey.IsRunning);
|
||||
|
||||
if (running)
|
||||
return true;
|
||||
foreach(var cue in cues)
|
||||
foreach (var cue in cues)
|
||||
{
|
||||
if (cue.IsRunning)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return getBoolForKey(QOSCKey.IsRunning);
|
||||
}
|
||||
}
|
||||
public bool IsTailingOut
|
||||
@@ -402,16 +364,13 @@ namespace QControlKit
|
||||
if (workspace.connectedToQLab3)
|
||||
return false;
|
||||
|
||||
bool tailingOut = (bool)propertyForKey(QOSCKey.IsTailingOut);
|
||||
|
||||
if (tailingOut)
|
||||
return true;
|
||||
foreach(var cue in cues)
|
||||
foreach (var cue in cues)
|
||||
{
|
||||
if (cue.IsTailingOut)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return getBoolForKey(QOSCKey.IsTailingOut);
|
||||
}
|
||||
}
|
||||
public bool IsPanicking
|
||||
@@ -421,16 +380,13 @@ namespace QControlKit
|
||||
if (workspace.connectedToQLab3)
|
||||
return false;
|
||||
|
||||
bool panicking = (bool)propertyForKey(QOSCKey.IsPanicking);
|
||||
|
||||
if (panicking)
|
||||
return true;
|
||||
foreach (var cue in cues)
|
||||
{
|
||||
if (cue.IsPanicking)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return getBoolForKey(QOSCKey.IsPanicking);
|
||||
}
|
||||
}
|
||||
public bool IsGroup
|
||||
@@ -571,6 +527,62 @@ namespace QControlKit
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public float actionElapsed
|
||||
{
|
||||
get
|
||||
{
|
||||
object secs = propertyForKey(QOSCKey.ActionElapsed);
|
||||
if (secs != null)
|
||||
{
|
||||
return float.Parse(secs.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public QTriggerAction secondTriggerAction
|
||||
{
|
||||
get
|
||||
{
|
||||
return (QTriggerAction)propertyForKey(QOSCKey.SecondTriggerAction);
|
||||
}
|
||||
set
|
||||
{
|
||||
setProperty(value, QOSCKey.SecondTriggerAction);
|
||||
}
|
||||
}
|
||||
|
||||
public bool secondTriggerOnRelease
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = (int)propertyForKey(QOSCKey.SecondTriggerOnRelease);
|
||||
if (val == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
setProperty(0, QOSCKey.SecondTriggerOnRelease);
|
||||
}
|
||||
else
|
||||
{
|
||||
setProperty(1, QOSCKey.SecondTriggerOnRelease);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO add quaternion property and setter
|
||||
public Size surfaceSize() { throw new NotImplementedException(); }
|
||||
public Size cueSize() { throw new NotImplementedException(); }
|
||||
@@ -788,6 +800,32 @@ namespace QControlKit
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool getBoolForKey(string key)
|
||||
{
|
||||
if (propertyForKey(key) != null)
|
||||
{
|
||||
object prop = propertyForKey(key);
|
||||
//Log.Warning($"{listName} IsBroken: {propertyForKey(QOSCKey.IsBroken).ToString()} {prop.GetType().ToString()}");
|
||||
if(prop.GetType() == typeof(Boolean)){
|
||||
return (bool)prop;
|
||||
}
|
||||
else if (prop.GetType() == typeof(JValue))
|
||||
{
|
||||
JValue value = (JValue)prop;
|
||||
return (bool)value.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public object propertyForKey(string key)
|
||||
{
|
||||
//TODO: implerment special key checks color, surfaceName, patchDescription,
|
||||
@@ -936,6 +974,20 @@ namespace QControlKit
|
||||
public void togglePause() { workspace.togglePauseCue(this); }
|
||||
public void preview() { workspace.previewCue(this); }
|
||||
public void panic() { workspace.panicCue(this); }
|
||||
public void playheadNext()
|
||||
{
|
||||
if (this.type == QCueType.CueList)
|
||||
{
|
||||
workspace.sendMessageForCue(this, "playhead/next");
|
||||
}
|
||||
}
|
||||
public void playheadPrevious()
|
||||
{
|
||||
if (this.type == QCueType.CueList)
|
||||
{
|
||||
workspace.sendMessageForCue(this, "playhead/previous");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -943,7 +995,10 @@ namespace QControlKit
|
||||
#region Event Handling
|
||||
void OnCuePropertiesUpdated(List<string> properties)
|
||||
{
|
||||
Log.Debug($"[cue] <{nonEmptyName}> properties have been updated.");
|
||||
if(parentID != null && parentID != "")
|
||||
{
|
||||
workspace.fetchBasicPropertiesForCue(workspace.cueWithID(parentID));
|
||||
}
|
||||
CuePropertiesUpdated?.Invoke(this, new QCuePropertiesUpdatedArgs { properties = properties });
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace QControlKit
|
||||
return (parts.Length == 4 && parts[3].Equals("connect"));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//host method
|
||||
@@ -142,5 +143,21 @@ namespace QControlKit
|
||||
}
|
||||
}
|
||||
|
||||
override
|
||||
public string ToString()
|
||||
{
|
||||
string stringified = "";
|
||||
|
||||
stringified += $"\nAddress: {this.address}\nArguments: \n";
|
||||
|
||||
|
||||
for(int i = 0; i<this.arguments.Count; i++)
|
||||
{
|
||||
object argument = this.arguments[i];
|
||||
stringified += $"\targ {i + 1}: {argument.ToString()}\n";
|
||||
}
|
||||
return stringified;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace QControlKit
|
||||
|
||||
public void disconnect()
|
||||
{
|
||||
Log.Information($"[server] disconnect requested for server <{name}>");
|
||||
foreach (var workspace in workspaces)
|
||||
{
|
||||
if (workspace.connected)
|
||||
|
||||
+57
-56
@@ -3,8 +3,6 @@ using Serilog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
|
||||
using QControlKit.Events;
|
||||
using QControlKit.Constants;
|
||||
|
||||
@@ -24,9 +22,6 @@ namespace QControlKit
|
||||
|
||||
private QCue root;
|
||||
|
||||
private Timer heartbeatTimer;
|
||||
private int heartbeatAttempts;
|
||||
|
||||
public bool defaultSendUpdatesOSC;
|
||||
|
||||
public string version;
|
||||
@@ -35,6 +30,8 @@ namespace QControlKit
|
||||
public event QWorkspaceUpdatedHandler WorkspaceUpdated;
|
||||
public event QCueListChangedPlaybackPositionHandler CueListChangedPlaybackPosition;
|
||||
public event QWorkspaceConnectionErrorHandler WorkspaceConnectionError;
|
||||
public event QWorkspaceDisconnectedHandler WorkspaceDisconnected;
|
||||
public event QWorkspaceConnectedHandler WorkspaceConnected;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
@@ -78,7 +75,7 @@ namespace QControlKit
|
||||
client.CueUpdated += OnCueUpdated;
|
||||
|
||||
this.server = server;
|
||||
Log.Debug($"[workspace] <{name}> on {server.name} initialized.");
|
||||
Log.Debug($"[workspace] <{name}> on <{server.name}> initialized.");
|
||||
}
|
||||
|
||||
//updateWithDictionary
|
||||
@@ -172,13 +169,14 @@ namespace QControlKit
|
||||
if(hasPasscode && passcode == null)
|
||||
{
|
||||
Log.Error($"[workspace] *** workspace <{name}> requires a passcode but none was supplied.");
|
||||
OnWorkspaceConnectionError(this, new QWorkspaceConnectionErrorArgs { status = "badpass" });
|
||||
OnWorkspaceConnectionError(this, new QWorkspaceConnectionErrorArgs { status = QConnectionStatus.BadPass });
|
||||
return;
|
||||
}
|
||||
|
||||
if (!client.connect())
|
||||
{
|
||||
Log.Error($"[workspace] *** couldn't connect to server client is not connected.");
|
||||
OnWorkspaceConnectionError(this, new QWorkspaceConnectionErrorArgs { status = QConnectionStatus.Error });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -215,19 +213,15 @@ namespace QControlKit
|
||||
Log.Information($"[workspace] disconnecting from <{name}>");
|
||||
if (!connected)
|
||||
return;
|
||||
if (heartbeatTimer != null)
|
||||
stopHeartbeat();
|
||||
stopReceivingUpdates();
|
||||
disconnectFromWorkspace();
|
||||
|
||||
connected = false;
|
||||
client.disconnect();
|
||||
|
||||
connected = false;
|
||||
}
|
||||
|
||||
public void temporarilyDisconnect()
|
||||
{
|
||||
//TODO
|
||||
//TODO what does this mean?
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -247,6 +241,7 @@ namespace QControlKit
|
||||
#region Workspace Methods
|
||||
public void disconnectFromWorkspace() { client.sendMessage($"{workspacePrefix}/disconnect"); }
|
||||
public void startReceivingUpdates() { client.sendMessage($"{workspacePrefix}/updates", 1); }
|
||||
public void getPropertyForActive(string prop) { client.sendMessage($"{workspacePrefix}/cue/active/{prop}"); }
|
||||
public void stopReceivingUpdates() { client.sendMessage($"{workspacePrefix}/updates", 0); }
|
||||
public void enableAlwaysReply() { client.sendMessage($"{workspacePrefix}/alwaysReply", 1); }
|
||||
public void disableAlwaysReply() { client.sendMessage($"{workspacePrefix}/alwaysReply", 0); }
|
||||
@@ -254,6 +249,7 @@ namespace QControlKit
|
||||
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 go(string cueNumber) { client.sendMessage($"{workspacePrefix}/go/{cueNumber}"); }
|
||||
public void save() { client.sendMessage($"{workspacePrefix}/save"); }
|
||||
public void undo() { client.sendMessage($"{workspacePrefix}/undo"); }
|
||||
public void redo() { client.sendMessage($"{workspacePrefix}/redo"); }
|
||||
@@ -265,39 +261,7 @@ namespace QControlKit
|
||||
#endregion
|
||||
|
||||
#region Heartbeat
|
||||
//TODO
|
||||
public void startHeartbeat()
|
||||
{
|
||||
clearHeartbeatTimeout();
|
||||
sendHeartbeat();
|
||||
}
|
||||
|
||||
public void stopHeartbeat()
|
||||
{
|
||||
clearHeartbeatTimeout();
|
||||
heartbeatAttempts = -1;
|
||||
}
|
||||
|
||||
public void clearHeartbeatTimeout()
|
||||
{
|
||||
heartbeatTimer.Stop();
|
||||
heartbeatTimer = null;
|
||||
heartbeatAttempts = 0;
|
||||
//TODO
|
||||
}
|
||||
|
||||
public void sendHeartbeat()
|
||||
{
|
||||
client.sendMessage("/thump");
|
||||
//TODO
|
||||
}
|
||||
|
||||
public void heartbeatTimeout(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
||||
//TODO? Do I even need this if I only allow TCP and just watch for a change in the state of the TCP connection
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -353,18 +317,48 @@ namespace QControlKit
|
||||
|
||||
public void fetchDefaultPropertiesForCue(QCue cue)
|
||||
{
|
||||
List<string> keys = new List<string> { QOSCKey.UID, QOSCKey.Number, QOSCKey.Name,
|
||||
QOSCKey.ListName, QOSCKey.Type, QOSCKey.ColorName,
|
||||
QOSCKey.Flagged, QOSCKey.Armed, QOSCKey.Notes };
|
||||
List<string> keys = new List<string> {
|
||||
QOSCKey.UID,
|
||||
QOSCKey.Number,
|
||||
QOSCKey.Name,
|
||||
QOSCKey.ListName,
|
||||
QOSCKey.Type,
|
||||
QOSCKey.ColorName,
|
||||
QOSCKey.Flagged,
|
||||
QOSCKey.Armed,
|
||||
QOSCKey.IsRunning,
|
||||
QOSCKey.IsBroken,
|
||||
QOSCKey.Parent,
|
||||
QOSCKey.Notes
|
||||
};
|
||||
|
||||
fetchPropertiesForCue(cue, keys.ToArray(), false);
|
||||
}
|
||||
|
||||
public void fetchBasicPropertiesForCue(QCue cue)
|
||||
{
|
||||
List<string> keys = new List<string> { QOSCKey.Name, QOSCKey.ListName, QOSCKey.Number, QOSCKey.FileTarget, QOSCKey.CueTargetNumber,
|
||||
QOSCKey.HasFileTargets, QOSCKey.HasCueTargets, QOSCKey.Armed, QOSCKey.ColorName,
|
||||
QOSCKey.ContinueMode, QOSCKey.Flagged, QOSCKey.PreWait, QOSCKey.PostWait,
|
||||
QOSCKey.Duration, QOSCKey.AllowsEditingDuration, QOSCKey.Notes };
|
||||
List<string> keys = new List<string> {
|
||||
QOSCKey.Name,
|
||||
QOSCKey.ListName,
|
||||
QOSCKey.Number,
|
||||
QOSCKey.FileTarget,
|
||||
QOSCKey.CueTargetNumber,
|
||||
QOSCKey.HasFileTargets,
|
||||
QOSCKey.HasCueTargets,
|
||||
QOSCKey.Armed,
|
||||
QOSCKey.ColorName,
|
||||
QOSCKey.ContinueMode,
|
||||
QOSCKey.Flagged,
|
||||
QOSCKey.PreWait,
|
||||
QOSCKey.PostWait,
|
||||
QOSCKey.Duration,
|
||||
QOSCKey.AllowsEditingDuration,
|
||||
QOSCKey.IsBroken,
|
||||
QOSCKey.IsRunning,
|
||||
QOSCKey.IsLoaded,
|
||||
QOSCKey.Notes
|
||||
};
|
||||
|
||||
if (cue.IsGroup)
|
||||
keys.Add(QOSCKey.Children);
|
||||
fetchPropertiesForCue(cue, keys.ToArray(), false);
|
||||
@@ -392,6 +386,11 @@ namespace QControlKit
|
||||
client.sendMessage(address, args);
|
||||
}
|
||||
|
||||
public void sendMessageForCue(QCue cue, string action)
|
||||
{
|
||||
client.sendMessage(addressForCue(cue, action));
|
||||
}
|
||||
|
||||
private string addressForCue(QCue cue, string action)
|
||||
{
|
||||
return $"{workspacePrefix}/cue_id/{cue.propertyForKey(QOSCKey.UID)}/{action}";
|
||||
@@ -423,11 +422,11 @@ namespace QControlKit
|
||||
{
|
||||
//clear passcode if there was one set in the connect() method
|
||||
this.passcode = null;
|
||||
Log.Error($"[workspace] *** Password for workspace {name} was incorrect!");
|
||||
Log.Error($"[workspace] *** Password for workspace <{name}> was incorrect!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"[workspace] *** Unable to connect to workspace: {name} on server: {server.name}");
|
||||
Log.Error($"[workspace] *** Unable to connect to workspace: <{name}> on server: <{server.name}>");
|
||||
}
|
||||
|
||||
WorkspaceConnectionError?.Invoke(this, new QWorkspaceConnectionErrorArgs { status = args.status });
|
||||
@@ -436,6 +435,7 @@ namespace QControlKit
|
||||
private void OnWorkspaceConnected(object source, QWorkspaceConnectedArgs args)
|
||||
{
|
||||
Log.Information($"[workspace] Connection to <{name}> successful, finishing things up.");
|
||||
WorkspaceConnected?.Invoke(this, new QWorkspaceConnectedArgs());
|
||||
finishConnection();
|
||||
}
|
||||
|
||||
@@ -443,6 +443,7 @@ namespace QControlKit
|
||||
{
|
||||
//this might not be called with TCP?
|
||||
Log.Warning($"[workspace] *** Workspace has indicated it is disconnecting");
|
||||
WorkspaceDisconnected?.Invoke(this, new QWorkspaceDisconnectedArgs());
|
||||
}
|
||||
|
||||
private void OnCueListsUpdated(object source, QCueListsUpdatedArgs args)
|
||||
@@ -528,7 +529,7 @@ namespace QControlKit
|
||||
cueList.setProperty(args.cueID, QOSCKey.PlaybackPositionId, false);
|
||||
}
|
||||
|
||||
Log.Debug($"[workspace] cue list <{args.cueListID}> playback position changed to <{args.cueID}>");
|
||||
Log.Information($"[workspace] cue list <{args.cueListID}> playback position changed to <{args.cueID}>");
|
||||
CueListChangedPlaybackPosition?.Invoke(this, new QCueListChangedPlaybackPositionArgs { cueListID = args.cueListID, cueID = args.cueID });
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharpOSC
|
||||
{
|
||||
public static class SlipFrame
|
||||
{
|
||||
static readonly byte END = 0xc0;
|
||||
static readonly byte ESC = 0xdb;
|
||||
static readonly byte ESC_END = 0xDC;
|
||||
static readonly byte ESC_ESC = 0xDD;
|
||||
|
||||
public static List<byte[]> Decode(byte[] data)
|
||||
{
|
||||
List<byte[]> messages = new List<byte[]>();
|
||||
|
||||
List<byte> buffer = new List<byte>();
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
if (data[i] == END && buffer.Count > 0)
|
||||
{
|
||||
messages.Add(buffer.ToArray());
|
||||
buffer.Clear();
|
||||
}
|
||||
else if (data[i] != END)
|
||||
{
|
||||
buffer.Add(data[i]);
|
||||
}
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
|
||||
public static byte[] Encode(byte[] data)
|
||||
{
|
||||
List<byte> slipData = new List<byte>();
|
||||
|
||||
byte[] esc_end = { ESC, ESC_END };
|
||||
byte[] esc_esc = { ESC, ESC_ESC };
|
||||
byte[] end = { END };
|
||||
|
||||
int length = data.Length;
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
if (data[i] == END)
|
||||
{
|
||||
slipData.AddRange(esc_end);
|
||||
}
|
||||
else if (data[i] == ESC)
|
||||
{
|
||||
slipData.AddRange(esc_esc);
|
||||
}
|
||||
else
|
||||
{
|
||||
slipData.Add(data[i]);
|
||||
}
|
||||
}
|
||||
slipData.AddRange(end);
|
||||
return slipData.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using Serilog;
|
||||
using SuperSimpleTcp;
|
||||
|
||||
namespace SharpOSC
|
||||
{
|
||||
@@ -31,30 +29,67 @@ namespace SharpOSC
|
||||
}
|
||||
public delegate void MessageReceivedHandler(object source, MessageEventArgs args);
|
||||
public event MessageReceivedHandler MessageReceived;
|
||||
private Thread receivingThread;
|
||||
string _address;
|
||||
TcpClient client;
|
||||
|
||||
byte END = 0xc0;
|
||||
byte ESC = 0xdb;
|
||||
byte ESC_END = 0xDC;
|
||||
byte ESC_ESC = 0xDD;
|
||||
private Queue<OscPacket> SendQueue = new Queue<OscPacket>();
|
||||
|
||||
private Thread sendThread;
|
||||
|
||||
string _address;
|
||||
|
||||
|
||||
|
||||
SimpleTcpClient simpleClient;
|
||||
|
||||
|
||||
public TCPClient(string address, int port)
|
||||
{
|
||||
_port = port;
|
||||
_address = address;
|
||||
|
||||
simpleClient = new SimpleTcpClient(address, port);
|
||||
simpleClient.Events.Connected += Connected;
|
||||
simpleClient.Events.Disconnected += Disconnected;
|
||||
simpleClient.Events.DataReceived += DataReceived;
|
||||
simpleClient.Logger = Log.Debug;
|
||||
}
|
||||
|
||||
public static string ByteArrayToString(byte[] ba)
|
||||
{
|
||||
return BitConverter.ToString(ba).Replace("-", "");
|
||||
}
|
||||
|
||||
private void DataReceived(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
List<byte[]> messages = SlipFrame.Decode(e.Data);
|
||||
for(int i = 0; i < messages.Count; i++)
|
||||
{
|
||||
OscPacket packet = OscPacket.GetPacket(messages[i]);
|
||||
OscMessage responseMessage = (OscMessage)packet;
|
||||
OnMessageReceived(responseMessage);
|
||||
}
|
||||
}
|
||||
|
||||
private void Disconnected(object sender, ConnectionEventArgs e)
|
||||
{
|
||||
Log.Debug("[tcpClient] connection to " + e.IpPort + " was disconnected");
|
||||
}
|
||||
|
||||
private void Connected(object sender, ConnectionEventArgs e)
|
||||
{
|
||||
Log.Debug($"[tcpclient] connected to <{e.IpPort}>");
|
||||
}
|
||||
|
||||
public bool Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
client = new TcpClient(Address, Port);
|
||||
receivingThread = new Thread(ReceiveLoop);
|
||||
receivingThread.Start();
|
||||
Log.Debug($"[tcpclient] connected to <{Address}:{Port}>");
|
||||
simpleClient.Connect();
|
||||
|
||||
sendThread = new Thread(SendLoop);
|
||||
sendThread.IsBackground = true;
|
||||
sendThread.Start();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -62,14 +97,29 @@ namespace SharpOSC
|
||||
Log.Error(e.Message);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void QueueForSending(OscPacket packet)
|
||||
{
|
||||
SendQueue.Enqueue(packet);
|
||||
}
|
||||
|
||||
private void SendLoop()
|
||||
{
|
||||
while (simpleClient != null && simpleClient.IsConnected)
|
||||
{
|
||||
if(SendQueue.Count > 0)
|
||||
{
|
||||
OscPacket packet = SendQueue.Dequeue();
|
||||
Send(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Send(byte[] message)
|
||||
{
|
||||
byte[] slipData = SlipEncode(message);
|
||||
NetworkStream netStream = client.GetStream();
|
||||
netStream.Write(slipData.ToArray(), 0, slipData.ToArray().Length);
|
||||
byte[] slipData = SlipFrame.Encode(message);
|
||||
simpleClient.Send(slipData);
|
||||
}
|
||||
|
||||
public void Send(OscPacket packet)
|
||||
@@ -82,96 +132,22 @@ namespace SharpOSC
|
||||
{
|
||||
get
|
||||
{
|
||||
if (client == null)
|
||||
if (simpleClient == null)
|
||||
return false;
|
||||
else
|
||||
return client.Connected;
|
||||
return simpleClient.IsConnected;
|
||||
}
|
||||
}
|
||||
|
||||
public void ReceiveLoop()
|
||||
{
|
||||
while (client.Connected)
|
||||
{
|
||||
Receive();
|
||||
}
|
||||
//Log.Debug("[tcpclient] - ReceiveLoop has exited");
|
||||
}
|
||||
|
||||
public void Receive()
|
||||
{
|
||||
Random random = new Random();
|
||||
int num = random.Next(1000);
|
||||
try
|
||||
{
|
||||
NetworkStream netStream = client.GetStream();
|
||||
netStream.ReadTimeout = 250;
|
||||
List<byte> responseData = new List<byte>();
|
||||
if (netStream.CanRead)
|
||||
{
|
||||
//var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
byte[] buffer = new byte[256];
|
||||
|
||||
int bytesRead = 0;
|
||||
int reads = 0;
|
||||
do
|
||||
{
|
||||
bytesRead = netStream.Read(buffer, 0, buffer.Length);
|
||||
responseData.AddRange(buffer);
|
||||
reads += 1;
|
||||
Thread.Sleep(1);
|
||||
//Log.Debug("Thread " + num + ": Bytes read: " + bytesRead + " - " + Encoding.UTF8.GetString(buffer));
|
||||
} while (netStream.DataAvailable);
|
||||
|
||||
//Console.WriteLine("Raw TCP In: " + System.Text.Encoding.UTF8.GetString(responseData.ToArray()));
|
||||
OscMessage response = (OscMessage)OscPacket.GetPacket(responseData.Skip(1).ToArray());
|
||||
//watch.Stop();
|
||||
//Console.WriteLine($"TCPCLient - message receive took {watch.ElapsedMilliseconds}ms and {reads} reads");
|
||||
OnMessageReceived(response);
|
||||
}
|
||||
} catch(Exception e)
|
||||
{
|
||||
//Console.WriteLine("TCPSENDER - Receive Exception: " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] SlipEncode(byte[] data)
|
||||
{
|
||||
List<byte> slipData = new List<byte>();
|
||||
|
||||
byte[] esc_end = { ESC, ESC_END };
|
||||
byte[] esc_esc = { ESC, ESC_ESC };
|
||||
byte[] end = { END };
|
||||
|
||||
int length = data.Length;
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
if (data[i] == END)
|
||||
{
|
||||
slipData.AddRange(esc_end);
|
||||
}
|
||||
else if (data[i] == ESC)
|
||||
{
|
||||
slipData.AddRange(esc_esc);
|
||||
}
|
||||
else
|
||||
{
|
||||
slipData.Add(data[i]);
|
||||
}
|
||||
}
|
||||
slipData.AddRange(end);
|
||||
return slipData.ToArray();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (client != null)
|
||||
Log.Information("[tcpclient] Close() was requested");
|
||||
if (simpleClient != null)
|
||||
{
|
||||
if (client.Connected)
|
||||
if (simpleClient.IsConnected)
|
||||
{
|
||||
Log.Debug($"[tcpClient] closing connection to {Address}");
|
||||
client.GetStream().Close();
|
||||
client.Close();
|
||||
Log.Information($"[tcpClient] closing connection to {Address}");
|
||||
simpleClient.Disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.jwetzell.qcontrolkitxamdemo">
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
|
||||
<application android:label="QControlKitXamDemo.Android"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
@@ -16,7 +16,7 @@
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
|
||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
@@ -32,6 +32,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -56,8 +57,8 @@
|
||||
<PackageReference Include="Serilog.Sinks.Xamarin">
|
||||
<Version>0.2.0.64</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
@@ -100,6 +101,9 @@
|
||||
<Name>QControlKitXamDemo</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidAsset Include="Assets\materialdesignicons-webfont.ttf" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace QControlKitXamDemo.iOS
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init();
|
||||
Log.Logger = new LoggerConfiguration().WriteTo.NSLog().MinimumLevel.Debug().CreateLogger();
|
||||
Log.Logger = new LoggerConfiguration().WriteTo.NSLog().MinimumLevel.Information().CreateLogger();
|
||||
LoadApplication(new App());
|
||||
|
||||
return base.FinishedLaunching(app, options);
|
||||
|
||||
@@ -2,37 +2,47 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>QControlKitXamDemo</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.QControlKitXamDemo</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>QControlKitXamDemo</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>QControlKitXamDemo</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.QControlKitXamDemo</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>QControlKitXamDemo</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
<key>NSBonjourServices</key>
|
||||
<array>
|
||||
<string>_qlab._tcp</string>
|
||||
</array>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>Scan network for QLab instances</string>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>materialdesignicons-webfont.ttf</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchInterpreter>-all</MtouchInterpreter>
|
||||
<CodesignProvision>Wildcard</CodesignProvision>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
@@ -130,8 +131,11 @@
|
||||
<PackageReference Include="Serilog.Sinks.Xamarin">
|
||||
<Version>0.2.0.64</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
|
||||
<PackageReference Include="SuperSimpleTcp">
|
||||
<Version>2.6.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
@@ -140,4 +144,7 @@
|
||||
<Name>QControlKitXamDemo</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\materialdesignicons-webfont.ttf" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Binary file not shown.
@@ -6,6 +6,52 @@
|
||||
mc:Ignorable="d"
|
||||
x:Class="QControlKitXamDemo.App">
|
||||
<Application.Resources>
|
||||
<OnPlatform x:Key="MaterialFontFamily" x:TypeArguments="x:String">
|
||||
<On Platform="iOS">Material Design Icons</On>
|
||||
<On Platform="Android">materialdesignicons-webfont.ttf#Material Design Icons</On>
|
||||
</OnPlatform>
|
||||
|
||||
<Style TargetType="Label"
|
||||
Class="PrimaryText"
|
||||
ApplyToDerivedTypes="true">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource PrimaryTextColor}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button"
|
||||
Class="PrimaryButton"
|
||||
ApplyToDerivedTypes="true">
|
||||
<Setter Property="TextColor"
|
||||
Value="{DynamicResource PrimaryTextColor}" />
|
||||
</Style>
|
||||
|
||||
<x:Double x:Key="SmallPadding">4</x:Double>
|
||||
<x:Double x:Key="MediumPadding">8</x:Double>
|
||||
<x:Double x:Key="StandardPadding">16</x:Double>
|
||||
|
||||
<Thickness x:Key="SmallTopThickness" Top="{StaticResource SmallPadding}" />
|
||||
|
||||
<Thickness x:Key="MediumTopThickness" Top="{StaticResource MediumPadding}" />
|
||||
|
||||
<Thickness x:Key="StandardTopThickness" Top="{StaticResource StandardPadding}" />
|
||||
|
||||
<Thickness x:Key="SmallThickness"
|
||||
Bottom="{StaticResource SmallPadding}"
|
||||
Left="{StaticResource SmallPadding}"
|
||||
Right="{StaticResource SmallPadding}"
|
||||
Top="{StaticResource SmallPadding}" />
|
||||
|
||||
<Thickness x:Key="MediumThickness"
|
||||
Bottom="{StaticResource MediumPadding}"
|
||||
Left="{StaticResource MediumPadding}"
|
||||
Right="{StaticResource MediumPadding}"
|
||||
Top="{StaticResource MediumPadding}" />
|
||||
|
||||
<Thickness x:Key="StandardThickness"
|
||||
Bottom="{StaticResource StandardPadding}"
|
||||
Left="{StaticResource StandardPadding}"
|
||||
Right="{StaticResource StandardPadding}"
|
||||
Top="{StaticResource StandardPadding}" />
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -9,6 +9,8 @@ namespace QControlKitXamDemo
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new NavigationPage(new MainPage());
|
||||
Current.RequestedThemeChanged += Current_RequestedThemeChanged;
|
||||
SetAppResources();
|
||||
}
|
||||
|
||||
protected override void OnStart()
|
||||
@@ -22,5 +24,80 @@ namespace QControlKitXamDemo
|
||||
protected override void OnResume()
|
||||
{
|
||||
}
|
||||
|
||||
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e)
|
||||
{
|
||||
SetAppResources();
|
||||
}
|
||||
|
||||
private void SetAppResources()
|
||||
{
|
||||
|
||||
switch (Current.RequestedTheme)
|
||||
{
|
||||
case OSAppTheme.Light:
|
||||
SetLightResources();
|
||||
break;
|
||||
case OSAppTheme.Dark:
|
||||
SetDarkResources();
|
||||
break;
|
||||
case OSAppTheme.Unspecified:
|
||||
//Default to Light
|
||||
SetLightResources();
|
||||
break;
|
||||
default:
|
||||
SetLightResources();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetDarkResources()
|
||||
{
|
||||
|
||||
Resources["NavigationBarColor"] = Color.FromHex("#3f6dab");
|
||||
Resources["PageBackgroundColor"] = Color.FromHex("#525252");
|
||||
|
||||
|
||||
Resources["PrimaryColor"] = Color.WhiteSmoke;
|
||||
Resources["SecondaryColor"] = Color.White;
|
||||
Resources["PrimaryTextColor"] = Color.LightGray;
|
||||
Resources["SecondaryTextColor"] = Color.White;
|
||||
Resources["TertiaryTextColor"] = Color.Gray;
|
||||
Resources["TransparentColor"] = Color.Transparent;
|
||||
|
||||
Resources["IconTextColor"] = Color.WhiteSmoke;
|
||||
|
||||
Resources["ListViewBackgroundColor"] = Color.FromHex("#363636");
|
||||
|
||||
Resources["ServerCellBackgroundColor"] = Color.FromHex("#363636");
|
||||
Resources["WorkspaceCellBackgroundColor"] = Color.FromHex("#737373");
|
||||
|
||||
Resources["SelectedCueCellBackgroundColor"] = Color.FromHex("#737373");
|
||||
|
||||
}
|
||||
|
||||
private void SetLightResources()
|
||||
{
|
||||
Resources["NavigationBarColor"] = Color.FromHex("#3089ff");
|
||||
Resources["PageBackgroundColor"] = Color.LightGray;
|
||||
|
||||
|
||||
Resources["PrimaryColor"] = Color.WhiteSmoke;
|
||||
Resources["SecondaryColor"] = Color.White;
|
||||
Resources["PrimaryTextColor"] = Color.Black;
|
||||
Resources["SecondaryTextColor"] = Color.White;
|
||||
Resources["TertiaryTextColor"] = Color.Gray;
|
||||
Resources["TransparentColor"] = Color.Transparent;
|
||||
|
||||
Resources["IconTextColor"] = Color.Black;
|
||||
|
||||
Resources["ListViewBackgroundColor"] = Color.White;
|
||||
|
||||
Resources["ServerCellBackgroundColor"] = Color.White;
|
||||
Resources["WorkspaceCellBackgroundColor"] = Color.FromHex("#D8D8D8");
|
||||
|
||||
Resources["SelectedCueCellBackgroundColor"] = Color.FromHex("#D8D8D8");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace QControlKitXamDemo
|
||||
HorizontalOptions = LayoutOptions.StartAndExpand,
|
||||
VerticalTextAlignment = TextAlignment.Center,
|
||||
};
|
||||
cueLabel.SetBinding(Label.TextProperty, "name", BindingMode.OneWay);
|
||||
cueLabel.SetBinding(Label.TextProperty, "status", BindingMode.OneWay);
|
||||
var cueBackground = new Frame
|
||||
{
|
||||
BindingContext = qCueViewModel,
|
||||
|
||||
@@ -3,14 +3,121 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Class="QControlKitXamDemo.MainPage">
|
||||
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
mc:Ignorable="d"
|
||||
x:Class="QControlKitXamDemo.MainPage"
|
||||
ios:Page.UseSafeArea="true"
|
||||
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
||||
<ContentPage.Content>
|
||||
|
||||
<ListView x:Name="serverListView" GroupDisplayBinding="{Binding name}" IsGroupingEnabled="True">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextCell Text="{Binding name}"/>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
</ContentPage>
|
||||
<StackLayout>
|
||||
<Frame BackgroundColor="{DynamicResource PageBackgroundColor}"
|
||||
CornerRadius="0"
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
HasShadow="False">
|
||||
<StackLayout Spacing="0" BackgroundColor="Transparent">
|
||||
<Label Margin="0,10,0,10"
|
||||
Padding="0"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
HorizontalTextAlignment="Center"
|
||||
FontSize="Title"
|
||||
Text="Discovered QLab Instances" />
|
||||
<!--Need to try and remove the group spacing caused by ios:GroupHeaderStyle-->
|
||||
<ListView x:Name="serverListView"
|
||||
ios:ListView.GroupHeaderStyle="Grouped"
|
||||
GroupDisplayBinding="{Binding name}"
|
||||
IsGroupingEnabled="True"
|
||||
d:IsGroupingEnabled="False"
|
||||
BackgroundColor="Transparent"
|
||||
SeparatorVisibility="None"
|
||||
ItemsSource="{Binding ServersGrouped}"
|
||||
Margin="0">
|
||||
<ListView.GroupHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Frame BackgroundColor="{DynamicResource ServerCellBackgroundColor}"
|
||||
Margin="0,0,0,0"
|
||||
Padding="10,0,10,0"
|
||||
CornerRadius="0">
|
||||
<Grid BackgroundColor="Transparent" VerticalOptions="FillAndExpand"
|
||||
RowSpacing="0"
|
||||
ColumnSpacing="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Column="0"
|
||||
Text="{Binding GroupName}"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center"
|
||||
HorizontalTextAlignment="Start"
|
||||
StyleClass="PrimaryText"/>
|
||||
<Label Grid.Column="1"
|
||||
Text="{Binding version}"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center"
|
||||
HorizontalTextAlignment="End"
|
||||
StyleClass="PrimaryText"/>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.GroupHeaderTemplate>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Frame BackgroundColor="{DynamicResource WorkspaceCellBackgroundColor}"
|
||||
BorderColor="Black"
|
||||
Margin="5,0,5,0"
|
||||
Padding="10,0,10,0"
|
||||
CornerRadius="0"
|
||||
HasShadow="False">
|
||||
<Grid Margin="0"
|
||||
BackgroundColor="Transparent"
|
||||
RowSpacing="0"
|
||||
ColumnSpacing="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Label Grid.Column="0" Text="{Binding Name}"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center"
|
||||
HorizontalTextAlignment="Start"
|
||||
StyleClass="PrimaryText"/>
|
||||
|
||||
<Label Grid.Column="1" Text="󱆄"
|
||||
FontFamily="{StaticResource MaterialFontFamily}"
|
||||
FontSize="Large"
|
||||
IsVisible="{Binding HasPasscode}"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
VerticalTextAlignment="Center"
|
||||
HorizontalTextAlignment="End"
|
||||
StyleClass="PrimaryText"/>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackLayout>
|
||||
</Frame>
|
||||
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
@@ -2,146 +2,71 @@
|
||||
using System.ComponentModel;
|
||||
using Xamarin.Forms;
|
||||
using QControlKit;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using QControlKit.Events;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using QControlKitXamDemo.ViewModels;
|
||||
using Acr.UserDialogs;
|
||||
|
||||
namespace QControlKitXamDemo
|
||||
{
|
||||
// Learn more about making custom code visible in the Xamarin.Forms previewer
|
||||
// by visiting https://aka.ms/xamarinforms-previewer
|
||||
[DesignTimeVisible(false)]
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
public ObservableCollection<ServerGroup> servers = new ObservableCollection<ServerGroup>();
|
||||
private QBrowserViewModel qBrowserViewModel;
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
serverListView.ItemsSource = servers;
|
||||
QBrowser browser = new QBrowser();
|
||||
browser.ServerLost += Browser_ServerLost;
|
||||
browser.ServerFound += Browser_ServerFound;
|
||||
serverListView.ItemSelected += ServerListView_ItemSelected;
|
||||
|
||||
Device.StartTimer(TimeSpan.FromSeconds(5), () =>
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
browser.ProbeForQLabInstances();
|
||||
});
|
||||
return true;
|
||||
});
|
||||
qBrowserViewModel = new QBrowserViewModel(new QBrowser());
|
||||
serverListView.BindingContext = qBrowserViewModel;
|
||||
serverListView.ItemSelected += QWorkspaceSelected;
|
||||
|
||||
}
|
||||
|
||||
private void Browser_ServerFound(object source, QServerFoundArgs args)
|
||||
async void QWorkspaceSelected(object sender, SelectedItemChangedEventArgs e)
|
||||
{
|
||||
List<ServerGroup> serverGroups = servers.ToList();
|
||||
|
||||
bool serverFound = false;
|
||||
foreach (var serverGroup in serverGroups)
|
||||
if (e.SelectedItem == null)
|
||||
{
|
||||
|
||||
if (serverGroup.host == args.server.host)
|
||||
{
|
||||
serverFound = true;
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!serverFound)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
ServerGroup serverGroup = new ServerGroup(args.server.name);
|
||||
args.server.WorkspaceAdded += Server_WorkspaceAdded;
|
||||
args.server.WorkspaceRemoved += Server_WorkspaceRemoved;
|
||||
serverGroup.host = args.server.host;
|
||||
servers.Add(serverGroup);
|
||||
});
|
||||
}
|
||||
}
|
||||
qBrowserViewModel.autoUpdate = false;
|
||||
QWorkspace selectedWorkspace = (e.SelectedItem as QWorkspaceViewModel).workspace;
|
||||
Log.Debug($"[demo] workspace: {selectedWorkspace.nameWithoutPathExtension} has been selected");
|
||||
((ListView)sender).SelectedItem = null;
|
||||
|
||||
private void Server_WorkspaceRemoved(object source, QServerWorkspaceChangedArgs args)
|
||||
{
|
||||
foreach (var server in servers)
|
||||
if (selectedWorkspace.hasPasscode)
|
||||
{
|
||||
if (server.host == args.server.host)
|
||||
UserDialogs.Instance.Prompt(new PromptConfig
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
InputType = InputType.Number,
|
||||
MaxLength = 4,
|
||||
Title = "Workspace Requires Passcode",
|
||||
OkText = "Connect",
|
||||
IsCancellable = true,
|
||||
OnTextChanged = args =>
|
||||
{
|
||||
server.Remove(args.workspace);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Server_WorkspaceAdded(object source, QServerWorkspaceChangedArgs args)
|
||||
{
|
||||
foreach(var server in servers)
|
||||
{
|
||||
if(server.host == args.server.host)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
args.IsValid = args.Value != null && !args.Value.Equals("") && args.Value.Length == 4;
|
||||
},
|
||||
OnAction = async (resp) =>
|
||||
{
|
||||
server.Add(args.workspace);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Browser_ServerLost(object source, QServerLostArgs args)
|
||||
{
|
||||
|
||||
List<ServerGroup> serverGroups = servers.ToList();
|
||||
foreach(var serverGroup in serverGroups)
|
||||
{
|
||||
if(serverGroup.host == args.server.host)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
servers.Remove(serverGroup);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async void ServerListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
|
||||
{
|
||||
if(e.SelectedItem != null)
|
||||
{
|
||||
QWorkspace selectedWorkspace = e.SelectedItem as QWorkspace;
|
||||
Log.Debug($"[demo] Workspace <{selectedWorkspace.nameWithoutPathExtension}> has been selected");
|
||||
if (selectedWorkspace.hasPasscode)
|
||||
{
|
||||
string passcode = await DisplayPromptAsync("Workspace has passcode", "Enter Passcode", maxLength: 4, keyboard: Keyboard.Numeric);
|
||||
if (passcode != null)
|
||||
{
|
||||
|
||||
await Navigation.PushAsync(new CueListPage(selectedWorkspace, passcode));
|
||||
if (resp.Ok)
|
||||
{
|
||||
await Navigation.PushAsync(new CueListPage(selectedWorkspace, resp.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await Navigation.PushAsync(new CueListPage(selectedWorkspace));
|
||||
|
||||
}
|
||||
serverListView.SelectedItem = null;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
await Navigation.PushAsync(new CueListPage(selectedWorkspace));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ServerGroup : ObservableCollection<QWorkspace>{
|
||||
public string name { get; set; }
|
||||
public string host { get; set; }
|
||||
public ServerGroup(string name)
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
this.name = name;
|
||||
base.OnAppearing();
|
||||
qBrowserViewModel.autoUpdate = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
|
||||
<PackageReference Include="Acr.UserDialogs" Version="7.2.0.562" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -28,4 +29,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\QControlKit\QControlKit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Acr.UserDialogs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,93 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Xamarin.Forms;
|
||||
|
||||
using QControlKit;
|
||||
using QControlKit.Events;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
|
||||
namespace QControlKitXamDemo.ViewModels
|
||||
{
|
||||
public class QBrowserViewModel : INotifyPropertyChanged
|
||||
{
|
||||
QBrowser browser;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
public bool autoUpdate = false;
|
||||
public ObservableCollection<QServerViewModel> ServersGrouped { get; set; }
|
||||
public QBrowserViewModel(QBrowser browser)
|
||||
{
|
||||
this.browser = browser;
|
||||
ServersGrouped = new ObservableCollection<QServerViewModel>();
|
||||
|
||||
this.browser.ServerFound += OnServerFound;
|
||||
this.browser.ServerLost += OnServerLost;
|
||||
Device.StartTimer(TimeSpan.FromSeconds(4), () =>
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (autoUpdate)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Log.Debug("[QBrowserViewModel] QBrowser probe triggered");
|
||||
this.browser.ProbeForQLabInstances();
|
||||
});
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void OnServerFound(object source, QServerFoundArgs args)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Log.Debug($"[QBrowserViewModel] adding server: {args.server.description}");
|
||||
ServersGrouped.Add(new QServerViewModel(args.server));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void OnServerLost(object source, QServerLostArgs args)
|
||||
{
|
||||
QServerViewModel serverToRemove = null;
|
||||
|
||||
foreach (QServerViewModel serverGroup in ServersGrouped)
|
||||
{
|
||||
if (serverGroup.host.Equals(args.server.host))
|
||||
{
|
||||
serverToRemove = serverGroup;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (serverToRemove != null)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Log.Debug($"[QBrowserViewModel] removing server: {args.server.description}");
|
||||
ServersGrouped.Remove(serverToRemove);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void OnPropertyChanged([CallerMemberName] string name = "")
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
|
||||
public void InitiateScan()
|
||||
{
|
||||
if (!autoUpdate)
|
||||
{
|
||||
Log.Debug("[QBrowserViewModel] Manual Scan Initiated");
|
||||
browser.ProbeForQLabInstances();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using Xamarin.Forms;
|
||||
using Serilog;
|
||||
using QControlKit.Events;
|
||||
using QControlKit.Constants;
|
||||
using System;
|
||||
|
||||
namespace QControlKitXamDemo.ViewModels
|
||||
{
|
||||
@@ -26,13 +27,19 @@ namespace QControlKitXamDemo.ViewModels
|
||||
{
|
||||
foreach(var property in args.properties)
|
||||
{
|
||||
Log.Debug($"[cueviewmodel] property <{property}> has been updated.");
|
||||
Log.Debug($"[cueviewmodel] property <{property}> has been updated for cue {name}.");
|
||||
if (property.Equals(QOSCKey.Name) || property.Equals(QOSCKey.ListName))
|
||||
{
|
||||
OnPropertyChanged("name");
|
||||
}else if (property.Equals(QOSCKey.ColorName))
|
||||
{
|
||||
OnPropertyChanged("color");
|
||||
}else if (property.Equals(QOSCKey.ActionElapsed))
|
||||
{
|
||||
OnPropertyChanged("actionElapsed");
|
||||
}else if (property.Equals(QOSCKey.IsBroken) || property.Equals(QOSCKey.IsRunning))
|
||||
{
|
||||
OnPropertyChanged("status");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +91,34 @@ namespace QControlKitXamDemo.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public string actionElapsed
|
||||
{
|
||||
get
|
||||
{
|
||||
TimeSpan time = TimeSpan.FromSeconds(cue.actionElapsed);
|
||||
|
||||
return time.ToString(@"mm\:ss\:ff");
|
||||
}
|
||||
}
|
||||
|
||||
public string status
|
||||
{
|
||||
get
|
||||
{
|
||||
if (cue.IsRunning)
|
||||
{
|
||||
return "running";
|
||||
}else if (cue.IsBroken)
|
||||
{
|
||||
return "broken";
|
||||
}
|
||||
else
|
||||
{
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSelected {
|
||||
get
|
||||
{
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Xamarin.Forms;
|
||||
|
||||
using QControlKit;
|
||||
using QControlKit.Events;
|
||||
|
||||
namespace QControlKitXamDemo.ViewModels
|
||||
{
|
||||
public class QServerViewModel : ObservableCollection<QWorkspaceViewModel>, INotifyPropertyChanged
|
||||
{
|
||||
QServer server;
|
||||
public new event PropertyChangedEventHandler PropertyChanged;
|
||||
public string name
|
||||
{
|
||||
get => server.name;
|
||||
set => server.name = value;
|
||||
}
|
||||
|
||||
public string host => server.host;
|
||||
|
||||
public string version => server.version == null ? "" : $"v{server.version}";
|
||||
|
||||
public string GroupName => $"{name} ({host})";
|
||||
|
||||
public QServerViewModel(QServer server)
|
||||
{
|
||||
this.server = server;
|
||||
name = this.server.name;
|
||||
foreach (QWorkspace workspace in this.server.workspaces)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Add(new QWorkspaceViewModel(workspace));
|
||||
});
|
||||
}
|
||||
this.server.WorkspaceAdded += Server_WorkspaceAdded;
|
||||
this.server.WorkspaceRemoved += Server_WorkspaceRemoved;
|
||||
this.server.ServerUpdated += OnServerUpdated;
|
||||
}
|
||||
|
||||
private void Server_WorkspaceRemoved(object source, QServerWorkspaceChangedArgs args)
|
||||
{
|
||||
QWorkspaceViewModel workspaceToRemove = null;
|
||||
|
||||
foreach (QWorkspaceViewModel workspaceViewModel in this)
|
||||
{
|
||||
if (workspaceViewModel.workspace.uniqueID == args.workspace.uniqueID)
|
||||
{
|
||||
workspaceToRemove = workspaceViewModel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (workspaceToRemove != null)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Remove(workspaceToRemove);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Server_WorkspaceAdded(object source, QServerWorkspaceChangedArgs args)
|
||||
{
|
||||
QWorkspaceViewModel workspaceViewModel = new QWorkspaceViewModel(args.workspace);
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
Add(workspaceViewModel);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OnServerUpdated(object source, QServerUpdatedArgs args)
|
||||
{
|
||||
OnPropertyChanged("GroupName");
|
||||
OnPropertyChanged("version");
|
||||
}
|
||||
|
||||
void OnPropertyChanged([CallerMemberName] string name = "")
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using QControlKit;
|
||||
|
||||
namespace QControlKitXamDemo.ViewModels
|
||||
{
|
||||
public class QWorkspaceViewModel
|
||||
{
|
||||
public QWorkspace workspace;
|
||||
public QWorkspaceViewModel(QWorkspace workspace)
|
||||
{
|
||||
this.workspace = workspace;
|
||||
}
|
||||
|
||||
public string Name => workspace.name;
|
||||
|
||||
public bool HasPasscode => workspace.hasPasscode;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user