generated from elgatosf/streamdeck-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
169 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "src/app.olivetin.sdPlugin/libs"] | ||
path = src/app.olivetin.sdPlugin/libs | ||
url = https://github.com/elgatosf/streamdeck-javascript-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,4 @@ | ||
|
||
# Stream Deck Plugin Template | ||
# OliveTin-streamdeck-plugin | ||
|
||
The `Stream Deck Plugin Template` is a template to let you get started quickly when writing a JavaScript plugin for [Stream Deck](https://docs.elgato.com/sdk/). `Stream Deck Plugin Template` requires Stream Deck 6.0 or later. | ||
|
||
## Description | ||
|
||
`Stream Deck Plugin Template` is a complete plugin that shows you how to | ||
|
||
- load and save settings using Stream Deck's persistent store | ||
- setup and communicate with the Property Inspector | ||
- pass messages directly from Property Inspector to the plugin (and vice versa) | ||
- localize your Property Inspector's UI to another language | ||
|
||
## Features | ||
|
||
- code written in Javascript | ||
- cross-platform (macOS, Windows) | ||
- localization support | ||
- styled [Property Inspector](https://developer.elgato.com/documentation/stream-deck/sdk/property-inspector/) included | ||
- Property Inspector contains all required boilerplate code to let you instantly work on your plugin's code. | ||
|
||
## Quick Start Guide | ||
|
||
A short guide to help you get started quickly. | ||
|
||
### Clone the repo | ||
|
||
```git clone https://github.com/elgatosf/streamdeck-plugin-template``` | ||
|
||
### Replace Name | ||
|
||
Rename the folder as well as any references. | ||
|
||
`com.elgato.template.sdPlugin` with `my.domain.plugin-name.sdPlugin` | ||
|
||
> [!IMPORTANT] | ||
> When sym-linking the plugin, the folder name must end with `.sdPlugin`. | ||
### Get the latest library | ||
|
||
You can either clone the javascript library or add it as a submodule to your repository. | ||
|
||
#### Clone | ||
|
||
```git clone https://github.com/elgatosf/streamdeck-javascript-sdk src/my.domain.plugin-name/libs``` | ||
|
||
#### Add Submodule | ||
|
||
```git submodule add https://github.com/elgatosf/streamdeck-javascript-sdk src/my.domain.plugin-name/libs``` | ||
|
||
### Start Coding | ||
|
||
You can get started in app.js! | ||
|
||
```javascript | ||
const myAction = new Action('com.elgato.template.action'); | ||
|
||
/** | ||
* The first event fired when Stream Deck starts | ||
*/ | ||
$SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => { | ||
console.log('Stream Deck connected!'); | ||
}); | ||
|
||
myAction.onKeyUp(({ action, context, device, event, payload }) => { | ||
console.log('Your key code goes here!'); | ||
}); | ||
|
||
myAction.onDialRotate(({ action, context, device, event, payload }) => { | ||
console.log('Your dial code goes here!'); | ||
}); | ||
``` | ||
This is in very early development! |
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
src/app.olivetin.sdPlugin/actions/StartAction/assets/appImage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
src/app.olivetin.sdPlugin/actions/StartAction/assets/buttonImage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/// <reference path="libs/js/action.js" /> | ||
/// <reference path="libs/js/stream-deck.js" /> | ||
|
||
const startAction = new Action('app.olivetin.actions.start'); | ||
|
||
$SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => { | ||
console.log('Stream Deck connected! 9'); | ||
console.log("sa", startAction) | ||
}); | ||
|
||
startAction.onKeyUp(({ action, context, device, event, payload }) => { | ||
console.log(action) | ||
|
||
const settings = payload.settings | ||
|
||
const startActionArgs = { | ||
actionId: settings.action_id, | ||
arguments: [] | ||
} | ||
|
||
console.log("sa args", startActionArgs) | ||
|
||
fetch(settings.url + 'StartAction', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify(startActionArgs) | ||
}).then(res => { | ||
if (res.ok) { | ||
return res.json() | ||
} else { | ||
console.log("then err", res) | ||
throw new Error(res) | ||
} | ||
}).catch(err => { | ||
throw err | ||
}) | ||
}); | ||
|
||
const killAction = new Action("app.olivetin.actions.kill") | ||
|
||
killAction.onKeyUp(() => { | ||
console.log("Kill") | ||
}); |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
src/com.elgato.template.sdPlugin/en.json → src/app.olivetin.sdPlugin/en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"SDKVersion": 2, | ||
"Author": "James Read", | ||
"CodePath": "app.html", | ||
"Description": "OliveTin Streamdeck plugin", | ||
"Name": "OliveTin Plugin", | ||
"Icon": "actions/template/assets/action", | ||
"URL": "https://docs.olivetin.app/stream-deck.html", | ||
"Version": "1.0.0", | ||
"Software": { | ||
"MinimumVersion": "5.0" | ||
}, | ||
"OS": [ | ||
{ | ||
"Platform": "mac", | ||
"MinimumVersion": "10.11" | ||
}, | ||
{ | ||
"Platform": "windows", | ||
"MinimumVersion": "10" | ||
} | ||
], | ||
"Category": "OliveTin", | ||
"CategoryIcon": "actions/StartAction/assets/appImage", | ||
"Actions": [ | ||
{ | ||
"UUID": "app.olivetin.actions.start", | ||
"Name": "Start OliveTin Action", | ||
"Tooltip": "Starts an OliveTin action", | ||
"PropertyInspectorPath": "actions/StartAction/property-inspector/inspector.html", | ||
"Controllers": ["Keypad"], | ||
"Icon": "actions/StartAction/assets/appImage", | ||
"States": [ | ||
{ | ||
"Image": "actions/StartAction/assets/buttonImage" | ||
} | ||
] | ||
}, | ||
{ | ||
"UUID": "app.olivetin.actions.kill", | ||
"Name": "Kill OliveTin Action", | ||
"Tooltip": "Kills an OliveTin action", | ||
"PropertyInspectorPath": "actions/StartAction/property-inspector/inspector.html", | ||
"Controllers": ["Keypad", "Encoder"], | ||
"Icon": "actions/StartAction/assets/appImage", | ||
"States": [ | ||
{ | ||
"Image": "actions/StartAction/assets/buttonImage" | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.