-
Notifications
You must be signed in to change notification settings - Fork 3
/
gse.kv
494 lines (482 loc) · 18.4 KB
/
gse.kv
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<Welcome>:
name: "welcome"
md_bg_color: app.theme_cls.primary_color
MDBoxLayout:
orientation: "vertical"
MDLabel:
text: "Welcome to Green Screen Emulator"
halign: "center"
font_size: "50sp"
bold: True
MDBoxLayout:
padding: "15sp"
spacing: "15sp"
size_hint_y: None
height: self.minimum_height + sp(50)
AnchorLayout:
MDFlatButton:
text: "Open the last project"
on_release: app.change("advanced")
font_size: "20sp"
disabled: True
AnchorLayout:
MDFlatButton:
text: "Upload new source"
on_release: app.file_manager_open()
on_release: app.go_to = ["ready", "time", "background"]
font_size: "20sp"
Menu
<Background>
name: "background"
md_bg_color: app.theme_cls.primary_color
MDBoxLayout:
orientation: "vertical"
MDLabel:
text: "Which should be the new background to the file?"
halign: "center"
font_size: "30sp"
MDLabel:
text: app.ctrl.input
halign: "center"
font_size: "30sp"
bold: True
MDBoxLayout:
padding: "15sp"
spacing: "15sp"
size_hint_y: None
height: self.minimum_height + sp(60)
AnchorLayout:
MDFlatButton:
text: "No one (export the mask)"
on_release: app.ctrl.background = ""
on_release: app.ctrl.do_again(2)
on_release: app.change()
font_size: "20sp"
AnchorLayout:
MDFlatButton:
text: "Color"
on_release: app.change("colors")
font_size: "20sp"
AnchorLayout:
MDFlatButton:
text: "Image/Video"
on_release: app.file_manager_open()
font_size: "20sp"
Menu
<Colors>
name: "colors"
md_bg_color: cp.color[0], cp.color[1], cp.color[2], 1
MDBoxLayout:
orientation: "vertical"
padding: "15sp"
spacing: "15sp"
MDLabel:
text: "Note alpha channel is not supported"
halign: "center"
font_size: "30sp"
adaptive_height: True
ColorPicker:
id: cp
color: 0, 1, 0, 1
AnchorLayout:
padding: "10sp"
anchor_x: "right"
anchor_y: "bottom"
MDFloatingActionButton:
icon: "check"
on_release: app.change()
on_release: app.ctrl.background = [c * 255 for c in [cp.color[0], cp.color[1], cp.color[2]]]
on_release: app.ctrl.do_again(2)
Menu
<Time>
name: "time"
md_bg_color: app.theme_cls.primary_color
MDBoxLayout:
orientation: "vertical"
MDLabel:
text: "How fast should be the processing to the new background:"
halign: "center"
font_size: "30sp"
MDLabel:
text: str(app.ctrl.background) if app.ctrl.background != "" else "no one"
halign: "center"
font_size: "30sp"
bold: True
MDBoxLayout:
padding: "15sp"
spacing: "15sp"
size_hint_y: None
height: self.minimum_height + sp(60)
AnchorLayout:
MDFlatButton:
text: "Default"
on_release: app.change()
font_size: "20sp"
AnchorLayout:
MDFlatButton:
text: "Choose a deadline"
on_release: app.show_date_picker()
disabled: True
font_size: "20sp"
AnchorLayout:
MDFlatButton:
text: "Go to advanced options"
on_release: app.change("advanced")
font_size: "20sp"
Menu
<Ready>
name: "ready"
md_bg_color: app.theme_cls.primary_color
MDLabel:
text: "Everything ready"
halign: "center"
font_size: "50sp"
bold: True
MDBoxLayout:
padding: "20sp"
spacing: "15sp"
MDBoxLayout:
orientation: "vertical"
adaptive_height: True
MDLabel:
text: "Folder:"
halign: "center"
AnchorLayout:
MDRaisedButton:
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: app.ctrl.output_dir if app.ctrl.output_dir != "" else "select one"
on_release: app.file_manager_open()
font_size: "20sp"
MDBoxLayout:
orientation: "vertical"
adaptive_height: True
MDLabel:
text: "File name and extension:"
halign: "center"
AnchorLayout:
MDTextField:
hint_text: app.ctrl.output_name + "." + app.ctrl.extension
on_text: app.ready_output(self)
mode: "rectangle"
color_mode: 'custom'
line_color_focus: 0, 0, 0, 1
line_color_normal: 0, 0, 0, 1
font_size: "20sp"
MDBoxLayout:
orientation: "vertical"
adaptive_height: True
MDLabel:
text: "Start!"
halign: "center"
AnchorLayout:
MDIconButton:
md_bg_color: app.theme_cls.accent_color
icon: "play"
on_release: app.ctrl.call(3)
Menu
<Advanced>
name: "advanced"
md_bg_color: app.theme_cls.primary_color
MDBoxLayout:
padding: "20sp"
spacing: "20sp"
MDBoxLayout:
orientation: "vertical"
AnchorLayout:
CenteredStackLayout:
spacing: "20sp"
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
adaptive_height: True
Title:
text: "video_codec"
AnchorLayout:
size_hint_x: None
width: video_codec_button.width
MDRaisedButton:
id: video_codec_button
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: app.ctrl.video_codec if app.ctrl.video_codec else "default"
on_release: root.video_codec_menu.open()
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
adaptive_height: True
Title:
text: "audio_codec"
AnchorLayout:
size_hint_x: None
width: audio_codec_button.width
MDRaisedButton:
id: audio_codec_button
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: app.ctrl.audio_codec if app.ctrl.audio_codec else "default"
on_release: root.audio_codec_menu.open()
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
adaptive_height: True
Title:
text: "compression"
AnchorLayout:
size_hint_x: None
width: compression_button.width
MDRaisedButton:
id: compression_button
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: app.ctrl.compression
on_release: root.compression_menu.open()
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
adaptive_height: True
Title:
text: "scaler"
AnchorLayout:
size_hint_x: None
width: scaler_button.width
MDRaisedButton:
id: scaler_button
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: app.ctrl.scaler
on_release: root.scaler_menu.open()
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
adaptive_height: True
Title:
text: "background"
AnchorLayout:
size_hint_x: None
width: background_button.width
MDRaisedButton:
id: background_button
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: str(app.ctrl.background) if app.ctrl.background != "" else "no one"
on_release: app.go_to = ["advanced"]
on_release: app.change("background")
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
adaptive_height: True
Title:
text: "mask"
AnchorLayout:
size_hint_x: None
width: mask_button.width
MDRaisedButton:
id: mask_button
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: app.ctrl.mask if app.ctrl.mask != "" else "A.I."
on_release: root.mask_menu.open()
MDBoxLayout:
adaptive_height: True
spacing: "20sp"
Title:
text: "relative_mask_resolution"
MDSlider:
min: 0
max: 100
value: app.ctrl.relative_mask_resolution
color: app.theme_cls.accent_color
on_value: app.ctrl.relative_mask_resolution = int(self.value)
MDBoxLayout:
adaptive_height: True
spacing: "20sp"
Title:
text: "relative_mask_fps"
MDSlider:
min: 0
max: 100
value: app.ctrl.relative_mask_fps
color: app.theme_cls.accent_color
on_value: app.ctrl.relative_mask_fps = int(self.value)
MDBoxLayout:
MDBoxLayout:
orientation: "vertical"
adaptive_width: True
MDLabel:
text: "monitor"
bold: True
halign: "center"
adaptive_height: True
MDBoxLayout:
Monitor:
MDLabel:
text: "No"
size_hint_x: None
width: self.text_size[0]
MDBoxLayout:
Monitor:
op: "gui"
MDLabel:
text: "Graphically"
size_hint_x: None
width: self.text_size[0]
MDBoxLayout:
Monitor:
op: "bar"
MDLabel:
text: "By progress bar"
size_hint_x: None
width: self.text_size[0]
MDBoxLayout:
spacing: "20sp"
orientation: "vertical"
MDLabel:
text: "cuda"
bold: True
halign: "center"
adaptive_height: True
AnchorLayout:
MDSwitch:
_thumb_color_disabled: app.theme_cls.accent_color
active: app.ctrl.cuda
on_active: app.ctrl.cuda = self.active
MDBoxLayout:
orientation: "vertical"
MDLabel:
id: threads_label
text: f"{app.ctrl.threads} threads"
bold: True
halign: "center"
adaptive_height: True
AnchorLayout:
MDBoxLayout:
adaptive_width: True
MDIconButton:
icon: "chevron-up-circle-outline"
pos_hint: {"center_x": .5, "center_y": .5}
user_font_size: "36sp"
on_release: root.threads_button(True)
MDIconButton:
icon: "chevron-down-circle-outline"
pos_hint: {"center_x": .5, "center_y": .5}
user_font_size: "36sp"
on_release: root.threads_button(False)
MDBoxLayout:
spacing: "20sp"
orientation: "vertical"
MDLabel:
text: "log"
bold: True
halign: "center"
adaptive_height: True
AnchorLayout:
MDSwitch:
_thumb_color_disabled: app.theme_cls.accent_color
active: app.ctrl.log
on_active: app.ctrl.log = self.active
MDBoxLayout:
orientation: "vertical"
size_hint_x: None
width: root.width / 3
AnchorLayout:
Image:
id: preview_image
source: root.frame_filename
MDSpinner:
id: preview_spinner
color: app.theme_cls.accent_color
size_hint: None, None
size: dp(46), dp(46)
active: False
MDLabel:
adaptive_height: True
text: "temporary preview image saved in " + root.frame_filename
halign: "center"
MDBoxLayout:
MDLabel:
text: "preview"
bold: True
halign: "center"
size_hint_x: None
width: self.text_size[0]
MDSlider:
id: preview_slider
min: 0
max: 100
value: app.ctrl.fake_get_frame
color: app.theme_cls.accent_color
on_value: app.ctrl.fake_get_frame = int(self.value)
MDIconButton:
icon: "reload"
pos_hint: {"center_x": .5, "center_y": .5}
user_font_size: "36sp"
on_release: root.update_preview_spinner(True)
MDBoxLayout:
orientation: "vertical"
adaptive_height: True
MDBoxLayout:
MDBoxLayout:
orientation: "vertical"
MDLabel:
text: "Estimated time:"
halign: "center"
MDLabel:
id: time_label
text: "00:00"
bold: True
halign: "center"
font_size: "40sp"
adaptive_height: True
MDIconButton:
icon: "reload"
pos_hint: {"center_x": 0, "center_y": .5}
user_font_size: "36sp"
on_release: root.update_time(0, "00:00")
MDProgressBar:
id: time_bar
value: 100
color: app.theme_cls.accent_color
AnchorLayout:
MDRaisedButton:
md_bg_color: app.theme_cls.accent_color
text_color: 0, 0, 0, 1
text: "Ready!"
on_release: app.change("ready")
Menu
<Monitor>:
group: 'monitor'
size_hint: None, None
size: dp(48), dp(48)
disabled_color: 0, 0, 0, 1
pos_hint: {'center_x': .5, 'center_y': .5}
on_active: root.monitor_radio()
active: True if self.op == app.ctrl.monitor else False
op: None
disabled: True if self.active else False
<Menu@AnchorLayout>
anchor_x: "left"
anchor_y: "top"
MDIconButton:
icon: "menu"
on_release: app.drawer.set_state()
user_font_size: "36sp"
<ItemDrawer>
on_release: app.change(self.to_screen)
IconLeftWidget:
icon: root.icon
on_release: app.change(self.to_screen)
<LeftMenu>
MDStackLayout:
orientation: "tb-lr"
MDList:
id: drawer_list
<CenteredStackLayout>
adaptive_height: True
size_hint_x: None
width: self.parent.width if self.parent.width < self.bigchild else self.bigchild
<Title@MDLabel>
bold: True
halign: "center"
size_hint_x: None
width: self.text_size[0]