Class SoftStreamDeck

java.lang.Object
de.rcblum.stream.deck.device.general.SoftStreamDeck
All Implemented Interfaces:
IStreamDeck

public class SoftStreamDeck extends Object implements IStreamDeck
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.
Author:
Roland von Werden
  • Constructor Details

    • SoftStreamDeck

      public SoftStreamDeck(String name, IStreamDeck streamDeck)
    • SoftStreamDeck

      public SoftStreamDeck(String name, IStreamDeck streamDeck, boolean visible)
    • SoftStreamDeck

      public SoftStreamDeck(String name, IStreamDeck streamDeck, int keySize, int rowSize, boolean visible)
  • Method Details

    • showDecks

      public static void showDecks()
    • hideDecks

      public static void hideDecks()
    • getKeySize

      public int getKeySize()
      Description copied from interface: IStreamDeck
      Returns the amount of keys on the StreamDeck.
      Specified by:
      getKeySize in interface IStreamDeck
      Returns:
      Numbers of keys on the deck (Default 15).
    • getRowSize

      public int getRowSize()
      Description copied from interface: IStreamDeck
      Returns the amount of rows on the StreamDeck.
      Specified by:
      getRowSize in interface IStreamDeck
      Returns:
      Numbers of keys on the deck (Default 15).
    • getColumnSize

      public int getColumnSize()
      Description copied from interface: IStreamDeck
      Returns the amount of columns on the StreamDeck.
      Specified by:
      getColumnSize in interface IStreamDeck
      Returns:
      Numbers of keys on the deck (Default 15).
    • addKey

      public void addKey(int keyId, StreamItem item)
      Description copied from interface: IStreamDeck
      Adds a StreamKeyListener to the given index
      Specified by:
      addKey in interface IStreamDeck
      Parameters:
      keyId - Index of the key, 0..14
      item - StreamItem to be bound to the index
    • addKeyListener

      public boolean addKeyListener(StreamKeyListener listener)
      Description copied from interface: IStreamDeck
      Adds an StreamKeyListener to the ESD. WHenever a Event is generated, the Listener will be informed.
      Specified by:
      addKeyListener in interface IStreamDeck
      Parameters:
      listener - Listener to be added
      Returns:
      true if listener was added, false if listener is already registered.
    • removeKeyListener

      public boolean removeKeyListener(StreamKeyListener listener)
      Description copied from interface: IStreamDeck
      Removes an StreamKeyListener from the ESD.
      Specified by:
      removeKeyListener in interface IStreamDeck
      Parameters:
      listener - Listener to be removed
      Returns:
      true if listener was removed, false if listener is not registered.
    • drawImage

      public void drawImage(int keyId, SDImage imgData)
      Description copied from interface: IStreamDeck
      Creates a Job to send the give icon to the ESD to be displayed on the given keyxIndex
      Specified by:
      drawImage in interface IStreamDeck
      Parameters:
      keyId - Index on the ESD as defined by DeckDescriptor
      imgData - Image to be displayed
    • drawImage

      public void drawImage(int keyId, SDImage imgData, Dimension overrideSize)
      Description copied from interface: IStreamDeck
      Creates a Job to send the give icon to the ESD to be displayed on the given keyxIndex
      Specified by:
      drawImage in interface IStreamDeck
      Parameters:
      keyId - Index on the ESD as defined by DeckDescriptor
      imgData - Image to be displayed
      overrideSize - Overrides the default icon size of the given streamdeck
    • drawTouchScreenImage

      public void drawTouchScreenImage(SDImage imgData)
      Description copied from interface: IStreamDeck
      Creates a Job to send the give icon to the ESD to be displayed on the the Touch screen at the given starting point
      Specified by:
      drawTouchScreenImage in interface IStreamDeck
      Parameters:
      imgData - Image to be displayed
    • drawTouchScreenImage

      public void drawTouchScreenImage(Point startPoint, SDImage imgData)
      Description copied from interface: IStreamDeck
      Creates a Job to send the give icon to the ESD to be displayed on the the Touch screen at the given starting point
      Specified by:
      drawTouchScreenImage in interface IStreamDeck
      Parameters:
      startPoint - Pixel coordinates to start drawing the image
      imgData - Image to be displayed
    • hasTouchScreen

      public boolean hasTouchScreen()
      Description copied from interface: IStreamDeck
      Returns if the stream deck has a touch screen
      Specified by:
      hasTouchScreen in interface IStreamDeck
      Returns:
      True if it has a touch screen, false if not
    • getTouchScreen

      public TouchScreen getTouchScreen()
      Description copied from interface: IStreamDeck
      Return the touch screen of the stream deck.
      Specified by:
      getTouchScreen in interface IStreamDeck
      Returns:
      Returns the touch screen object or null, if the stream deck has none.
    • hasDials

      public boolean hasDials()
      Description copied from interface: IStreamDeck
      Returns if the stream deck has dials
      Specified by:
      hasDials in interface IStreamDeck
      Returns:
      True if it has one or more dials, false if not
    • getDials

      public DialKey[] getDials()
      Description copied from interface: IStreamDeck
      Return the dials of the stream deck.
      Specified by:
      getDials in interface IStreamDeck
      Returns:
      Returns the dial objects or an empty array, if the stream deck has none.
    • getDial

      public DialKey getDial(int keyId)
      Description copied from interface: IStreamDeck
      Return the dials of the stream deck.
      Specified by:
      getDial in interface IStreamDeck
      Parameters:
      keyId - Index on the ESD as defined by DeckDescriptor
      Returns:
      Returns the dial objects or an empty array, if the stream deck has none.
    • drawFullImage

      public void drawFullImage(SDImage imgData)
      Specified by:
      drawFullImage in interface IStreamDeck
    • getDescriptor

      public DeckDescriptor getDescriptor()
      Description copied from interface: IStreamDeck
      Returns the descriptor representing this device
      Specified by:
      getDescriptor in interface IStreamDeck
      Returns:
      DeckDescriptor with the appropriate information
    • getHidDevice

      public purejavahidapi.HidDevice getHidDevice()
      Description copied from interface: IStreamDeck
      Returns the Hid Devices representation the stream deck.
      Specified by:
      getHidDevice in interface IStreamDeck
      Returns:
      HidDevice representation the stream deck.
    • removeKey

      public void removeKey(int keyId)
      Description copied from interface: IStreamDeck
      Removes a registered Key. Queues update to the stream deck
      Specified by:
      removeKey in interface IStreamDeck
      Parameters:
      keyId - id of the key to be removed
    • reset

      public void reset()
      Description copied from interface: IStreamDeck
      Queues a task to reset the stream deck.
      Specified by:
      reset in interface IStreamDeck
    • setBrightness

      public void setBrightness(int brightness)
      Description copied from interface: IStreamDeck
      Sets the desired brightness from 0 - 100 % and queues the change.
      Specified by:
      setBrightness in interface IStreamDeck
      Parameters:
      brightness - Brightness in percentile
    • stop

      public void stop()
      Description copied from interface: IStreamDeck
      Tells the background task for the stream deck to stop working.
      Specified by:
      stop in interface IStreamDeck
    • waitForCompletion

      public void waitForCompletion()
      Description copied from interface: IStreamDeck
      Wait for all tasks to be executed
      Specified by:
      waitForCompletion in interface IStreamDeck
    • clearButton

      public void clearButton(int keyId)
      Specified by:
      clearButton in interface IStreamDeck
    • isHardware

      public boolean isHardware()
      Description copied from interface: IStreamDeck
      Returns if behind the interface is actual hardware or a software only StreamDeck.
      Specified by:
      isHardware in interface IStreamDeck
      Returns:
      true if hardware is sued, false if the implementation is only software.
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • pushButton

      public void pushButton(int no)
      Manually Pushing a button at the given id.
      Specified by:
      pushButton in interface IStreamDeck
      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.
      Specified by:
      pressButton in interface IStreamDeck
      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.
      Specified by:
      releaseButton in interface IStreamDeck
      Parameters:
      no - Number of the button to be pushed, 0 - 14, right top to left bottom.