https://github.com/walshydev/streamdeck4j
Java library for the StreamDeckSDK
https://github.com/walshydev/streamdeck4j
java streamdeck streamdecksdk
Last synced: 3 months ago
JSON representation
Java library for the StreamDeckSDK
- Host: GitHub
- URL: https://github.com/walshydev/streamdeck4j
- Owner: WalshyDev
- Created: 2019-02-02T19:08:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-20T20:55:11.000Z (almost 3 years ago)
- Last Synced: 2025-01-31T18:12:14.379Z (3 months ago)
- Topics: java, streamdeck, streamdecksdk
- Language: Java
- Homepage:
- Size: 83 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StreamDeck4J
The StreamDeck library for Java!## Usage
Create an instance of `StreamDeck`, add any listeners you may want (You can either use `EventListener` or the more preferred `ListenerAdapter` for this). Finally, just call `connect()`!### Example code
For a **full** example check our the `src/main/test/java/Example` class.
```java
public static void main(String[] args) {
StreamDeck4J streamDeck4J = new StreamDeck4J();
streamDeck4J.addListener(new AbstractListener() {
@Override
public void onActionAppeared(ActionAppearedEvent event) {
streamDeck4J.setTitle(
event.getContext(),
"Made With\nStreamDeck4J!",
Destination.HARDWARE_AND_SOFTWARE
);
}
});
streamDeck4J.connect(args);
}
```## Building for the StreamDeck
1. Compile your jar with your build tool
2. Use Launch4J (http://launch4j.sourceforge.net) to make it an exe
3. Put the exe in your `manifest.json` as the `CodePath`
4. Profit!## How to add?
### Maven
```xml
jitpack.io
https://jitpack.io
com.github.WalshyDev
StreamDeck4J
1.1```
### Gradle
```groovy
repositories {
maven { url 'https://jitpack.io' }
}dependencies {
implementation 'com.github.WalshyDev:StreamDeck4J:1.1'
}
```### Logging Framework - SLF4J
SD4J uses [SLF4J](https://www.slf4j.org/) to log its messages.That means you should add some SLF4J implementation to your build path in addition to SD4J.
If no implementation is found, following message will be printed to the console on startup:
```
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
```The most popular implementations are [Log4j 2](https://logging.apache.org/log4j/2.x/) and [Logback](https://logback.qos.ch/). [Here's a nice example of a logback.xml](https://gist.github.com/WalshyDev/dfcd1f155b71c68bf596deb44bf6e15f)