-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
27 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,20 @@ | ||
using BarRaider.SdTools; | ||
using CommandLine; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Delayedtext | ||
{ | ||
class Program | ||
{ | ||
/************************************************************************ | ||
* Initial configuration copied from TyrenDe's streamdeck-client-csharp example: | ||
* https://github.com/TyrenDe/streamdeck-client-csharp | ||
* and SaviorXTanren's MixItUp.StreamDeckPlugin: | ||
* https://github.com/SaviorXTanren/mixer-mixitup/ | ||
*************************************************************************/ | ||
|
||
// Handles all the communication with the plugin | ||
private static PluginContainer container; | ||
|
||
// StreamDeck launches the plugin with these details | ||
// -port [number] -pluginUUID [GUID] -registerEvent [string?] -info [json] | ||
static void Main(string[] args) | ||
{ | ||
// Uncomment this line of code to allow for debugging | ||
//while (!System.Diagnostics.Debugger.IsAttached) { System.Threading.Thread.Sleep(100); } | ||
|
||
// The command line args parser expects all args to use `--`, so, let's append | ||
for (int count = 0; count < args.Length; count++) | ||
{ | ||
if (args[count].StartsWith("-") && !args[count].StartsWith("--")) | ||
{ | ||
args[count] = $"-{args[count]}"; | ||
} | ||
} | ||
|
||
Parser parser = new Parser((with) => | ||
{ | ||
with.EnableDashDash = true; | ||
with.CaseInsensitiveEnumValues = true; | ||
with.CaseSensitive = false; | ||
with.IgnoreUnknownArguments = true; | ||
with.HelpWriter = Console.Error; | ||
}); | ||
|
||
ParserResult<StreamDeckOptions> options = parser.ParseArguments<StreamDeckOptions>(args); | ||
options.WithParsed<StreamDeckOptions>(o => RunPlugin(o)); | ||
} | ||
|
||
static void RunPlugin(StreamDeckOptions options) | ||
{ | ||
container = new PluginContainer(); | ||
container.Run(options); | ||
List<PluginActionId> supportedActionIds = new List<PluginActionId>(); | ||
supportedActionIds.Add(new PluginActionId("com.barraider.delayedtext", typeof(DelayedTextInput))); | ||
SDWrapper.Run(args, supportedActionIds.ToArray()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters