Coder Social home page Coder Social logo

streamdeck4j's Introduction

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.

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

<repositories>
	<repository>
	    <id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

<dependency>
    <groupId>com.github.WalshyDev</groupId>
    <artifactId>StreamDeck4J</artifactId>
    <version>1.1</version>
</dependency>

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.WalshyDev:StreamDeck4J:1.1'
}

Logging Framework - SLF4J

SD4J uses SLF4J 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 and Logback. Here's a nice example of a logback.xml

streamdeck4j's People

Contributors

taydev avatar walshydev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

streamdeck4j's Issues

No getter for `showTitle` in titleParametersDidChange

Also an exception on this event

java.lang.ClassCastException: java.desktop/sun.font.AttributeMap cannot be cast to java.base/java.util.HashMap

    at com.walshydev.streamdeck4j.PluginImpl.getFont(PluginImpl.java:205)
    at com.walshydev.streamdeck4j.PluginImpl.handleEvent(PluginImpl.java:323)
    at com.walshydev.streamdeck4j.EventTests.testTitleParametersDidChange(EventTests.java:215)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:184)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.