fredemmott / StreamDeck-CPPSDK

A fork of Elgato's C++ StreamDeck SDK, focussing on reusability
MIT License
44 stars 10 forks source link

no getSettings function in ESDConnectionManager #11

Closed Filiflo closed 2 years ago

Filiflo commented 2 years ago

ESDConnectionManager has the function getGlobalSettings but not the getSettings function. One cannot implement it itself with the raw request since the web socket that is used for the connection is set private. I'm new to Cpp and your SDK helped me out a lot. I might try to make my first pull request in a bit since this seems to be a relatively simple fix. I bring thee the link to the event.

fredemmott commented 2 years ago

Removed version number as (a) I will no be doing any further work on 1.x (b) this is true in all versions

This would be trivial to add, though is generally unneeded, as the settings are passed to willappear/keyup/keydown

I'll be very happy to review a pull request for master (3.x) :)

Filiflo commented 2 years ago

I see. I will have a look at what you made in v2 ;) And maybe figure out how pull requests work on my way there

Filiflo commented 2 years ago

I made a plugin that pings hosts every 5 seconds and changes the state depending on the response. For that I need the in the PropertyInspector specified IP adress. I was planning to get them over the getSettings event so I don't have to map the settings to the context. Is there a better way to do this?

fredemmott commented 2 years ago

When willAppear is called, store the settings; update the stored copy in didReceiveSettings

Filiflo commented 2 years ago

the stored data would need to be mapped to the button/context though, right? Since StreamDeck already stores the settings I thought it might be better to simply call on that.

fredemmott commented 2 years ago

yep, you get the button/context too. ESDActionWithExternalState.h might be useful for you, with https://github.com/fredemmott/StreamDeck-AudioMute as an example

I don't think calling getSettings would be simpler, as it's not like a traditional function call that returns the settings: it requests that the streamdeck software send didReceiveSettings at some later point. Your code would need to track what it's meant to do when it gets 'didReceiveSettings'

Filiflo commented 2 years ago

You are right. That is exactly what I need. Thanks for the help.