Class SoftStreamDeck
java.lang.Object
de.rcblum.stream.deck.device.general.SoftStreamDeck
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSoftStreamDeck(String name, IStreamDeck streamDeck) SoftStreamDeck(String name, IStreamDeck streamDeck, boolean visible) SoftStreamDeck(String name, IStreamDeck streamDeck, int keySize, int rowSize, boolean visible) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKey(int keyId, StreamItem item) Adds aStreamKeyListenerto the given indexbooleanaddKeyListener(StreamKeyListener listener) Adds an StreamKeyListener to the ESD.voidclearButton(int keyId) 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 pointintReturns the amount of columns on the StreamDeck.Returns the descriptor representing this devicegetDial(int keyId) 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.intReturns the amount of keys on the StreamDeck.getName()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 screenstatic voidbooleanReturns if behind the interface is actual hardware or a software only StreamDeck.voidpressButton(int no) Manually presses a button at the given id untilreleaseButton(int)is called.voidpushButton(int no) Manually Pushing a button at the given id.voidreleaseButton(int no) Manually releases a button at the given id.voidremoveKey(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.voidstatic voidvoidstop()Tells the background task for the stream deck to stop working.voidWait for all tasks to be executed
-
Constructor Details
-
SoftStreamDeck
-
SoftStreamDeck
-
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:IStreamDeckReturns the amount of keys on the StreamDeck.- Specified by:
getKeySizein interfaceIStreamDeck- Returns:
- Numbers of keys on the deck (Default 15).
-
getRowSize
public int getRowSize()Description copied from interface:IStreamDeckReturns the amount of rows on the StreamDeck.- Specified by:
getRowSizein interfaceIStreamDeck- Returns:
- Numbers of keys on the deck (Default 15).
-
getColumnSize
public int getColumnSize()Description copied from interface:IStreamDeckReturns the amount of columns on the StreamDeck.- Specified by:
getColumnSizein interfaceIStreamDeck- Returns:
- Numbers of keys on the deck (Default 15).
-
addKey
Description copied from interface:IStreamDeckAdds aStreamKeyListenerto the given index- Specified by:
addKeyin interfaceIStreamDeck- Parameters:
keyId- Index of the key, 0..14item- StreamItem to be bound to the index
-
addKeyListener
Description copied from interface:IStreamDeckAdds an StreamKeyListener to the ESD. WHenever a Event is generated, the Listener will be informed.- Specified by:
addKeyListenerin interfaceIStreamDeck- Parameters:
listener- Listener to be added- Returns:
trueif listener was added,falseif listener is already registered.
-
removeKeyListener
Description copied from interface:IStreamDeckRemoves an StreamKeyListener from the ESD.- Specified by:
removeKeyListenerin interfaceIStreamDeck- Parameters:
listener- Listener to be removed- Returns:
trueif listener was removed,falseif listener is not registered.
-
drawImage
Description copied from interface:IStreamDeckCreates a Job to send the give icon to the ESD to be displayed on the given keyxIndex- Specified by:
drawImagein interfaceIStreamDeck- Parameters:
keyId- Index on the ESD as defined byDeckDescriptorimgData- Image to be displayed
-
drawImage
Description copied from interface:IStreamDeckCreates a Job to send the give icon to the ESD to be displayed on the given keyxIndex- Specified by:
drawImagein interfaceIStreamDeck- Parameters:
keyId- Index on the ESD as defined byDeckDescriptorimgData- Image to be displayedoverrideSize- Overrides the default icon size of the given streamdeck
-
drawTouchScreenImage
Description copied from interface:IStreamDeckCreates 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:
drawTouchScreenImagein interfaceIStreamDeck- Parameters:
imgData- Image to be displayed
-
drawTouchScreenImage
Description copied from interface:IStreamDeckCreates 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:
drawTouchScreenImagein interfaceIStreamDeck- Parameters:
startPoint- Pixel coordinates to start drawing the imageimgData- Image to be displayed
-
hasTouchScreen
public boolean hasTouchScreen()Description copied from interface:IStreamDeckReturns if the stream deck has a touch screen- Specified by:
hasTouchScreenin interfaceIStreamDeck- Returns:
- True if it has a touch screen, false if not
-
getTouchScreen
Description copied from interface:IStreamDeckReturn the touch screen of the stream deck.- Specified by:
getTouchScreenin interfaceIStreamDeck- Returns:
- Returns the touch screen object or null, if the stream deck has none.
-
hasDials
public boolean hasDials()Description copied from interface:IStreamDeckReturns if the stream deck has dials- Specified by:
hasDialsin interfaceIStreamDeck- Returns:
- True if it has one or more dials, false if not
-
getDials
Description copied from interface:IStreamDeckReturn the dials of the stream deck.- Specified by:
getDialsin interfaceIStreamDeck- Returns:
- Returns the dial objects or an empty array, if the stream deck has none.
-
getDial
Description copied from interface:IStreamDeckReturn the dials of the stream deck.- Specified by:
getDialin interfaceIStreamDeck- Parameters:
keyId- Index on the ESD as defined byDeckDescriptor- Returns:
- Returns the dial objects or an empty array, if the stream deck has none.
-
drawFullImage
- Specified by:
drawFullImagein interfaceIStreamDeck
-
getDescriptor
Description copied from interface:IStreamDeckReturns the descriptor representing this device- Specified by:
getDescriptorin interfaceIStreamDeck- Returns:
- DeckDescriptor with the appropriate information
-
getHidDevice
public purejavahidapi.HidDevice getHidDevice()Description copied from interface:IStreamDeckReturns the Hid Devices representation the stream deck.- Specified by:
getHidDevicein interfaceIStreamDeck- Returns:
- HidDevice representation the stream deck.
-
removeKey
public void removeKey(int keyId) Description copied from interface:IStreamDeckRemoves a registered Key. Queues update to the stream deck- Specified by:
removeKeyin interfaceIStreamDeck- Parameters:
keyId- id of the key to be removed
-
reset
public void reset()Description copied from interface:IStreamDeckQueues a task to reset the stream deck.- Specified by:
resetin interfaceIStreamDeck
-
setBrightness
public void setBrightness(int brightness) Description copied from interface:IStreamDeckSets the desired brightness from 0 - 100 % and queues the change.- Specified by:
setBrightnessin interfaceIStreamDeck- Parameters:
brightness- Brightness in percentile
-
stop
public void stop()Description copied from interface:IStreamDeckTells the background task for the stream deck to stop working.- Specified by:
stopin interfaceIStreamDeck
-
waitForCompletion
public void waitForCompletion()Description copied from interface:IStreamDeckWait for all tasks to be executed- Specified by:
waitForCompletionin interfaceIStreamDeck
-
clearButton
public void clearButton(int keyId) - Specified by:
clearButtonin interfaceIStreamDeck
-
isHardware
public boolean isHardware()Description copied from interface:IStreamDeckReturns if behind the interface is actual hardware or a software only StreamDeck.- Specified by:
isHardwarein interfaceIStreamDeck- Returns:
trueif hardware is sued,falseif the implementation is only software.
-
getName
-
setName
-
pushButton
public void pushButton(int no) Manually Pushing a button at the given id.- Specified by:
pushButtonin interfaceIStreamDeck- 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 untilreleaseButton(int)is called.- Specified by:
pressButtonin interfaceIStreamDeck- 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:
releaseButtonin interfaceIStreamDeck- Parameters:
no- Number of the button to be pushed, 0 - 14, right top to left bottom.
-