Move old implementation

This commit is contained in:
2022-10-21 22:08:01 +02:00
parent 814e88d19e
commit 9c8319e114
8 changed files with 16 additions and 0 deletions

5
old_golang/go.mod Normal file
View File

@@ -0,0 +1,5 @@
module git.schoffit.net/structix/obs-cli
go 1.14
require github.com/christopher-dG/go-obs-websocket v0.0.0-20200501221211-5c9c018f6fb4

6
old_golang/go.sum Normal file
View File

@@ -0,0 +1,6 @@
github.com/christopher-dG/go-obs-websocket v0.0.0-20200501221211-5c9c018f6fb4 h1:0Fan8hJXrrqS9CnYdsVXhDclCjmfDIoLgZBdAuE6S/A=
github.com/christopher-dG/go-obs-websocket v0.0.0-20200501221211-5c9c018f6fb4/go.mod h1:P5w+dDqQEbCMFAkmucNcEQ6xgAt/NP+Aw58OQfY/H/o=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=

30
old_golang/main.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"github.com/christopher-dG/go-obs-websocket"
"log"
"time"
)
func main() {
// Connect a client.
c := obsws.Client{Host: "localhost", Port: 4444}
if err := c.Connect(); err != nil {
log.Fatal(err)
}
defer c.Disconnect()
// Set the amount of time we can wait for a response.
obsws.SetReceiveTimeout(time.Second * 10)
recrequest := obsws.NewStartStopRecordingRequest()
if err := recrequest.Send(c); err != nil {
log.Fatal(err)
}
response, err := recrequest.Receive()
if err != nil {
log.Fatal(err)
}
log.Println("Recording: " + response.Status())
}

3
old_golang/make_windows.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
GOOS=windows GOARCH=amd64 go build -o obs-cli-windows.exe

16
old_golang/starter.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Start obs
echo "Start obs."
./obs-cli
# calculate the cli argument to seconds
seconds=$(expr $1 \* 60)
echo "Waiting $seconds seconds ($1 min)"
sleep $seconds
# Stop obs
echo "Stop obs."
./obs-cli