Skip to content

Commit

Permalink
v2.4.2
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
BarRaider committed Jul 15, 2019
1 parent ddbe7b8 commit 0b9e43c
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 12 deletions.
5 changes: 5 additions & 0 deletions NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions barraider-sdtools/GlobalSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}


Expand Down
1 change: 1 addition & 0 deletions barraider-sdtools/PluginContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions barraider-sdtools/StreamDeckInfo/StreamDeckInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@ public class StreamDeckInfo
/// </summary>
[JsonProperty(PropertyName = "devices")]
public StreamDeckDeviceInfo[] Devices { get; private set; }

/// <summary>
/// Information on the Plugin we're currently running
/// </summary>
[JsonProperty(PropertyName = "plugin")]
public StreamDeckPluginInfo Plugin { get; private set; }

/// <summary>
/// Device pixel ratio
/// </summary>
[JsonProperty(PropertyName = "devicePixelRatio")]
public int DevicePixelRatio { get; private set; }
}
}
21 changes: 21 additions & 0 deletions barraider-sdtools/StreamDeckInfo/StreamDeckPluginInfo.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Holds general information on the StreamDeck App we're communicating with
/// </summary>
public class StreamDeckPluginInfo
{
/// <summary>
/// Current version of the plugin
/// </summary>
[JsonProperty(PropertyName = "version")]
public string Version { get; private set; }
}
}
15 changes: 6 additions & 9 deletions barraider-sdtools/barraider-sdtools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ Feel free to contact me for more information: https://barraider.github.io</Descr
<PackageTags>StreamDeck Elgato Library Plugin Stream Deck</PackageTags>
<PackageId>StreamDeck-Tools</PackageId>
<PackageIconUrl>https://raw.githubusercontent.com/BarRaider/barraider.github.io/master/images/BRLogo.png</PackageIconUrl>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
<FileVersion>2.3.0.0</FileVersion>
<Version>2.3</Version>
<PackageReleaseNotes>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</PackageReleaseNotes>
<AssemblyVersion>2.4.2.0</AssemblyVersion>
<FileVersion>2.4.2.0</FileVersion>
<Version>2.4.2</Version>
<PackageReleaseNotes>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</PackageReleaseNotes>
<RootNamespace>BarRaider.SdTools</RootNamespace>
<AssemblyName>StreamDeckTools</AssemblyName>
</PropertyGroup>
Expand All @@ -33,7 +30,7 @@ Feel free to contact me for more information: https://barraider.github.io</Descr
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NLog" Version="4.6.5" />
<PackageReference Include="NLog" Version="4.6.6" />
<PackageReference Include="streamdeck-client-csharp" Version="4.1.1" />
<PackageReference Include="System.Drawing.Common" Version="4.5.1" />
</ItemGroup>
Expand Down

0 comments on commit 0b9e43c

Please sign in to comment.