|
|
|
@ -42,6 +42,27 @@ fourcc = cv2.VideoWriter_fourcc(*'XVID')
|
|
|
|
|
# fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
|
|
|
|
recordfeed = False
|
|
|
|
|
|
|
|
|
|
def about_window():
|
|
|
|
|
'''
|
|
|
|
|
Opens a new window with about information
|
|
|
|
|
XXX: currently freezes the video while open
|
|
|
|
|
TODO:
|
|
|
|
|
- add link to website in text (use click event on a line of text for the link)
|
|
|
|
|
https://pysimplegui.readthedocs.io/en/latest/call%20reference/#text-element
|
|
|
|
|
- add IDS Logo
|
|
|
|
|
'''
|
|
|
|
|
layout = [
|
|
|
|
|
[sg.Text("New Window", key="new")]
|
|
|
|
|
]
|
|
|
|
|
window = sg.Window("Second Window", layout, modal=False, size=(300,150))
|
|
|
|
|
choice = None
|
|
|
|
|
while True:
|
|
|
|
|
event, values = window.read()
|
|
|
|
|
if event == "Exit" or event == sg.WIN_CLOSED:
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
window.close()
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
flushvideofiles()
|
|
|
|
|
global cv
|
|
|
|
@ -63,11 +84,17 @@ def main():
|
|
|
|
|
# window layout
|
|
|
|
|
layout = [
|
|
|
|
|
[sg.Text("Webcam Manager",
|
|
|
|
|
size=(100,1),
|
|
|
|
|
size=(15,1),
|
|
|
|
|
font=("Steps-Mono", 20),
|
|
|
|
|
justification="left")
|
|
|
|
|
justification="left"),
|
|
|
|
|
sg.Text("V α 0.1", size=(19,1), justification="left"),
|
|
|
|
|
sg.Button(
|
|
|
|
|
image_data=convert_to_bytes('assets/button_ABOUT.png', (40, 40)),
|
|
|
|
|
button_color=(sg.theme_background_color(), sg.theme_background_color()),
|
|
|
|
|
border_width=0,
|
|
|
|
|
enable_events=True,
|
|
|
|
|
key="About")
|
|
|
|
|
],
|
|
|
|
|
[sg.Text("V α 0.1", size=(100,1), justification="left")],
|
|
|
|
|
[sg.Text("Device # ", size=(10,1), justification="left"),
|
|
|
|
|
sg.Combo(devices, size=(10, 1), default_value=cv_src, key="DEVICE")
|
|
|
|
|
],
|
|
|
|
@ -107,8 +134,8 @@ def main():
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# create window
|
|
|
|
|
window = sg.Window("Webcam Manager", layout, size=(430,500))
|
|
|
|
|
window.set_icon("assets/logo.png")
|
|
|
|
|
window = sg.Window("Webcam Manager", layout, size=(430,490))
|
|
|
|
|
window.set_icon("assets/app_icon.png")
|
|
|
|
|
|
|
|
|
|
# Original colors
|
|
|
|
|
REC_default_col = window["REC"].ButtonColor
|
|
|
|
@ -126,6 +153,8 @@ def main():
|
|
|
|
|
|
|
|
|
|
if event == "Exit" or event == sg.WIN_CLOSED:
|
|
|
|
|
break
|
|
|
|
|
elif event == "About":
|
|
|
|
|
about_window();
|
|
|
|
|
elif event == "Flush":
|
|
|
|
|
flushvideofiles()
|
|
|
|
|
elif event == "REC":
|
|
|
|
|