diff --git a/NUGET.md b/NUGET.md index 6b7128d..9e18fba 100644 --- a/NUGET.md +++ b/NUGET.md @@ -7,6 +7,11 @@ **Author's website and contact information:** [https://barraider.github.io](https://barraider.github.io) ** Samples of plugins using this framework: [Samples][1] +### Version 2.4.2 is out! +- Added support for Plugin version inside the StreamDeckInfo class. +- Current plugin version is now shown in the `pluginlog.log` log file +- Publishing through `GlobalSettingsManager` now raises the GlobalSettingsReceived event by default + ### Version 2.3 is out! - Added support for StreamDeck XL 1. `Connection.DeviceInfo()` now gives you information on the device the plugin is on (including the `StreamDeckDeviceType`) diff --git a/README.md b/README.md index fd7ac09..701c27a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ ### Samples of plugins using this framework: [Samples][1] + +### Version 2.4.2 is out! +- Added support for Plugin version inside the StreamDeckInfo class. +- Current plugin version is now shown in the `pluginlog.log` log file +- Publishing through `GlobalSettingsManager` now raises the GlobalSettingsReceived event by default + ### Version 2.3 is out! v2.3: - Added support for StreamDeck XL diff --git a/barraider-sdtools/GlobalSettingsManager.cs b/barraider-sdtools/GlobalSettingsManager.cs index 4e89ff6..a78882a 100644 --- a/barraider-sdtools/GlobalSettingsManager.cs +++ b/barraider-sdtools/GlobalSettingsManager.cs @@ -75,16 +75,21 @@ public Task RequestGlobalSettings() return connection.GetGlobalSettingsAsync(); } - public Task SetGlobalSettings(JObject settings) + public async Task SetGlobalSettings(JObject settings, bool triggerDidReceiveGlobalSettings = true) { if (connection == null) { Logger.Instance.LogMessage(TracingLevel.ERROR, "GlobalSettingsManager::SetGlobalSettings called while connection is null"); - return null; + return; } Logger.Instance.LogMessage(TracingLevel.INFO, "GlobalSettingsManager::SetGlobalSettings called"); - return connection.SetGlobalSettingsAsync(settings); + await connection.SetGlobalSettingsAsync(settings); + + if (triggerDidReceiveGlobalSettings) + { + await connection.GetGlobalSettingsAsync(); + } } diff --git a/barraider-sdtools/PluginContainer.cs b/barraider-sdtools/PluginContainer.cs index 40d2ffc..6617f17 100644 --- a/barraider-sdtools/PluginContainer.cs +++ b/barraider-sdtools/PluginContainer.cs @@ -50,6 +50,7 @@ public void Run(StreamDeckOptions options) // Start the connection connection.Run(); + Logger.Instance.LogMessage(TracingLevel.INFO, $"Plugin version: {deviceInfo.Plugin.Version}"); Logger.Instance.LogMessage(TracingLevel.INFO, "Connecting to Stream Deck"); // Wait for up to 10 seconds to connect diff --git a/barraider-sdtools/StreamDeckInfo/StreamDeckInfo.cs b/barraider-sdtools/StreamDeckInfo/StreamDeckInfo.cs index 55dfaba..5940951 100644 --- a/barraider-sdtools/StreamDeckInfo/StreamDeckInfo.cs +++ b/barraider-sdtools/StreamDeckInfo/StreamDeckInfo.cs @@ -23,5 +23,17 @@ public class StreamDeckInfo /// [JsonProperty(PropertyName = "devices")] public StreamDeckDeviceInfo[] Devices { get; private set; } + + /// + /// Information on the Plugin we're currently running + /// + [JsonProperty(PropertyName = "plugin")] + public StreamDeckPluginInfo Plugin { get; private set; } + + /// + /// Device pixel ratio + /// + [JsonProperty(PropertyName = "devicePixelRatio")] + public int DevicePixelRatio { get; private set; } } } diff --git a/barraider-sdtools/StreamDeckInfo/StreamDeckPluginInfo.cs b/barraider-sdtools/StreamDeckInfo/StreamDeckPluginInfo.cs new file mode 100644 index 0000000..69e5699 --- /dev/null +++ b/barraider-sdtools/StreamDeckInfo/StreamDeckPluginInfo.cs @@ -0,0 +1,21 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BarRaider.SdTools +{ + /// + /// Holds general information on the StreamDeck App we're communicating with + /// + public class StreamDeckPluginInfo + { + /// + /// Current version of the plugin + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; private set; } + } +} diff --git a/barraider-sdtools/barraider-sdtools.csproj b/barraider-sdtools/barraider-sdtools.csproj index 79856db..07a8a6c 100644 --- a/barraider-sdtools/barraider-sdtools.csproj +++ b/barraider-sdtools/barraider-sdtools.csproj @@ -16,14 +16,11 @@ Feel free to contact me for more information: https://barraider.github.ioStreamDeck Elgato Library Plugin Stream Deck StreamDeck-Tools https://raw.githubusercontent.com/BarRaider/barraider.github.io/master/images/BRLogo.png - 2.3.0.0 - 2.3.0.0 - 2.3 - 2.3 - Added support for StreamDeck XL + new GlobalSettingsManager: -1. Connection.DeviceInfo now gives you information on the device the plugin is on (including the StreamDeckDeviceType) -2. StreamDeckDeviceType enum now recognizes the StreamDeck XL -3. KEY_DEFAULT_WIDTH and KEY_DEFAULT_HEIGHT from the Tools module now replaced with dedicated GetKeyDefaultWidth()/GetKeyDefaultHeight() methods based on the StreamDeckDeviceType. This is due to different resoultion on the XL -4. GlobalSettingsManager gives you direct access to the Plugin's global settings from anywhere in your code + 2.4.2.0 + 2.4.2.0 + 2.4.2 + 2.4.2 - 1. Added support for Plugin version inside the StreamDeckInfo class. Current plugin version is now shown in logs +2. Publishing through GlobalSettingsManager now raises the GlobalSettingsReceived event by default BarRaider.SdTools StreamDeckTools @@ -33,7 +30,7 @@ Feel free to contact me for more information: https://barraider.github.io - +