Class StreamDeckController

java.lang.Object
de.rcblum.stream.deck.StreamDeckController
All Implemented Interfaces:
AnimationListener, StreamKeyListener, IconUpdateListener

public class StreamDeckController extends Object implements StreamKeyListener, IconUpdateListener, AnimationListener
Can be used to hand over control over the stream deck by providing a "folder" structure. Folders will be traversed automatically, KeyEvents will be forwarded to non folder StreamItems.

MIT License Copyright (c) 2017 Roland von Werden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Version:
1.0.0
Author:
Roland von Werden
  • Constructor Details

    • StreamDeckController

      public StreamDeckController(IStreamDeck streamDeck, StreamItem root)
      Creates the StreamDeckController with a root folder and the ESD
      Parameters:
      streamDeck -
      root -
  • Method Details

    • setKeyDeadzone

      public static void setKeyDeadzone(long keyDeadZone)
      Sets the key dead zone. The dead zone defines how much time in milliseconds after a Key released event must have passed before another will be forwarded.
      Parameters:
      keyDeadZone - Time in MS between key released events
    • getStreamDeck

      public IStreamDeck getStreamDeck()
      returns the StreamDeck used by the controller.
      Returns:
    • onKeyEvent

      public void onKeyEvent(KeyEvent event)
      Handling key events from the ESD.
      Specified by:
      onKeyEvent in interface StreamKeyListener
      Parameters:
      event - Key event to be processed by the SDC.
    • pushButton

      public void pushButton(int no)
      Manually Pushing a button at the given id.
      Parameters:
      no - Number of the button to be pushed, 0 - 14, right top to left bottom.
    • pressButton

      public void pressButton(int no)
      Manually presses a button at the given id until releaseButton(int) is called.
      Parameters:
      no - Number of the button to be pushed, 0 - 14, right top to left bottom.
    • releaseButton

      public void releaseButton(int no)
      Manually releases a button at the given id. If the button is not pressed, it will be pushed instead.
      Parameters:
      no - Number of the button to be pushed, 0 - 14, right top to left bottom.
    • onIconUpdate

      public void onIconUpdate(StreamItem source, boolean animationChanged)
      Updates the display data.

      BUGFIXES:
      #1 - Changed if query to work with proxy items (skeletons encasing the real item(s))
      Specified by:
      onIconUpdate in interface IconUpdateListener
    • setRoot

      public void setRoot(StreamItem root)
      Sets a new root folder and opens it
      Parameters:
      root - New root folder
    • setBrightness

      public void setBrightness(int brightness)
      Wrapper to set brightness of stream deck
      Parameters:
      brightness - Brightness in percent 0 - 100 %
    • resetStreamDeck

      public void resetStreamDeck()
      Resets stream deck and updates display of keys
    • hasTouchScreen

      public boolean hasTouchScreen()
    • getTouchScreen

      public TouchScreen getTouchScreen()
    • hasDials

      public boolean hasDials()
    • getDials

      public DialKey[] getDials()
    • stop

      public void stop(boolean immediate, boolean shutdownStreamDeck)
      Stops the update by animators on the streamdeck and the streamdeck itself
      Parameters:
      immediate - true = Stop all updating at once, false = stop after animation is done
    • onAnimationStart

      public void onAnimationStart(int keyIndex)
      Description copied from interface: AnimationListener
      Called when the animation starts
      Specified by:
      onAnimationStart in interface AnimationListener
      Parameters:
      keyIndex - Index of the key on which the animation is displayed on
    • onAnimationStop

      public void onAnimationStop(int keyIndex)
      Description copied from interface: AnimationListener
      Called when the animation starts
      Specified by:
      onAnimationStop in interface AnimationListener
      Parameters:
      keyIndex - Index of the key on which the animation was displayed on