Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
Initial Commit of Plugin
Browse files Browse the repository at this point in the history
Adds SkipTTS button
  • Loading branch information
SocksTheWolf committed May 5, 2023
1 parent 94a9adb commit 744c101
Show file tree
Hide file tree
Showing 33 changed files with 3,367 additions and 0 deletions.
29 changes: 29 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html>

<head>
<title>com.mmattdonk.solrock</title>
<meta charset="utf-8"/>
<style>
canvas {
background-color: transparent;
}
</style>
</head>

<body>
<!-- Stream Deck Libs -->
<script src="libs/js/constants.js"></script>
<script src="libs/js/prototypes.js"></script>
<script src="libs/js/timers.js"></script>
<script src="libs/js/utils.js"></script>
<script src="libs/js/events.js"></script>
<script src="libs/js/api.js"></script>
<script src="libs/js/stream-deck.js"></script>
<script src="libs/js/action.js"></script>

<!-- Plugin Source -->
<script src="app.js"></script>
</body>

</html>
48 changes: 48 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/// <reference path="libs/js/action.js" />
/// <reference path="libs/js/stream-deck.js" />

const myAction = new Action('com.mmattdonk.solrock.skiptts');
const APIEndpoint = "https://solrock.mmattdonk.com/api/streamers/";
const APIKey = "4@K4rLC%G#dn$t!LhRtWVmvEZtstmuA&";
var OverlayID = "";

$SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => {
console.log('Solrock - Stream Deck connected!');
// Fetch the user's global settings
$SD.getGlobalSettings();
});

$SD.onDidReceiveGlobalSettings(({payload}) => {
const {settings} = payload;
OverlayID = settings.overlayId;
// TODO: Grab the streamer ID then use that to be able to rollback tts
});

myAction.onKeyUp(({ action, context, device, event, payload }) => {
if (OverlayID === "") {
console.log('OverlayID does not exist, check settings!');
$SD.showAlert(context);
return;
}

const req = new XMLHttpRequest();
req.open("POST", APIEndpoint + "skiptts");
req.setRequestHeader("Content-Type", "application/json");
req.setRequestHeader("secret", APIKey);
req.setRequestHeader("source", "streamdeck");
req.onreadystatechange = () => {
if (req.readyState === 4) {
const status = req.status;
if (status === 0 || (status >= 200 && status < 400)) {
$SD.showOk(context);
} else {
$SD.showAlert(context);
}
}
};
const payloadObject = {
"overlayId": OverlayID
};
req.send(JSON.stringify(payloadObject));
});

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.mmattdonk.solrock.sdPlugin/assets/skipTTS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.mmattdonk.solrock.sdPlugin/assets/solrock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Description": "Some buttons to interact with the Solrock TTS Service",
"Name": "Solrock TTS",
"Category": "Solrock TTS",
"com.mmattdonk.solrock.skiptts": {
"Name": "Skip TTS",
"Tooltip": "Skips the currently playing TTS"
},
"Localization": {
"overlayID": "TTS Overlay ID",
"findOverlay": "Finding Overlay ID",
"findOverlayDetails": "Paste the Overlay URL link under the sensitive information button into the textbox above!",
"openDashboard": "Open Dashboard"
}
}
3 changes: 3 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/libs/assets/caret.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/libs/assets/caret_closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.mmattdonk.solrock.sdPlugin/libs/assets/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/libs/assets/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/libs/assets/elg_calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/libs/assets/rcheck.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions com.mmattdonk.solrock.sdPlugin/libs/assets/tick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 744c101

Please sign in to comment.