Git Product home page Git Product logo

streamdeckcore's Introduction

StreamDeckCore

Maven Central SonarCloud Quality Gate

This project provides api acces to any connected Elgato Stream Deck (Called ESD from now on). Windows, Linux and Mac OS X should be supported, but only windows could be tested. This project is not associated in any way with Elgato Systems.

Basic functionality

StreamDeckCore provides the following basic features:

  1. Supporting multiple ESDs
  2. Recognizing a connected ESD
  3. Retriving all connected ESDs
  4. Resetting the connected ESD
  5. Setting the icons of the keys (0 - 14)
  6. Setting the brightness of the ESD (0 - 99)
  7. Recieving key pressed, released, clicked events from the ESD
  8. Recieving KeyEvents if a key is beeing changed, one event for adding a key and one event for removing a key.
  9. Custom animations for specific keys, at a 60/30/15 fps or custom fps.

Advanced functionality

StreamDeckController

The StreamDeckController class is an easy way to display content and create folder structures without the need of developing the code for folders etc. yourself.

Soft Deck

If you have no Stream Deck yourself, but still want to develop for the plattform, you can use the software implementation to do that. Its a simple JFrame of all 15 "buttons" displayed. Its activated on default and can be disabled at the start of your program by using de.rcblum.stream.deck.device.StreamDeckDevices.disableSoftwareStreamDeck();

Future functionality

  • Recognize new connected and disconnected StreamDecks
  • Display different Soundboards for multiple StreamDecks

Current objectives

  1. Clean up sources
  2. Document everything
  3. Create tutorial & example programs

Integration

Maven

If you want to use this library in your maven project, just add the following dependency to you pom.xml:

<dependency>
  <groupId>io.github.vveird</groupId>
  <artifactId>StreamDeckCore</artifactId>
  <version>1.0.3</version>
</dependency>

Github

This uses the github project https://github.com/nyholku/purejavahidapi (forked to https://github.com/WElRD/purejavahidapi).

I'd recommend using the following fork for now, as the current version of nyholku's library introduces some errors that breaks this library: https://github.com/WElRD/purejavahidapi. This version is also included in the releases.

The maven dependencies of the project reference the appropriate libaries.

Usage

For examples please see the wiki

streamdeckcore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

streamdeckcore's Issues

MacOS: Unable to load library 'CoreFoundation': Native library (darwin/libCoreFoundation.dylib) not found

Attempting to get a StreamDeckDevices instance produces the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'CoreFoundation': Native library (darwin/libCoreFoundation.dylib) not found in resource path (...)
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
	at com.sun.jna.Library$Handler.<init>(Library.java:147)
	at com.sun.jna.Native.loadLibrary(Native.java:412)
	at com.sun.jna.Native.loadLibrary(Native.java:391)
	at purejavahidapi.macosx.CoreFoundationLibrary.<clinit>(CoreFoundationLibrary.java:41)
	at purejavahidapi.macosx.MacOsXBackend.init(MacOsXBackend.java:116)
	at purejavahidapi.PureJavaHidApi.<clinit>(PureJavaHidApi.java:117)
	at de.rcblum.stream.deck.device.StreamDeckDevices.getStreamDeckInfo(StreamDeckDevices.java:86)
	at de.rcblum.stream.deck.device.StreamDeckDevices.getStreamDeckDevice(StreamDeckDevices.java:100)
	at de.rcblum.stream.deck.device.StreamDeckDevices.getStreamDeck(StreamDeckDevices.java:124)
...

Is there a workaround?
Thanks!

Can I activate a Stream Deck key from within Java - Does this integration exist ?

I am writing a Java based Twitch Bot. I would like the Bot based on some viewer interaction - integrate with OBS and roll20...
I have a stream deck which seems like the perfect middleware for such interaction.
So my question that i cant seem to establish, is that from java code, can i have java actuate integration that causes a stream deck key depression?

Cannot send image and wrong key event

Hi. Thanks for the lib

I have a Stream Deck wit 5x3 Buttons but I have a Problem, that I can not send image or set KeyColor (Try with Example1_Displaying_A_Key.java)-
KeyListener is working, so StreamDeck is detected correctly, except of wrong index "3: pressed" when I press first key (try with Example2_Receiving_key_events.java).

[Feature Request] ESD Mini Support

Before anything else, I want to say that this project is awesome!
It looks like you put a lot of effort into the architecture, etc. pp. So great!

Nonetheless, do you plan to support the ESD Mini?

The new device has (of course) another Device Id, less buttons and some other differences compared to the "large" ESD.

I tried by myself, but I do not get how the byte arrays to set the values work or how to you get the numbers of exact amout of pixels per page. Frustrating.

Keep on coding! :)

Purejavahidapi and Jna no more compatible?

Its a nice projeckt bat it looks like its no more compatible with new Stream Deck (5 x 3 Buttons).

There was some exceptions. After inserted jna 5.5.0 and build current nyholku/urejavahidapi. I have still exception while running Example1_Displaying_A_Key.java
Vendor-ID: 4057, Product-ID: 109
Found ESD [4057:109]
Connected Stream Decks:
Manufacurer: Elgato
Product: Stream Deck
Device-Id: HID\VID_0FD9&PID_006D\8&3992574&0&0000
Serial-No: AL17J2C01756
Path: \?\hid#vid_0fd9&pid_006d#8&3992574&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

Error sending the following command-class to the esd: class de.rcblum.stream.deck.device.StreamDeck$IconUpdater
java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at purejavahidapi.windows.HidDevice.setOutputReport(HidDevice.java:170)
	at de.rcblum.stream.deck.device.StreamDeck.internalDrawImage(StreamDeck.java:463)
	at de.rcblum.stream.deck.device.StreamDeck$IconUpdater.run(StreamDeck.java:230)
	at de.rcblum.stream.deck.device.StreamDeck$DeckWorker.run(StreamDeck.java:182)
	at java.lang.Thread.run(Thread.java:748)

It means the place with System.arraycopy(data, 0, m_OutputReportArray, 1, length)

	@Override
	synchronized public int setOutputReport(byte reportID, byte[] data, int length) {
		if (!m_Open)
			throw new IllegalStateException("device not open");
		if (m_OutputReportLength == 0)
			throw new IllegalArgumentException("this device supports no output reports");
		// In Windows writeFile() to HID device data has to be preceded with the report
		// number, regardless
		Arrays.fill(m_OutputReportArray, (byte)0);
		m_OutputReportArray[0] = reportID;
		System.arraycopy(data, 0, m_OutputReportArray, 1, length);

Length of data is 8190 but m_OutputReportArray is only 1024 get from caps.OutputReportByteLength;
Where is this from?

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.