Update IP/Port, build script
This commit is contained in:
parent
d6437c5397
commit
45f33546d4
3 changed files with 6 additions and 13 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
```bat
|
```bat
|
||||||
pip install nuitka
|
pip install nuitka
|
||||||
python -m nuitka --onefile --windows-disable-console --standalone .\src\desktop\tidbyt-desktop-companion.py
|
python -m nuitka --onefile --windows-console-mode=disable --standalone .\src\desktop\tidbyt-desktop-companion.py
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,13 @@ from src.common.appstate import AppState
|
||||||
|
|
||||||
def on_event(event):
|
def on_event(event):
|
||||||
state: AppState = AppState.IDLE
|
state: AppState = AppState.IDLE
|
||||||
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.6:8000")
|
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.3:8624")
|
||||||
|
|
||||||
if event == obspython.OBS_FRONTEND_EVENT_RECORDING_STARTED:
|
if event == obspython.OBS_FRONTEND_EVENT_RECORDING_STARTED:
|
||||||
state = AppState.OBS_RECORDING
|
state = AppState.OBS_RECORDING
|
||||||
elif event == obspython.OBS_FRONTEND_EVENT_STREAMING_STARTED:
|
elif event == obspython.OBS_FRONTEND_EVENT_STREAMING_STARTED:
|
||||||
state = AppState.OBS_STREAMING
|
state = AppState.OBS_STREAMING
|
||||||
elif (
|
elif event == obspython.OBS_FRONTEND_EVENT_RECORDING_STOPPED or event == obspython.OBS_FRONTEND_EVENT_STREAMING_STOPPED:
|
||||||
event == obspython.OBS_FRONTEND_EVENT_RECORDING_STOPPED
|
|
||||||
or event == obspython.OBS_FRONTEND_EVENT_STREAMING_STOPPED
|
|
||||||
):
|
|
||||||
state = AppState.OBS_PAUSED
|
state = AppState.OBS_PAUSED
|
||||||
|
|
||||||
urllib.request.urlopen(f"{backend_uri}?new_state={state.value}", data={})
|
urllib.request.urlopen(f"{backend_uri}?new_state={state.value}", data={})
|
||||||
|
|
@ -26,6 +23,6 @@ def script_load(_):
|
||||||
|
|
||||||
|
|
||||||
def script_unload():
|
def script_unload():
|
||||||
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.6:8000")
|
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.3:8624")
|
||||||
|
|
||||||
urllib.request.urlopen(f"{backend_uri}?new_state={AppState.IDLE.value}", data={})
|
urllib.request.urlopen(f"{backend_uri}?new_state={AppState.IDLE.value}", data={})
|
||||||
|
|
|
||||||
|
|
@ -104,17 +104,13 @@ class Main:
|
||||||
"""
|
"""
|
||||||
win_title = win32gui.GetWindowText(hwnd)
|
win_title = win32gui.GetWindowText(hwnd)
|
||||||
|
|
||||||
matches: List[MeetingWindow] = list(
|
matches: List[MeetingWindow] = list(filter(lambda x: x.matches_title(win_title), self.__meeting_windows))
|
||||||
filter(lambda x: x.matches_title(win_title), self.__meeting_windows)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not matches:
|
if not matches:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
_, pid = win32process.GetWindowThreadProcessId(hwnd)
|
_, pid = win32process.GetWindowThreadProcessId(hwnd)
|
||||||
rows = self.__wmi.query(
|
rows = self.__wmi.query(f"SELECT Name FROM Win32_Process WHERE ProcessId = {pid}")
|
||||||
f"SELECT Name FROM Win32_Process WHERE ProcessId = {pid}"
|
|
||||||
)
|
|
||||||
|
|
||||||
if not any([x.matches_executable(y.Name) for x in matches for y in rows]):
|
if not any([x.matches_executable(y.Name) for x in matches for y in rows]):
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue