diff --git a/VL.Core/src/Lang.PublicAPI/Message.cs b/VL.Core/src/Lang.PublicAPI/Message.cs index e3ff956d..c3b5a8c7 100644 --- a/VL.Core/src/Lang.PublicAPI/Message.cs +++ b/VL.Core/src/Lang.PublicAPI/Message.cs @@ -37,6 +37,22 @@ public class Message : IEquatable private bool? flowToParent; public readonly object Symbol; + /// + /// A short version of the original `What` containing only the first line. + /// + public string ShortWhat + { + get + { + // Tests for both Unix (\n) and Non-unix (\r\n) + var newLineIndex = What.IndexOf('\n'); + if (newLineIndex > 0) + return What.Substring(0, newLineIndex); + + return What; + } + } + public Message(MessageSeverity severity, string what, string why = "", string how = "", string ignore = "", object symbol = null) : this(default(UniqueId), severity, what, why, how, ignore, symbol: symbol) { diff --git a/VL.Core/src/Logging/LogMessage.cs b/VL.Core/src/Logging/LogMessage.cs index 4a29f75b..2857a030 100644 --- a/VL.Core/src/Logging/LogMessage.cs +++ b/VL.Core/src/Logging/LogMessage.cs @@ -43,7 +43,8 @@ public string ShortMessage { get { - var newLineIndex = Message.IndexOf(Environment.NewLine); + // Tests for both Unix (\n) and Non-unix (\r\n) + var newLineIndex = Message.IndexOf('\n'); if (newLineIndex > 0) return Message.Substring(0, newLineIndex); diff --git a/VL.Core/tests/VL.Core.Tests.csproj b/VL.Core/tests/VL.Core.Tests.csproj index 6325e583..d36716c4 100644 --- a/VL.Core/tests/VL.Core.Tests.csproj +++ b/VL.Core/tests/VL.Core.Tests.csproj @@ -8,11 +8,6 @@ false - - - - - diff --git a/VL.CoreLib/CoreLibBasics.vl b/VL.CoreLib/CoreLibBasics.vl index 89270f84..39b2b3fc 100644 --- a/VL.CoreLib/CoreLibBasics.vl +++ b/VL.CoreLib/CoreLibBasics.vl @@ -1,5 +1,5 @@  - + @@ -60905,7 +60905,7 @@ ************************ GetCenter ************************ --> - + @@ -60916,7 +60916,7 @@ - + @@ -60924,7 +60924,7 @@ - + @@ -60932,7 +60932,7 @@ - + @@ -60961,7 +60961,7 @@ ************************ GetCenterWidth ************************ --> - + @@ -60972,7 +60972,7 @@ - + @@ -60980,7 +60980,7 @@ - + @@ -60988,7 +60988,7 @@ - + @@ -60996,7 +60996,7 @@ - + @@ -61031,12 +61031,12 @@ ************************ GetWidth ************************ --> - + - + @@ -61044,7 +61044,7 @@ - + @@ -61071,7 +61071,7 @@ ************************ Range (Join Center Width) ************************ --> - + @@ -61082,7 +61082,7 @@ - + @@ -61090,7 +61090,7 @@ - + @@ -61098,7 +61098,7 @@ - + @@ -61106,7 +61106,7 @@ - + @@ -61140,12 +61140,12 @@ ************************ Range (Join) ************************ --> - + - + @@ -61174,25 +61174,22 @@ ************************ CreateDefault (Hidden) ************************ --> - + - - - - - - - - - - - + + + + + + + + @@ -63454,12 +63451,12 @@ ************************ Clamp ************************ --> - + - + @@ -63468,7 +63465,7 @@ - + @@ -63501,12 +63498,12 @@ ************************ Clamp (Range) ************************ --> - + - + @@ -63516,7 +63513,7 @@ - + @@ -63525,7 +63522,7 @@ - + @@ -63556,12 +63553,12 @@ ************************ Clamp (UnitRange) ************************ --> - + - + @@ -63569,22 +63566,22 @@ - + - + - - + + - + @@ -63592,13 +63589,13 @@ - + - + @@ -63671,14 +63668,14 @@ - + - - + + @@ -63700,8 +63697,8 @@ - - + + @@ -63771,12 +63768,12 @@ ************************ Map ************************ --> - + - + @@ -63784,7 +63781,7 @@ - + @@ -63792,7 +63789,7 @@ - + @@ -63800,7 +63797,7 @@ - + @@ -63808,7 +63805,7 @@ - + @@ -63816,7 +63813,7 @@ - + @@ -63862,12 +63859,12 @@ ************************ Map (Range) ************************ --> - + - + @@ -63877,7 +63874,7 @@ - + @@ -63885,7 +63882,7 @@ - + @@ -63893,7 +63890,7 @@ - + @@ -63901,7 +63898,7 @@ - + @@ -63909,7 +63906,7 @@ - + @@ -63919,7 +63916,7 @@ - + @@ -63927,7 +63924,7 @@ - + @@ -63969,12 +63966,12 @@ ************************ MapClamp ************************ --> - + - + @@ -63982,7 +63979,7 @@ - + @@ -63990,7 +63987,7 @@ - + @@ -63998,7 +63995,7 @@ - + @@ -64006,7 +64003,7 @@ - + @@ -64014,7 +64011,7 @@ - + @@ -64022,7 +64019,7 @@ - + @@ -64069,12 +64066,12 @@ ************************ MapClamp (Range) ************************ --> - + - + @@ -64084,7 +64081,7 @@ - + @@ -64094,7 +64091,7 @@ - + @@ -64102,7 +64099,7 @@ - + @@ -64110,7 +64107,7 @@ - + @@ -64118,7 +64115,7 @@ - + @@ -64126,7 +64123,7 @@ - + @@ -64134,7 +64131,7 @@ - + @@ -64142,7 +64139,7 @@ - + @@ -64185,12 +64182,12 @@ ************************ MapDelegate ************************ --> - + - + @@ -64198,7 +64195,7 @@ - + @@ -64206,7 +64203,7 @@ - + @@ -64214,7 +64211,7 @@ - + @@ -64222,7 +64219,7 @@ - + @@ -64230,7 +64227,7 @@ - + @@ -64238,7 +64235,7 @@ - + @@ -64290,12 +64287,12 @@ ************************ MapDelegate (Range) ************************ --> - + - + @@ -64305,7 +64302,7 @@ - + @@ -64315,7 +64312,7 @@ - + @@ -64323,7 +64320,7 @@ - + @@ -64331,7 +64328,7 @@ - + @@ -64339,7 +64336,7 @@ - + @@ -64347,7 +64344,7 @@ - + @@ -64355,7 +64352,7 @@ - + @@ -64363,7 +64360,7 @@ - + @@ -64411,12 +64408,12 @@ ************************ MapMirror ************************ --> - + - + @@ -64424,7 +64421,7 @@ - + @@ -64432,7 +64429,7 @@ - + @@ -64440,7 +64437,7 @@ - + @@ -64448,7 +64445,7 @@ - + @@ -64456,7 +64453,7 @@ - + @@ -64464,7 +64461,7 @@ - + @@ -64511,12 +64508,12 @@ ************************ MapMirror (Range) ************************ --> - + - + @@ -64526,7 +64523,7 @@ - + @@ -64536,7 +64533,7 @@ - + @@ -64544,7 +64541,7 @@ - + @@ -64552,7 +64549,7 @@ - + @@ -64560,7 +64557,7 @@ - + @@ -64568,7 +64565,7 @@ - + @@ -64576,7 +64573,7 @@ - + @@ -64584,7 +64581,7 @@ - + @@ -64627,12 +64624,12 @@ ************************ MapWrap ************************ --> - + - + @@ -64640,7 +64637,7 @@ - + @@ -64648,7 +64645,7 @@ - + @@ -64656,7 +64653,7 @@ - + @@ -64664,7 +64661,7 @@ - + @@ -64672,7 +64669,7 @@ - + @@ -64705,7 +64702,7 @@ - + @@ -64730,12 +64727,12 @@ ************************ MapWrap (Range) ************************ --> - + - + @@ -64745,7 +64742,7 @@ - + @@ -64755,7 +64752,7 @@ - + @@ -64763,7 +64760,7 @@ - + @@ -64771,7 +64768,7 @@ - + @@ -64779,7 +64776,7 @@ - + @@ -64787,7 +64784,7 @@ - + @@ -64795,7 +64792,7 @@ - + @@ -64803,7 +64800,7 @@ - + @@ -64848,12 +64845,12 @@ ************************ Max ************************ --> - + - + @@ -64861,7 +64858,7 @@ - + @@ -64898,12 +64895,12 @@ ************************ Min ************************ --> - + - + @@ -64911,7 +64908,7 @@ - + @@ -64948,12 +64945,12 @@ ************************ Mirror ************************ --> - + - + @@ -64961,7 +64958,7 @@ - + @@ -64969,7 +64966,7 @@ - + @@ -64991,7 +64988,7 @@ - + @@ -65001,7 +64998,7 @@ - + @@ -65010,7 +65007,7 @@ - + @@ -65021,7 +65018,7 @@ - + @@ -65032,7 +65029,7 @@ - + @@ -65056,12 +65053,12 @@ ************************ Mirror (Range) ************************ --> - + - + @@ -65069,7 +65066,7 @@ - + @@ -65077,7 +65074,7 @@ - + @@ -65085,7 +65082,7 @@ - + @@ -65093,7 +65090,7 @@ - + @@ -65101,7 +65098,7 @@ - + @@ -65109,7 +65106,7 @@ - + @@ -65148,7 +65145,7 @@ ************************ Mirror (UnitRange) ************************ --> - + @@ -65165,7 +65162,7 @@ - + @@ -65173,13 +65170,13 @@ - + - + @@ -65187,14 +65184,14 @@ - + - + @@ -65202,7 +65199,7 @@ - + @@ -65211,7 +65208,7 @@ - + @@ -65243,7 +65240,7 @@ ************************ RangeContainsValue ************************ --> - + @@ -65252,16 +65249,16 @@ - + - - + + - + @@ -65270,7 +65267,7 @@ - + @@ -65280,7 +65277,7 @@ - + @@ -65293,16 +65290,16 @@ - + - - + + - + @@ -65311,7 +65308,7 @@ - + @@ -65321,7 +65318,7 @@ - + @@ -65335,7 +65332,7 @@ - + @@ -65384,7 +65381,7 @@ ************************ RangeContainsValue (Range) ************************ --> - + @@ -65397,7 +65394,7 @@ - + @@ -65413,16 +65410,16 @@ - + - - + + - + @@ -65431,7 +65428,7 @@ - + @@ -65441,7 +65438,7 @@ - + @@ -65458,16 +65455,16 @@ - + - - + + - + @@ -65476,7 +65473,7 @@ - + @@ -65486,7 +65483,7 @@ - + @@ -65510,7 +65507,7 @@ - + @@ -65534,12 +65531,12 @@ ************************ SortMinMax ************************ --> - + - + @@ -65548,7 +65545,7 @@ - + @@ -65582,24 +65579,24 @@ ************************ UnitRange ************************ --> - + - + - + - + @@ -65621,12 +65618,12 @@ ************************ Wrap ************************ --> - + - + @@ -65634,7 +65631,7 @@ - + @@ -65642,22 +65639,22 @@ - + - - + + - + - + @@ -65689,14 +65686,14 @@ - + - + @@ -65704,7 +65701,7 @@ - + @@ -65712,7 +65709,7 @@ - + @@ -65723,8 +65720,8 @@ - - + + @@ -65732,7 +65729,7 @@ - + @@ -65741,7 +65738,7 @@ - + @@ -65763,12 +65760,12 @@ ************************ Wrap (Range) ************************ --> - + - + @@ -65776,7 +65773,7 @@ - + @@ -65784,7 +65781,7 @@ - + @@ -65794,22 +65791,22 @@ - + - - + + - + - + @@ -65840,14 +65837,14 @@ - + - + @@ -65855,7 +65852,7 @@ - + @@ -65863,7 +65860,7 @@ - + @@ -65874,8 +65871,8 @@ - - + + @@ -65884,7 +65881,7 @@ - + @@ -65894,7 +65891,7 @@ - + diff --git a/VL.CoreLib/VL.CoreLib.HDE.vl b/VL.CoreLib/VL.CoreLib.HDE.vl index 8d527061..2121daf6 100644 --- a/VL.CoreLib/VL.CoreLib.HDE.vl +++ b/VL.CoreLib/VL.CoreLib.HDE.vl @@ -1,5 +1,5 @@  - + @@ -676,7 +676,7 @@ - + diff --git a/VL.CoreLib/help/2D/HowTo Compute the bounding rectangle of a number of points.vl b/VL.CoreLib/help/2D/HowTo Compute the bounding rectangle of a number of points.vl new file mode 100644 index 00000000..b3a79363 --- /dev/null +++ b/VL.CoreLib/help/2D/HowTo Compute the bounding rectangle of a number of points.vl @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + High + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.CoreLib/src/Color/Color.cs b/VL.CoreLib/src/Color/Color.cs index d2078b97..91c9ee24 100644 --- a/VL.CoreLib/src/Color/Color.cs +++ b/VL.CoreLib/src/Color/Color.cs @@ -13,7 +13,7 @@ public static class ColorNodes { public static readonly Color4 One = new Color4(1, 1, 1, 1); - public static readonly Color4 Zero = new Color4(0, 0, 0, 0); + public static readonly Color4 Zero = new Color4(0, 0, 0, 1); /// /// Joins a color from its components diff --git a/VL.IO.OSCQuery/README.md b/VL.IO.OSCQuery/README.md new file mode 100644 index 00000000..0e03e38c --- /dev/null +++ b/VL.IO.OSCQuery/README.md @@ -0,0 +1,20 @@ +# VL.IO.OSCQuery +Allows to expose parameters via the [OSCQuery protocol](https://github.com/Vidvox/OSCQueryProposal). + +For use with vvvv, the visual live-programming environment for .NET: http://visualprogramming.net + +## Getting started +- Ships with vvvv +- Usage examples and more information are included in the pack and can be found via the [Help Browser](https://thegraybook.vvvv.org/reference/hde/findinghelp.html) + +## Contributing +- Report issues on [the vvvv forum](https://discourse.vvvv.org/c/vvvv-gamma/28) +- For custom development requests, please [get in touch](mailto:devvvvs@vvvv.org) +- When making a pull-request, please make sure to read the general [guidlines on contributing to vvvv libraries](https://thegraybook.vvvv.org/reference/extending/contributing.html) + +## Credits +Based on [VRChat.OSCQuery](https://www.nuget.org/packages/VRChat.OSCQuery). + +## Sponsoring +Development of this library was partially sponsored by: +- [Refik Anadol Studio](https://refikanadolstudio.com) diff --git a/VL.IO.OSCQuery/src/VL.IO.OSCQuery.csproj b/VL.IO.OSCQuery/src/VL.IO.OSCQuery.csproj index 2105c5f3..8f591ad6 100644 --- a/VL.IO.OSCQuery/src/VL.IO.OSCQuery.csproj +++ b/VL.IO.OSCQuery/src/VL.IO.OSCQuery.csproj @@ -5,9 +5,10 @@ ..\lib $(TargetsForTfmSpecificBuildOutput);IncludeReferencedAssembliesInPackage ..\ - OSCQuery support for VL - VL, OSC + OSCQuery support for vvvv + VL, OSC True + readme.md @@ -16,6 +17,10 @@ + + + + diff --git a/VL.IO.Redis/README.md b/VL.IO.Redis/README.md new file mode 100644 index 00000000..ca9df72d --- /dev/null +++ b/VL.IO.Redis/README.md @@ -0,0 +1,35 @@ +# VL.IO.Redis +A Redis client for accessing Redis databases. + +For use with vvvv, the visual live-programming environment for .NET: http://visualprogramming.net + +## Getting started +- Ships with vvvv +- Usage examples and more information are included in the pack and can be found via the [Help Browser](https://thegraybook.vvvv.org/reference/hde/findinghelp.html) + +## Useful links +### Redis servers +- [General info](https://developer.redis.com/create/) on different options for running servers + +### Redis servers for Linux or WSL (Windows Subsystem for Linux) +- [Official option](https://developer.redis.com/create/windows) +- [Dragonfly](https://www.dragonflydb.io/) + +### Redis server for Windows +- [Memurai](https://www.memurai.com/) free only for development and testing + +### Redis GUIs +- Official: Redis Insight [as download](https://redis.com/redis-enterprise/redis-insight/#insight-form) or [via Windows Store](https://apps.microsoft.com/store/detail/redisinsight/XP8K1GHCB0F1R2) +- [Alternatives](https://redis.io/resources/tools/#gui) + +## Contributing +- Report issues on [the vvvv forum](https://discourse.vvvv.org/c/vvvv-gamma/28) +- For custom development requests, please [get in touch](mailto:devvvvs@vvvv.org) +- When making a pull-request, please make sure to read the general [guidlines on contributing to vvvv libraries](https://thegraybook.vvvv.org/reference/extending/contributing.html) + +## Credits +Based on [StackExchange.Redis](https://www.nuget.org/packages/StackExchange.Redis). + +## Sponsoring +Development of this library was partially sponsored by: +- [Refik Anadol Studio](https://refikanadolstudio.com) diff --git a/VL.IO.Redis/VL.IO.Redis.HDE.vl b/VL.IO.Redis/VL.IO.Redis.HDE.vl index 53f7e73a..6257ba78 100644 --- a/VL.IO.Redis/VL.IO.Redis.HDE.vl +++ b/VL.IO.Redis/VL.IO.Redis.HDE.vl @@ -1,5 +1,5 @@  - + @@ -360,7 +360,7 @@ - + false @@ -478,7 +478,7 @@ - + @@ -524,6 +524,8 @@ + + @@ -549,12 +551,10 @@ - + - - @@ -567,9 +567,9 @@ - + - + diff --git a/VL.IO.Redis/help/Explanation Overview.vl b/VL.IO.Redis/help/Explanation Overview.vl index 45ef5d91..7e911feb 100644 --- a/VL.IO.Redis/help/Explanation Overview.vl +++ b/VL.IO.Redis/help/Explanation Overview.vl @@ -1,391 +1,167 @@ - - - - - - - - - - - - - - - 4 - - - - - - - 9 - Comment - - - - - - - - 9 - Link - - - - - - - - - 9 - Link - - - - - - - - - 9 - Link - - - - - - - - - 9 - Link - - - - - - - - 9 - Link - - - - - - - - 9 - Link - - - - 2 - - - 6 - - - - - - - 14 - Comment - - - - - - - - 14 - Comment - - - - - - - - 14 - Comment - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - 14 - Comment - - - - - - - - 9 - Link - - - - - - - - 14 - Comment - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8 - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + 9 + Link + + + + + + + + 14 + Comment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + + + + + + + + + + + + 9 + Comment + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.IO.Redis/help/Help.xml b/VL.IO.Redis/help/Help.xml new file mode 100644 index 00000000..973c1742 --- /dev/null +++ b/VL.IO.Redis/help/Help.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/VL.IO.Redis/help/HowTo Manage Keys on Server.vl b/VL.IO.Redis/help/HowTo Manage Keys on Server.vl index cde14806..53233ca3 100644 --- a/VL.IO.Redis/help/HowTo Manage Keys on Server.vl +++ b/VL.IO.Redis/help/HowTo Manage Keys on Server.vl @@ -1,133 +1,134 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MyKey - - - - - - - - - - - - - - - - - Bang - - - - - - - - - - - - - - - - - - - - - - - - Bang - - - - - - - - - Bang - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + High + + + + + + + + + MyKey + + + + + + + + High + + + + + + + + + + Bang + + + + + + + + High + + + + + + + + + + + + + + + + + Bang + + + + + + + + + Bang + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.IO.Redis/help/Reference Binding.vl b/VL.IO.Redis/help/Reference Binding.vl index 8a02e7e5..d9431a0f 100644 --- a/VL.IO.Redis/help/Reference Binding.vl +++ b/VL.IO.Redis/help/Reference Binding.vl @@ -1,147 +1,157 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 12 - Comment - - - - - - - - 12 - Comment - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + High + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + Comment + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.IO.Redis/help/Reference Global Channel.vl b/VL.IO.Redis/help/Reference Global Channel.vl index fdae9b86..56807777 100644 --- a/VL.IO.Redis/help/Reference Global Channel.vl +++ b/VL.IO.Redis/help/Reference Global Channel.vl @@ -1,186 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MessagePack - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9 - Comment - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MessagePack + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9 + Comment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.IO.Redis/help/Reference Publish & Subscribe.vl b/VL.IO.Redis/help/Reference Publish and Subscribe.vl similarity index 58% rename from VL.IO.Redis/help/Reference Publish & Subscribe.vl rename to VL.IO.Redis/help/Reference Publish and Subscribe.vl index 18c04c10..35138e7a 100644 --- a/VL.IO.Redis/help/Reference Publish & Subscribe.vl +++ b/VL.IO.Redis/help/Reference Publish and Subscribe.vl @@ -1,216 +1,246 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9 - Link - - - - - - - - 9 - Link - - - - - - - - 12 - Comment - - - - - - - - 9 - Comment - - - - - - - - 9 - Comment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + High + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + High + + + + + + + + + + + + + + + + + + + 9 + Link + + + + + + + + 12 + Comment + + + + + + + + + + + + + + + + + + + + + + + + + 9 + Comment + + + + + + + + + High + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9 + Link + + + + + + + + 9 + Comment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.IO.Redis/help/Reference RedisClient.vl b/VL.IO.Redis/help/Reference RedisClient.vl new file mode 100644 index 00000000..10a4eb4e --- /dev/null +++ b/VL.IO.Redis/help/Reference RedisClient.vl @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + High + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Toggle + + + + + + + + + 12 + Comment + + + + + + + + + + + + + + + + + + + + 9 + Comment + + + + + + + + 9 + Link + + + + + + + + 9 + Comment + + + + + + + + 9 + Comment + + + + + + + + 9 + Link + + + + + + + + 9 + Comment + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VL.IO.Redis/src/BindingDirection.cs b/VL.IO.Redis/src/BindingDirection.cs new file mode 100644 index 00000000..e2b079a7 --- /dev/null +++ b/VL.IO.Redis/src/BindingDirection.cs @@ -0,0 +1,12 @@ +using System; + +namespace VL.IO.Redis +{ + [Flags] + public enum BindingDirection + { + In = 1, + Out = 2, + InOut = In | Out + } +} diff --git a/VL.IO.Redis/src/BindingModel.cs b/VL.IO.Redis/src/BindingModel.cs index 8715b339..1f6170c4 100644 --- a/VL.IO.Redis/src/BindingModel.cs +++ b/VL.IO.Redis/src/BindingModel.cs @@ -14,7 +14,7 @@ namespace VL.IO.Redis public record struct BindingModel( string Key, Initialization Initialization = Initialization.Redis, - RedisBindingType BindingType = RedisBindingType.SendAndReceive, + BindingDirection BindingType = BindingDirection.InOut, CollisionHandling CollisionHandling = default, SerializationFormat? SerializationFormat = default, TimeSpan? Expiry = null); diff --git a/VL.IO.Redis/src/BindingNode.cs b/VL.IO.Redis/src/BindingNode.cs index 456130a5..3c0aceda 100644 --- a/VL.IO.Redis/src/BindingNode.cs +++ b/VL.IO.Redis/src/BindingNode.cs @@ -9,6 +9,9 @@ namespace VL.IO.Redis { + /// + /// Binds a Channel to a key in a Redis database + /// [ProcessNode(Name = "Binding")] public class BindingNode : IDisposable { @@ -16,8 +19,8 @@ public class BindingNode : IDisposable private readonly NodeContext _nodeContext; private readonly ILogger _logger; - private (RedisClient? client, IChannel? channel, string? key, Initialization initialization, - RedisBindingType bindingType, CollisionHandling collisionHandling, Optional serializationFormat, + private (RedisClient? client, IChannel? input, string? key, Initialization initialization, + BindingDirection bindingType, CollisionHandling collisionHandling, Optional serializationFormat, Optional expiry) _config; public BindingNode([Pin(Visibility = PinVisibility.Hidden)] NodeContext nodeContext) @@ -28,28 +31,28 @@ public BindingNode([Pin(Visibility = PinVisibility.Hidden)] NodeContext nodeCont public void Update( RedisClient? client, - IChannel? channel, string? key, + IChannel? input, + BindingDirection bindingDirection = BindingDirection.InOut, Initialization initialization = Initialization.Redis, - RedisBindingType bindingType = RedisBindingType.SendAndReceive, CollisionHandling collisionHandling = default, Optional serializationFormat = default, Optional expiry = default) { - var config = (client, channel, key, initialization, bindingType, collisionHandling, serializationFormat, expiry); + var config = (client, input, key, initialization, bindingDirection, collisionHandling, serializationFormat, expiry); if (config == _config) return; _config = config; _current.Disposable = null; - if (client is null || channel is null || string.IsNullOrWhiteSpace(key)) + if (client is null || input is null || string.IsNullOrWhiteSpace(key)) return; - var model = new BindingModel(key, initialization, bindingType, collisionHandling, serializationFormat.ToNullable(), expiry.ToNullable()); + var model = new BindingModel(key, initialization, bindingDirection, collisionHandling, serializationFormat.ToNullable(), expiry.ToNullable()); try { - _current.Disposable = client.AddBinding(model, channel, logger: _logger); + _current.Disposable = client.AddBinding(model, input, logger: _logger); } catch (Exception e) { diff --git a/VL.IO.Redis/src/ChannelMessage{T}.cs b/VL.IO.Redis/src/ChannelMessage{T}.cs new file mode 100644 index 00000000..9b1f2d8f --- /dev/null +++ b/VL.IO.Redis/src/ChannelMessage{T}.cs @@ -0,0 +1,9 @@ +namespace VL.IO.Redis; + +/// +/// Represents a message that is broadcast via publish/subscribe +/// +/// The type of the value +/// The channel on which the message was broadcasted. +/// The value of the message. +public readonly record struct ChannelMessage(string Channel, T Value); diff --git a/VL.IO.Redis/src/Initializer.cs b/VL.IO.Redis/src/Initializer.cs index af49ca2e..ee580371 100644 --- a/VL.IO.Redis/src/Initializer.cs +++ b/VL.IO.Redis/src/Initializer.cs @@ -43,7 +43,7 @@ public BindingModel Deserialize(SerializationContext context, object content, Ty return new BindingModel( context.Deserialize(content, nameof(BindingModel.Key)), context.Deserialize(content, nameof(BindingModel.Initialization)), - context.Deserialize(content, nameof(BindingModel.BindingType)), + context.Deserialize(content, nameof(BindingModel.BindingType)), context.Deserialize(content, nameof(BindingModel.CollisionHandling)), context.Deserialize(content, nameof(BindingModel.SerializationFormat))); } diff --git a/VL.IO.Redis/src/Internal/Binding.cs b/VL.IO.Redis/src/Internal/Binding.cs index 38c1f16c..156c050c 100644 --- a/VL.IO.Redis/src/Internal/Binding.cs +++ b/VL.IO.Redis/src/Internal/Binding.cs @@ -140,9 +140,7 @@ void IParticipant.BuildUp(TransactionBuilder builder) bool NeedToReadFromDb() { var bindingType = _bindingModel.BindingType; - if (bindingType == RedisBindingType.AlwaysReceive) - return true; - if (!bindingType.HasFlag(RedisBindingType.Receive)) + if (!bindingType.HasFlag(BindingDirection.In)) return false; if (_initialized) return _othersHaveNewData; @@ -151,7 +149,7 @@ bool NeedToReadFromDb() bool NeedToWriteToDb() { - if (!_bindingModel.BindingType.HasFlag(RedisBindingType.Send)) + if (!_bindingModel.BindingType.HasFlag(BindingDirection.Out)) return false; if (_initialized) return _weHaveNewData; @@ -171,16 +169,12 @@ BindingType IBinding.BindingType { switch (_bindingModel.BindingType) { - case RedisBindingType.None: - return BindingType.None; - case RedisBindingType.Send: - return BindingType.Send; - case RedisBindingType.Receive: + case BindingDirection.In: return BindingType.Receive; - case RedisBindingType.SendAndReceive: + case BindingDirection.Out: + return BindingType.Send; + case BindingDirection.InOut: return BindingType.SendAndReceive; - case RedisBindingType.AlwaysReceive: - return BindingType.None; default: return BindingType.None; } diff --git a/VL.IO.Redis/src/Publish.cs b/VL.IO.Redis/src/Publish.cs index d1ea17cd..e5ed9895 100644 --- a/VL.IO.Redis/src/Publish.cs +++ b/VL.IO.Redis/src/Publish.cs @@ -9,14 +9,17 @@ namespace VL.IO.Redis { - // TODO: Fix node name - has stupid `1 inside! - [ProcessNode(Name = "Publish")] + /// + /// Publish a message on a specified Redis Channel. The Message will not saved in the database! + /// + /// + [ProcessNode] public class Publish : IDisposable { private readonly SerialDisposable _subscription = new(); private readonly ILogger _logger; - private (RedisClient? client, string? redisChannel, IObservable? value, RedisChannel.PatternMode pattern, SerializationFormat? format) _config; + private (RedisClient? client, string? redisChannel, IObservable? value, SerializationFormat? format) _config; // TODO: For unit testing it would be nice to take the logger directly! public Publish([Pin(Visibility = PinVisibility.Hidden)] NodeContext nodeContext) @@ -29,21 +32,27 @@ public void Dispose() _subscription.Dispose(); } + /// + /// + /// + /// + /// Name of the Redis channel + /// + /// public void Update( RedisClient? client, - string? redisChannel, + string? channel, IObservable? input, - RedisChannel.PatternMode pattern = RedisChannel.PatternMode.Auto, - SerializationFormat? serializationFormat = default) + Optional serializationFormat = default) { - var config = (client, redisChannel, input, pattern, serializationFormat); + var config = (client, channel, input, format: serializationFormat.ToNullable()); if (config == _config) return; _config = config; _subscription.Disposable = null; - if (client is null || redisChannel is null || input is null) + if (client is null || string.IsNullOrEmpty(channel) || input is null) return; _subscription.Disposable = input.Subscribe(v => @@ -51,9 +60,9 @@ public void Update( try { var subscriber = client.GetSubscriber(); - var channel = new RedisChannel(redisChannel, pattern); - var value = client.Serialize(v, serializationFormat); - subscriber.Publish(channel, value, CommandFlags.FireAndForget); + var redisChannel = new RedisChannel(channel, RedisChannel.PatternMode.Literal); + var value = client.Serialize(v, config.format); + subscriber.Publish(redisChannel, value, CommandFlags.FireAndForget); } catch (Exception e) { diff --git a/VL.IO.Redis/src/RedisBindingType.cs b/VL.IO.Redis/src/RedisBindingType.cs deleted file mode 100644 index c6e6ff16..00000000 --- a/VL.IO.Redis/src/RedisBindingType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace VL.IO.Redis -{ - public enum RedisBindingType - { - None = 0, - Send = 1, - Receive = 2, - SendAndReceive = Send | Receive, - AlwaysReceive = 8, - } -} diff --git a/VL.IO.Redis/src/RedisClientManager.cs b/VL.IO.Redis/src/RedisClientManager.cs index 0adcf19a..3ea53938 100644 --- a/VL.IO.Redis/src/RedisClientManager.cs +++ b/VL.IO.Redis/src/RedisClientManager.cs @@ -12,6 +12,9 @@ namespace VL.IO.Redis { + /// + /// Sets up a connection to a database on a Redis server + /// [ProcessNode(Name = "RedisClient")] public sealed class RedisClientManager : IDisposable { diff --git a/VL.IO.Redis/src/ServerManagement.cs b/VL.IO.Redis/src/ServerManagement.cs index bb553af2..151a4091 100644 --- a/VL.IO.Redis/src/ServerManagement.cs +++ b/VL.IO.Redis/src/ServerManagement.cs @@ -6,6 +6,14 @@ namespace VL.IO.Redis { public static class ServerManagement { + /// + /// Deletes a key from the database + /// + /// + /// + /// + /// + /// public static RedisClient? DeleteKey(this RedisClient? client, string? key, bool apply, out bool success) { success = false; @@ -18,6 +26,12 @@ public static class ServerManagement return client; } + /// + /// Removes all keys from the database + /// + /// + /// + /// public static RedisClient? FlushDB(this RedisClient? client, bool apply) { if (!apply || client is null) @@ -31,7 +45,9 @@ public static class ServerManagement return client; } - + /// + /// Returns keys available in the database + /// [ProcessNode(Name = "Scan")] public class ScanNode { diff --git a/VL.IO.Redis/src/Subscribe.cs b/VL.IO.Redis/src/Subscribe.cs index ffd11bf1..699857ba 100644 --- a/VL.IO.Redis/src/Subscribe.cs +++ b/VL.IO.Redis/src/Subscribe.cs @@ -9,14 +9,18 @@ namespace VL.IO.Redis { - [ProcessNode(Name = "Subscribe")] + /// + /// Subscribe to receive value changes on a specified Redis Channel + /// + /// + [ProcessNode] public class Subscribe : IDisposable { private readonly SerialDisposable _subscription = new(); private readonly Subject _subject = new(); private readonly ILogger _logger; - record struct Config(RedisClient? Client, string? Channel, RedisChannel.PatternMode Pattern, SerializationFormat? Format, bool ProcessMessagesConcurrently); + record struct Config(RedisClient? Client, string? Channel, SerializationFormat? Format, bool ProcessMessagesConcurrently); private Config _config; @@ -31,15 +35,20 @@ public void Dispose() _subscription.Dispose(); } + /// + /// + /// + /// + /// Name of the Redis channel + /// + /// [return: Pin(Name = "Output")] public IObservable Update( RedisClient? client, - string? redisChannel, - RedisChannel.PatternMode pattern = RedisChannel.PatternMode.Auto, - SerializationFormat? serializationFormat = default, - bool processMessagesConcurrently = false) + string? channel, + Optional serializationFormat = default) { - var config = new Config(client, redisChannel, pattern, serializationFormat, processMessagesConcurrently); + var config = new Config(client, channel, serializationFormat.ToNullable(), ProcessMessagesConcurrently: false); if (config != _config) { _config = config; @@ -54,11 +63,11 @@ private void Resubscribe(Config config) _subscription.Disposable = null; var client = config.Client; - if (client is null || config.Channel is null) + if (client is null || string.IsNullOrEmpty(config.Channel)) return; var subscriber = client.GetSubscriber(); - var channel = new RedisChannel(config.Channel, config.Pattern); + var channel = new RedisChannel(config.Channel, RedisChannel.PatternMode.Literal); if (config.ProcessMessagesConcurrently) { diff --git a/VL.IO.Redis/src/SubscribePattern.cs b/VL.IO.Redis/src/SubscribePattern.cs new file mode 100644 index 00000000..5dffe018 --- /dev/null +++ b/VL.IO.Redis/src/SubscribePattern.cs @@ -0,0 +1,104 @@ +using Microsoft.Extensions.Logging; +using StackExchange.Redis; +using System; +using System.Reactive.Disposables; +using System.Reactive.Subjects; +using VL.Core; +using VL.Core.Import; +using VL.Model; + +namespace VL.IO.Redis +{ + /// + /// Subscribe using a glob-style pattern to receive value changes from a range of Redis channels + /// + /// + [ProcessNode(Name = "Subscribe (Pattern)")] + public class SubscribePattern : IDisposable + { + private readonly SerialDisposable _subscription = new(); + private readonly Subject> _subject = new(); + private readonly ILogger _logger; + + record struct Config(RedisClient? Client, string? Pattern, SerializationFormat? Format, bool ProcessMessagesConcurrently); + + private Config _config; + + // TODO: For unit testing it would be nice to take the logger directly! + public SubscribePattern([Pin(Visibility = PinVisibility.Hidden)] NodeContext nodeContext) + { + _logger = nodeContext.GetLogger(); + } + + public void Dispose() + { + _subscription.Dispose(); + } + + [return: Pin(Name = "Output")] + public IObservable> Update( + RedisClient? client, + string? pattern = null, + Optional serializationFormat = default) + { + var config = new Config(client, pattern, serializationFormat.ToNullable(), ProcessMessagesConcurrently: false); + if (config != _config) + { + _config = config; + Resubscribe(config); + } + return _subject; + } + + private void Resubscribe(Config config) + { + // Unsubscribe + _subscription.Disposable = null; + + var client = config.Client; + if (client is null || string.IsNullOrEmpty(config.Pattern)) + return; + + var subscriber = client.GetSubscriber(); + var channel = new RedisChannel(config.Pattern, RedisChannel.PatternMode.Pattern); + + if (config.ProcessMessagesConcurrently) + { + Action handler = (redisChannel, redisValue) => + { + try + { + var value = client.Deserialize(redisValue, config.Format); + _subject.OnNext(new (redisChannel.ToString(), value)); + } + catch (Exception e) + { + _logger.LogError(e, "Unexpected exception in subscribe."); + } + }; + subscriber.Subscribe(channel, handler); + _subscription.Disposable = Disposable.Create(() => subscriber.Unsubscribe(channel, handler)); + } + else + { + Action handler = (channelMessage) => + { + try + { + var redisValue = channelMessage.Message; + var value = client.Deserialize(redisValue, config.Format); + _subject.OnNext(new ChannelMessage(channelMessage.Channel.ToString(), value)); + } + catch (Exception e) + { + _logger.LogError(e, "Unexpected exception in subscribe."); + } + }; + + var queue = subscriber.Subscribe(channel); + queue.OnMessage(handler); + _subscription.Disposable = Disposable.Create(() => queue.Unsubscribe()); + } + } + } +} diff --git a/VL.IO.Redis/src/VL.IO.Redis.csproj b/VL.IO.Redis/src/VL.IO.Redis.csproj index a3cd748b..5751cfda 100644 --- a/VL.IO.Redis/src/VL.IO.Redis.csproj +++ b/VL.IO.Redis/src/VL.IO.Redis.csproj @@ -5,6 +5,9 @@ ..\lib ..\ enable + Redis support for vvvv + VL, redis + readme.md @@ -12,6 +15,10 @@ + + + + diff --git a/VL.ImGui.Skia/src/VL.ImGui.Skia.csproj b/VL.ImGui.Skia/src/VL.ImGui.Skia.csproj index 3190f119..1cc9467d 100644 --- a/VL.ImGui.Skia/src/VL.ImGui.Skia.csproj +++ b/VL.ImGui.Skia/src/VL.ImGui.Skia.csproj @@ -7,10 +7,9 @@ true ..\lib Generated - ..\ - A GUI library for Skia - widgets, button, slider, layout + A GUI library for use with vvvv based on Dear ImGui + VL, imgui, gui, widgets, button, slider, layout diff --git a/VL.ImGui/VL.ImGui.vl b/VL.ImGui/VL.ImGui.vl index 4fc89566..9d910cb2 100644 --- a/VL.ImGui/VL.ImGui.vl +++ b/VL.ImGui/VL.ImGui.vl @@ -1,5 +1,5 @@  - + @@ -3605,7 +3605,7 @@ - + @@ -3683,6 +3683,7 @@ + @@ -3715,6 +3716,7 @@ + @@ -3734,6 +3736,8 @@ + + - + @@ -3167,7 +3187,7 @@ - + @@ -3177,7 +3197,7 @@ - + @@ -3196,7 +3216,7 @@ - + @@ -3205,12 +3225,12 @@ - + - + @@ -3221,10 +3241,10 @@ - - - - + + + + @@ -3238,7 +3258,7 @@ - + @@ -3255,7 +3275,7 @@ - + @@ -3287,6 +3307,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3299,7 +3346,6 @@ - @@ -3309,23 +3355,28 @@ - - - - + + + + + + + + + - + @@ -3336,15 +3387,15 @@ - + - - - - + + + + @@ -3354,12 +3405,12 @@ - + - + @@ -3369,7 +3420,7 @@ - + @@ -3379,7 +3430,7 @@ ************************ Source ************************ --> - + @@ -3824,24 +3875,24 @@ ************************ AddAmount ************************ --> - + - + - - + + - + @@ -3854,12 +3905,12 @@ - + - + @@ -3867,7 +3918,7 @@ - + @@ -3877,7 +3928,7 @@ - + @@ -3887,19 +3938,19 @@ - + - + - + @@ -3919,23 +3970,23 @@ - + - + - + - + @@ -3944,7 +3995,7 @@ - + @@ -3953,7 +4004,7 @@ - + @@ -3962,12 +4013,7 @@ - - - - - - + @@ -3982,15 +4028,15 @@ - + - - + + @@ -3999,8 +4045,8 @@ - - + + @@ -4010,6 +4056,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4035,11 +4118,9 @@ - - @@ -4077,6 +4158,13 @@ + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -13932,11 +14550,6 @@ - - - - - @@ -13947,7 +14560,7 @@ - + @@ -13996,6 +14609,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -14014,11 +14660,10 @@ - - + @@ -14040,6 +14685,11 @@ + + + + + $(NoWarn)MSB3270 - A 3d graphics rendering library - 3d, graphics, renderer, gpu, vr, spout, image, texture, filter, textureplayer, video, model, material, shader, touch, scenewindow, renderwindow, texturewindow + A 3d graphics rendering library for vvvv based on Stride + VL, 3d, graphics, renderer, gpu, vr, spout, image, texture, filter, textureplayer, video, model, material, shader, touch, scenewindow, renderwindow, texturewindow true