2 Commits

Author SHA1 Message Date
c5db9d1f88 Warn/show alert when state is not active
All checks were successful
continuous-integration/drone/push Build is passing
2020-01-14 23:40:02 -05:00
8de69d7c40 [ci-skip] Add readme
Some checks reported errors
continuous-integration/drone/push Build was killed
2020-01-14 23:36:12 -05:00
3 changed files with 26 additions and 8 deletions

9
README.md Normal file
View File

@ -0,0 +1,9 @@
StreamDeck OBS Replay
=====================
Installation
------------
Install [obs-websocket](https://github.com/Palakis/obs-websocket) and configure
Add plugin to Stream Deck (double click) and configure your icons with the host, port (default: 4444) and password (if configured).

View File

@ -37,12 +37,12 @@
"Author": "Meow.tf", "Author": "Meow.tf",
"Category": "OBS Replay", "Category": "OBS Replay",
"CodePathWin": "replay.exe", "CodePathWin": "replay.exe",
"Description": "Control OBS' Replays using StreamDeck.", "Description": "Control OBS' Replays using StreamDeck and obs-websocket",
"Name": "OBS Replay", "Name": "OBS Replay",
"Icon": "images/pluginIcon", "Icon": "images/pluginIcon",
"CategoryIcon": "images/pluginIcon", "CategoryIcon": "images/pluginIcon",
"URL": "https://streamdeck.meow.tf/obsreplay", "URL": "https://streamdeck.meow.tf/obsreplay",
"Version": "1.0.0", "Version": "1.0.1",
"SDKVersion": 2, "SDKVersion": 2,
"OS": [ "OS": [
{ {

View File

@ -52,6 +52,15 @@ func replaySave(action, context string, payload *fastjson.Value, deviceId string
return return
} }
stateMutex.RLock()
state, exists := cachedStates[context]
stateMutex.RUnlock()
if exists && state == 0 {
sdk.ShowAlert(context)
return
}
req := obsws.NewSaveReplayBufferRequest() req := obsws.NewSaveReplayBufferRequest()
if err := req.Send(c); err != nil { if err := req.Send(c); err != nil {