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
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.
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 Summary
ConstructorsConstructorDescriptionStreamDeckController(IStreamDeck streamDeck, StreamItem root) Creates the StreamDeckController with a root folder and the ESD -
Method Summary
Modifier and TypeMethodDescriptionDialKey[]getDials()returns the StreamDeck used by the controller.booleanhasDials()booleanvoidonAnimationStart(int keyIndex) Called when the animation startsvoidonAnimationStop(int keyIndex) Called when the animation startsvoidonIconUpdate(StreamItem source, boolean animationChanged) Updates the display data.
BUGFIXES:
#1 - Changed if query to work with proxy items (skeletons encasing the real item(s))voidonKeyEvent(KeyEvent event) Handling key events from the ESD.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.voidResets stream deck and updates display of keysvoidsetBrightness(int brightness) Wrapper to set brightness of stream deckstatic voidsetKeyDeadzone(long keyDeadZone) Sets the key dead zone.voidsetRoot(StreamItem root) Sets a new root folder and opens itvoidstop(boolean immediate, boolean shutdownStreamDeck) Stops the update by animators on the streamdeck and the streamdeck itself
-
Constructor Details
-
StreamDeckController
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
-
onKeyEvent
Handling key events from the ESD.- Specified by:
onKeyEventin interfaceStreamKeyListener- 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 untilreleaseButton(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
Updates the display data.
BUGFIXES:
#1 - Changed if query to work with proxy items (skeletons encasing the real item(s))- Specified by:
onIconUpdatein interfaceIconUpdateListener
-
setRoot
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
-
hasDials
public boolean hasDials() -
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:AnimationListenerCalled when the animation starts- Specified by:
onAnimationStartin interfaceAnimationListener- Parameters:
keyIndex- Index of the key on which the animation is displayed on
-
onAnimationStop
public void onAnimationStop(int keyIndex) Description copied from interface:AnimationListenerCalled when the animation starts- Specified by:
onAnimationStopin interfaceAnimationListener- Parameters:
keyIndex- Index of the key on which the animation was displayed on
-