Skip to content

Commit

Permalink
Support new Stream Deck Types
Browse files Browse the repository at this point in the history
  • Loading branch information
BarRaider committed Jan 4, 2025
1 parent 6fe90ba commit 65aa8ee
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 BarRaider
Copyright (c) 2025 BarRaider

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Introducing our new [wiki](https://github.com/BarRaider/streamdeck-tools/wiki) p

# Change Log

### Version 6.3
### Version 6.3.1
- Support for new Stream Deck types

### Version 6.2
Expand Down
84 changes: 84 additions & 0 deletions barraider-sdtools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# BarRaider's Stream Deck Tools

#### C# library that wraps all the communication with the Stream Deck App, allowing you to focus on actually writing the Plugin's logic.

[![Build Status](https://github.com/BarRaider/streamdeck-tools/actions/workflows/dotnetcore.yml/badge.svg)](https://github.com/BarRaider/streamdeck-tools/actions/workflows/dotnetcore.yml)[![NuGet](https://img.shields.io/nuget/v/streamdeck-tools.svg?style=flat)](https://www.nuget.org/packages/streamdeck-tools)

**Author's website and contact information:** [https://barraider.com](https://barraider.com)

# Stream Deck+ Support
Instead of `PluginBase`, Derive from either `KeypadBase` (if you don't support dials), `EncoderBase` (for only dials), `KeyAndEncoderBase` (for both keys and dials)

# Getting Started
Introducing our new [wiki](https://github.com/BarRaider/streamdeck-tools/wiki) packed with usage instructions, examples and more.

# Dev Discussions / Support
**Discord:** Discuss in #developers-chat in [Bar Raiders](http://discord.barraider.com)

## Downloadable Resources
* [StreamDeck-Tools Template](https://github.com/BarRaider/streamdeck-tools/raw/master/utils/StreamDeck-Tools%20Template.vsix) for Visual Studio (2019/2022) - Automatically creates a project with all the files needed to compile a plugin. This is the best way to start a new plugin!
* [Install.bat](https://github.com/BarRaider/streamdeck-tools/blob/master/utils/install.bat) - Script that quickly uninstalls and reinstalls your plugin on the streamdeck (edit the batch file for more details). Put the install.bat file in your BIN folder (same folder that has Debug/Release sub-folders)
* [EasyPI](https://github.com/BarRaider/streamdeck-easypi) - Additional library used to easily pass information from the PI (Property Inspector) to your plugin.
* [Profiles](https://barraider.com/profiles) Downloadable empty profiles for the XL (32-key), Classic (15-key), Mini (6-key) and Mobile devices at https://barraider.com/profiles

## Library Features
- Encapsulates all the communicating with the Stream Deck, getting a plugin working on the Stream Deck only requires implementing the PluginBase class.
- Sample plugin now included in this project on Github
- Built-in integration with NLog. Use `Logger.LogMessage()` for logging.
- Auto-populate user settings which were modified by the Property Inspector
- Access the Global Settings from anywhere in your code
- Simplified working with filenames from the Stream Deck SDK.
- `PluginActionId` attribute let's you easily associate your code to a specific action defined in the manifest.json
- Large set of helper functions to simplify creating images and sending them to the Stream Deck.

# Change Log

### Version 6.3
- Support for new Stream Deck types

### Version 6.2
- Support for .NET 8.0

### Version 6.1
- Support for new `DialDown` and `DialUp` events.
- Removed support for deprecated `DialPress` event

### Version 6.0
1. Merged streamdeck-client-csharp package into library to allow better logging of errors
2. Added support for SD+ SDK
3. Increased timeout of connection to Stream Deck due to the Stream Deck taking longer than before to reply on load
4. Added error catching to prevent 3rd party plugin exception to impact communication


### Version 3.2 is out!
- Created new `ISDConnection` interface which is now implemented by SDConnection and used by PluginAction.
- GlobalSettingsManager now has a short delay before calling GetGlobalSettings(), to reduce spamming the Stream Deck SDK.
- Updated dependencies to latest version

### Version 3.1 is out!
- Updated Logger class to include process name and thread id

### Version 3.0 is out!
- Updated file handling in `Tools.AutoPopulateSettings` and `Tools.FilenameFromPayload` methods
- Removed obsolete MD5 functions, use SHA512 functions instead
- `Tools.CenterText` function now has optional out `textFitsImage` value to verify the text does not exceed the image width
- New `Tools.FormatBytes` function converts bytes to human-readable value
- New `Graphics.GetFontSizeWhereTextFitsImage` function helps locate the best size for a text to fit an image on 1 line
- Updated dependency packages to latest versions
- Bug fix where FileNameProperty attribute

### Version 2.7 is out!
- Fully wrapped all Stream Deck events (All part of the SDConneciton class). See ***"Subscribing to events"*** section below
- Added extension methods for multiple classes related to brushes/colors
- Added additional methods under the Tools class, including AddTextPathToGraphics which can be used to correctly position text on a key image based on the Text Settings in the Property Inspector see ***"Showing Title based on settings from Property Inspector"*** section below.
- Additional error checking
- Updated dependency packages to latest versions
- Sample plugin now included in this project on Github

### 2019-11-17
- Updated Install.bat (above) to newer version

### Version 2.6 is out!
- Added new MD5 functions in the `Tools` helper class
- Optimized SetImage to not resubmit an image that was just posted to the device. Can be overridden with new property in Connection.SetImage() function.

8 changes: 8 additions & 0 deletions barraider-sdtools/Tools/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static class Tools
private const string HEADER_PREFIX = "data:image/png;base64,";
private const int CLASSIC_KEY_DEFAULT_HEIGHT = 72;
private const int CLASSIC_KEY_DEFAULT_WIDTH = 72;
private const int PLUS_KEY_DEFAULT_HEIGHT = 144;
private const int PLUS_KEY_DEFAULT_WIDTH = 144;
private const int XL_KEY_DEFAULT_HEIGHT = 96;
private const int XL_KEY_DEFAULT_WIDTH = 96;
private const int GENERIC_KEY_IMAGE_SIZE = 144;
Expand Down Expand Up @@ -120,9 +122,12 @@ public static int GetKeyDefaultHeight(DeviceType streamDeckType)
case DeviceType.StreamDeckClassic:
case DeviceType.StreamDeckMini:
case DeviceType.StreamDeckMobile:
case DeviceType.StreamDeckNeo:
return CLASSIC_KEY_DEFAULT_HEIGHT;
case DeviceType.StreamDeckXL:
return XL_KEY_DEFAULT_HEIGHT;
case DeviceType.StreamDeckPlus:
return PLUS_KEY_DEFAULT_HEIGHT;
default:
Logger.Instance.LogMessage(TracingLevel.ERROR, $"SDTools GetKeyDefaultHeight Error: Invalid StreamDeckDeviceType: {streamDeckType}");
break;
Expand All @@ -143,9 +148,12 @@ public static int GetKeyDefaultWidth(DeviceType streamDeckType)
case DeviceType.StreamDeckClassic:
case DeviceType.StreamDeckMini:
case DeviceType.StreamDeckMobile:
case DeviceType.StreamDeckNeo:
return CLASSIC_KEY_DEFAULT_WIDTH;
case DeviceType.StreamDeckXL:
return XL_KEY_DEFAULT_WIDTH;
case DeviceType.StreamDeckPlus:
return PLUS_KEY_DEFAULT_WIDTH;
default:
Logger.Instance.LogMessage(TracingLevel.ERROR, $"SDTools GetKeyDefaultHeight Error: Invalid StreamDeckDeviceType: {streamDeckType}");
break;
Expand Down
22 changes: 15 additions & 7 deletions barraider-sdtools/barraider-sdtools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ This library encapsulates all the overhead of setting up the framework, so that
Using this library, you only need to derive from the abstract PluginBase class and add one line of code in your program.cs to have a working plugin. More info and working samples here: https://github.com/BarRaider/streamdeck-tools .
Feel free to contact me for more information: https://barraider.com</Description>
<Copyright>Copyright © BarRaider 2025</Copyright>
<PackageLicenseUrl>https://github.com/BarRaider/streamdeck-tools/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/BarRaider/streamdeck-tools</PackageProjectUrl>
<RepositoryUrl>https://github.com/BarRaider/streamdeck-tools</RepositoryUrl>
<PackageTags>StreamDeck Elgato Library Plugin Stream Deck Toolkit</PackageTags>
<PackageId>StreamDeck-Tools</PackageId>
<PackageIconUrl></PackageIconUrl>
<AssemblyVersion>6.3</AssemblyVersion>
<FileVersion>6.3</FileVersion>
<Version>6.3</Version>
<PackageReleaseNotes>6.3 - Support for new Stream Deck types</PackageReleaseNotes>
<AssemblyVersion>6.3.1</AssemblyVersion>
<FileVersion>6.3.1</FileVersion>
<Version>6.3.1</Version>
<PackageReleaseNotes>6.3.1 - Support for new Stream Deck types</PackageReleaseNotes>
<RootNamespace>BarRaider.SdTools</RootNamespace>
<AssemblyName>StreamDeckTools</AssemblyName>
<PackageIcon>BRLogo_460.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<DocumentationFile></DocumentationFile>
Expand All @@ -47,16 +48,23 @@ Feel free to contact me for more information: https://barraider.com</Description
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.2.8" />
<PackageReference Include="System.Drawing.Common" Version="8.0.1" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="BRLogo_460.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="README.md" Pack="true" PackagePath="\">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

0 comments on commit 65aa8ee

Please sign in to comment.