Interface IStreamDeck
- All Known Implementing Classes:
SoftStreamDeck, StreamDeck
public interface 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
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddKey(int keyId, StreamItem item) Adds aStreamKeyListenerto the given indexbooleanaddKeyListener(StreamKeyListener listener) Adds an StreamKeyListener to the ESD.voidclearButton(int i) voiddrawFullImage(SDImage imgData) voidCreates a Job to send the give icon to the ESD to be displayed on the given keyxIndexvoidCreates a Job to send the give icon to the ESD to be displayed on the given keyxIndexvoiddrawTouchScreenImage(SDImage imgData) Creates a Job to send the give icon to the ESD to be displayed on the the Touch screen at the given starting pointvoiddrawTouchScreenImage(Point startPoint, SDImage imgData) Creates a Job to send the give icon to the ESD to be displayed on the the Touch screen at the given starting pointdefault intReturns the amount of columns on the StreamDeck.Returns the descriptor representing this devicegetDial(int keyIndex) Return the dials of the stream deck.DialKey[]getDials()Return the dials of the stream deck.purejavahidapi.HidDeviceReturns the Hid Devices representation the stream deck.default intReturns the amount of keys on the StreamDeck.default intReturns the amount of rows on the StreamDeck.Return the touch screen of the stream deck.booleanhasDials()Returns if the stream deck has dialsbooleanReturns if the stream deck has a touch screenbooleanReturns if behind the interface is actual hardware or a software only StreamDeck.voidpressButton(int no) Create a KeyEvent for a pressed button through softwarevoidpushButton(int no) Create a KeyEvent for a pushed button through softwarevoidreleaseButton(int no) Create a KeyEvent for a released button through softwarevoidremoveKey(int keyId) Removes a registered Key.booleanremoveKeyListener(StreamKeyListener listener) Removes an StreamKeyListener from the ESD.voidreset()Queues a task to reset the stream deck.voidsetBrightness(int brightness) Sets the desired brightness from 0 - 100 % and queues the change.voidstop()Tells the background task for the stream deck to stop working.voidWait for all tasks to be executed
-
Method Details
-
addKey
Adds aStreamKeyListenerto the given index- Parameters:
keyId- Index of the key, 0..14item- StreamItem to be bound to the index- Throws:
IndexOutOfBoundsException- when keyId is < 0 or > 14.
-
addKeyListener
Adds an StreamKeyListener to the ESD. WHenever a Event is generated, the Listener will be informed.- Parameters:
listener- Listener to be added- Returns:
trueif listener was added,falseif listener is already registered.
-
removeKeyListener
Removes an StreamKeyListener from the ESD.- Parameters:
listener- Listener to be removed- Returns:
trueif listener was removed,falseif listener is not registered.
-
drawImage
Creates a Job to send the give icon to the ESD to be displayed on the given keyxIndex- Parameters:
keyIndex- Index on the ESD as defined byDeckDescriptorimgData- Image to be displayed
-
drawTouchScreenImage
-
drawTouchScreenImage
Creates a Job to send the give icon to the ESD to be displayed on the the Touch screen at the given starting point- Parameters:
imgData- Image to be displayed
-
hasTouchScreen
boolean hasTouchScreen()Returns if the stream deck has a touch screen- Returns:
- True if it has a touch screen, false if not
-
getTouchScreen
TouchScreen getTouchScreen()Return the touch screen of the stream deck.- Returns:
- Returns the touch screen object or null, if the stream deck has none.
-
hasDials
boolean hasDials()Returns if the stream deck has dials- Returns:
- True if it has one or more dials, false if not
-
getDials
DialKey[] getDials()Return the dials of the stream deck.- Returns:
- Returns the dial objects or an empty array, if the stream deck has none.
-
getDial
Return the dials of the stream deck.- Parameters:
keyIndex- Index on the ESD as defined byDeckDescriptor- Returns:
- Returns the dial objects or an empty array, if the stream deck has none.
-
drawImage
Creates a Job to send the give icon to the ESD to be displayed on the given keyxIndex- Parameters:
keyIndex- Index on the ESD as defined byDeckDescriptorimgData- Image to be displayedoverrideSize- Overrides the default icon size of the given streamdeck
-
getHidDevice
purejavahidapi.HidDevice getHidDevice()Returns the Hid Devices representation the stream deck.- Returns:
- HidDevice representation the stream deck.
-
getDescriptor
DeckDescriptor getDescriptor()Returns the descriptor representing this device- Returns:
- DeckDescriptor with the appropriate information
-
removeKey
void removeKey(int keyId) Removes a registered Key. Queues update to the stream deck- Parameters:
keyId- id of the key to be removed
-
reset
void reset()Queues a task to reset the stream deck. -
setBrightness
void setBrightness(int brightness) Sets the desired brightness from 0 - 100 % and queues the change.- Parameters:
brightness- Brightness in percentile
-
stop
void stop()Tells the background task for the stream deck to stop working. -
waitForCompletion
void waitForCompletion()Wait for all tasks to be executed -
clearButton
void clearButton(int i) -
isHardware
boolean isHardware()Returns if behind the interface is actual hardware or a software only StreamDeck.- Returns:
trueif hardware is sued,falseif the implementation is only software.
-
getKeySize
default int getKeySize()Returns the amount of keys on the StreamDeck.- Returns:
- Numbers of keys on the deck (Default 15).
-
getRowSize
default int getRowSize()Returns the amount of rows on the StreamDeck.- Returns:
- Numbers of keys on the deck (Default 15).
-
getColumnSize
default int getColumnSize()Returns the amount of columns on the StreamDeck.- Returns:
- Numbers of keys on the deck (Default 15).
-
pushButton
void pushButton(int no) Create a KeyEvent for a pushed button through software- Parameters:
no- Key no
-
pressButton
void pressButton(int no) Create a KeyEvent for a pressed button through software- Parameters:
no- Key no
-
releaseButton
void releaseButton(int no) Create a KeyEvent for a released button through software- Parameters:
no- Key no
-
drawFullImage
-