Code Monkey home page Code Monkey logo

sharpdeck's People

Contributors

geekyeggo avatar nguyenquyhy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sharpdeck's Issues

SetStateAsync sometimes does not work

Hi.

Not sure if I am using the plugin wrong here, or this is a bug.

I have a button, when I press it, it calls a service and changes a value.
When this value is changed, the service will send a callback that triggers an event, that then calls SetStateAsync from a method inside the Action.

I have added Trace.WriteLine that writes out the state I want, but sometimes this is not updated on the button.

If I change the value in the application, without pressing the button, I have not seen this fail (yet).

Action method decorators, for Property Inspector controllers

Similar to HttpPost / HttpGet, it would be nice if it were possible to decorate methods within a controller that intercepted requests from a Property Inspector, and where desired, "returned" a result.

It should be possible to

  • Opt of out auto-routing requests from sendToPlugin.
  • Specify the event name (two-way)

Incorrect Example

Unless I am mistake, the example on the main page that has:
SharpDeck.StreamDeckClient.Run();

ought to be
SharpDeck.StreamDeckPlugin.Run();

Improve support for settings to `StreamDeckAction`

ActionPayload currently supports loading the settings, however this uses JObject; it is possible to convert the settings using the helper method T GetSettings<T>(), however it may be beneficial if there were settings and methods directly within the action.

Considerations

  • Should a new StreamDeckAction<TSettings> be added to provide helpers?
  • When should the settings be loaded; each event vs manual?
  • When should the settings be saved; INotifyPropertyChanged vs manual?

Add unit tests

With the introduction of better DI coming in 1.0.2, unit tests should be added to ensure everything is running smoothly.

Fast short keypresses trigger OnKeyLongPress

When a button is pressed repeatedly and faster than LongKeyPressInterval, the implementation of StreamDeckAction triggers falsely OnKeyLongPress.

The flow is as follows:

  1. Button is pressed
  2. OnKeyDown() puts the EventArgs on the stack and starts Task.Delay()
  3. Button is released
  4. OnKeyUp() successfully pops the EventArgs from the stack and thus calls OnKeyPress() (the callback for short keypress).
  5. Problem: The Task.Delay() is still active and waiting.
  6. Button is pressed again. This has to happen with 500ms after the first time that the button was pressed (or <= LongKeyPressInterval)
  7. OnKeyDown() puts the EventArgs on the stack
  8. Task.Delay() from the first button press finishes and successfully pops an event from the stack. Unfortunately, this is the event from the second button press and not from the first button press. In consequence, the callback OnKeyLongPresss() is getting called.

I think that TryHandleKeyPress() must also cancel Task.Delay() when it successfully popped an item from the stack.

Update examples so they hold at least one PropertyInspector entry.

Would be nice if examples included at least one entry into an action's property inspector so we could figure out the rest via elgato's docs.

Using 7.0.0 beta for SD+ support and I can't seem to figure out how to get the property inspector to show some controls.

Deadlocking prevention

To better handle deadlocking of async methods, particularly those triggered within the main StreamDeckClient, we should.

  • ConfigureAwait(false) on the top level of start.
  • Update the event raisers to be async; a QOL improvement for overriding within custom actions.

Action instances contain incorrect settings

Steps to replicate bug:

  1. Create a Play Action at location [1,1] (ref: action 1).
    1. Assign an audio track.
  2. Create a 2nd Play Action at location [1,2] (ref: action 2).
    1. Assign a different audio track.
  3. Remove action 1.
  4. Move action 2 to [1,1] (where action 1 was).
  5. Play action 2 - Audio track is incorrect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.