Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua2000B committed Jun 17, 2022
0 parents commit d4af79e
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# iTrace-Toolkit
OBS Plugin for Screen Recording during an iTrace-Core Tracking session.
68 changes: 68 additions & 0 deletions iTrace-Recorder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

import obspython as obs
import asyncio
import socket
import threading
import time




HOST = "127.0.0.1"
PORT = 8008

TRACKING = False

#profiles = obs.obs_frontend_get_current_profile_path()
#print(profiles)

#print(obs.obs_output_t)

def connectToCore():
global TRACKING
print("Connecting to core...")
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST,PORT))
#output = obs.obs_output_create("itrace","iTrace Record",
while TRACKING:
data = s.recv(1024)
if not data: break
if data == b"session_end\n":
print("Got end")
obs.obs_frontend_recording_stop()
break
elif data.startswith(b"session_start"):
print("Got start!",obs.obs_frontend_get_current_record_output_path())
obs.obs_frontend_recording_start()

#print(data)
print("Loop stopped, disconnected!")
TRACKING = False


def script_load(settings):
print("Loading script")


def connectButton(*args):
global TRACKING
if TRACKING:
print("Already connected to Core")
return
TRACKING = True

x = threading.Thread(target=connectToCore)
x.start()
print("Pressed!")


def script_properties():
properties = obs.obs_properties_create()
con_button = obs.obs_properties_add_button(properties, "connect_button","Connect to Core",connectButton)

return properties





0 comments on commit d4af79e

Please sign in to comment.