-
Notifications
You must be signed in to change notification settings - Fork 0
/
preview camera has changed.py
61 lines (45 loc) · 1.51 KB
/
preview camera has changed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import PyATEMMax
from pynput.keyboard import Key, Listener, KeyCode
from pynput import keyboard
import win32gui, win32process, os
import sys, time, threading
from colored import fg
atemMini = PyATEMMax.ATEMMax()
atem4K = PyATEMMax.ATEMMax()
PGM = atem4K.previewInput[1].videoSource.value
PVW = atem4K.previewInput[1].videoSource.value
def setPGMandPVWtoCurrent():
global PGM
global PVW
if PVW == 5:
PVW = atem4K.previewInput[1].videoSource.value + atemMini.programInput[1].videoSource.value
if PGM == 5:
PGM = atem4K.programInput[1].videoSource.value + atemMini.programInput[1].videoSource.value
setPGMandPVWtoCurrent()
stop_flag = False
def PGM_and_PVW_has_chaned():
global PVW
global PGM
while not stop_flag:
last_PGM = atem4K.previewInput[1].videoSource.value
last_PVW = atem4K.previewInput[1].videoSource.value
# if last_PGM != PGM:
# PGM = last_PGM
# setPGMandPVWtoCurrent()
# if last_PVW != PVW:
# PVW = last_PVW
# setPGMandPVWtoCurrent()
if last_PVW != PVW or last_PGM != PGM:
PVW = last_PVW
PGM = last_PGM
setPGMandPVWtoCurrent()
#consoleText()
print(11111)
time.sleep(0.01)
PGM_PVW_Listener = threading.Thread(target=PGM_and_PVW_has_chaned)
PGM_PVW_Listener.start()
for i in range(100):
print(99999)
time.sleep(0.01)
stop_flag = True
#PGM_PVW_Listener.join()