emorydunn / StreamDeckPlugin

A library for creating Stream Deck plugins in Swift.
https://emorydunn.github.io/StreamDeckPlugin/
MIT License
50 stars 7 forks source link

Unable to get counter example working #20

Closed RomanBaiocco closed 1 year ago

RomanBaiocco commented 1 year ago

Hey! I'll start off by saying that this is my first real foray into swift, so there is a non zero chance that I'm doing something wrong and that all of these issue are self inflicted.

I'm trying to compile and run the example counter plugin, but I'm running into issues.

The first issue I ran into was that i was unable to build the plugin due to some of the actions not conforming to the Action protocol. Here is a PR that has the changes I needed to make for the plugin to compile.

The second issue is after compiling the plugin and exporting it with the command ./.build/debug/counter-plugin export --copy-executable --generate-manifest dev.counter I don't see the plugin appear in the Stream Deck application after restarting it. I've checked the plugins folder and see the manifest and the executable in the spots you would expect them to be. Looking at the Stream Deck logs, the only reference I ever see to the counter plugin is this message that appears when I quit the Stream Deck application.

14:02:12.7808          void ESDCustomPlugin::QuitPlugin(): Plugin 'Counter' is still alive after closing the websocket. Quit it.

Other info that would probably be helpful to know:

emorydunn commented 1 year ago

Thanks for catching the issues with the example project, it looks like I forgot to go back and update it for the some late changes in supporting the StreamDeck+.

Looking at your PR, I see why the actions aren't showing up. The controllers on both actions are set to only show on rotary encoders instead of keys, so they'd only be visible on a StreamDeck+. There are some convenience protocols that handle some of the boilerplate automatically.

If the classes conform to KeyAction they include default values for controllers and encoder. I'll add some comments to the PR as well.

RomanBaiocco commented 1 year ago

Thank you so much for the response! VSCode pushed me to fill out the rest of the class to include the those values so i just ended up copying them from the RotaryAction file. I've never seen a stream deck model other than my own, so it didn't occur to me that a rotary action would only be useable with some hardware I didn't have hahaha

emorydunn commented 1 year ago

I've merged in your PR, thank you so much for helping with the project. I've added some better docstrings to help clarify what the protocols do. Best of luck with your plugin!