-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathscreenalbum.py
7755 lines (7015 loc) · 309 KB
/
screenalbum.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
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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import sys
import PIL
from PIL import Image, ImageEnhance, ImageOps, ImageChops, ImageDraw, ImageFilter, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import os
from io import BytesIO
import datetime
from shutil import copy2, copystat
import subprocess
import time
from operator import itemgetter
from functools import partial
import multiprocessing
from configparser import ConfigParser
#all these are needed to get ffpyplayer working on linux
import ffpyplayer.threading
import ffpyplayer.player.queue
import ffpyplayer.player.frame_queue
import ffpyplayer.player.decoder
import ffpyplayer.player.clock
import ffpyplayer.player.core
from ffpyplayer.player import MediaPlayer
from ffpyplayer.pic import SWScale
from ffpyplayer import tools as fftools
import threading
from kivy.config import Config
Config.window_icon = "data/icon.png"
from kivy.app import App
from kivy.core.window import Window
from kivy.clock import Clock, mainthread
from kivy.animation import Animation
from kivy.graphics.transformation import Matrix
from kivy.uix.behaviors import ButtonBehavior, DragBehavior
from kivy.uix.screenmanager import Screen
from kivy.properties import AliasProperty, ObjectProperty, StringProperty, ListProperty, BooleanProperty, NumericProperty, DictProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.treeview import TreeViewNode
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager
from kivy.uix.image import Image as KivyImage
from kivy.core.image import Image as CoreImage
from kivy.uix.video import Video
from kivy.uix.videoplayer import VideoPlayer
from kivy.core.image.img_pil import ImageLoaderPIL
from kivy.loader import Loader
Loader.max_upload_per_frame = 16
Loader.num_workers = 2
from kivy.cache import Cache
Cache.register('kv.loader', limit=5)
from kivy.graphics import Rectangle, Color, Line
from resizablebehavior import ResizableBehavior
from colorpickercustom import ColorPickerCustom
from kivy.core.video import Video as KivyCoreVideo
from threading import Thread
from generalcommands import find_dictionary, get_keys_from_list, interpolate, agnostic_path, local_path, time_index, format_size, to_bool, isfile2, generate_curve
from filebrowser import FileBrowser
from generalelements import EncodingSettings, ExpandablePanel, ScrollerContainer, CustomImage, ImageEditor, NormalButton, ExpandableButton, ScanningPopup, NormalPopup, ConfirmPopup, LeftNormalLabel, NormalLabel, ShortLabel, NormalDropDown, AlbumSortDropDown, MenuButton, TreeViewButton, RemoveButton, WideButton, RecycleItem, PhotoRecycleViewButton, AlbumExportDropDown
from generalconstants import *
from kivy.lang.builder import Builder
Builder.load_string("""
#:import os os
#:import SlideTransition kivy.uix.screenmanager.SlideTransition
#:import platform kivy.platform
#:import time_index generalcommands.time_index
<AlbumScreen>:
canvas.before:
Color:
rgba: app.theme.background
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
orientation: 'vertical'
MainHeader:
NormalButton:
text: 'Back To Library'
on_release: root.back()
opacity: 0 if app.standalone else 1
disabled: True if app.standalone else False
ShortLabel:
text: app.standalone_text
HeaderLabel:
text: root.folder_title
InfoLabel:
DatabaseLabel:
InfoButton:
SettingsButton:
BoxLayout:
orientation: 'horizontal'
SplitterPanelLeft:
id: leftpanel
BoxLayout:
orientation: 'vertical'
size_hint_x: .25
Header:
size_hint_y: None
height: app.button_scale
ShortLabel:
text: 'Sort:'
MenuStarterButtonWide:
id: sortButton
text: root.sort_method
on_release: root.sort_dropdown.open(self)
ReverseToggle:
id: sortReverseButton
state: root.sort_reverse_button
on_release: root.resort_reverse(self.state)
PhotoListRecycleView:
size_hint: 1, 1
id: albumContainer
viewclass: 'PhotoRecycleViewButton'
scroll_distance: 10
scroll_timeout: 200
bar_width: int(app.button_scale * .5)
bar_color: app.theme.scroller_selected
bar_inactive_color: app.theme.scroller
scroll_type: ['bars', 'content']
SelectableRecycleBoxLayout:
id: album
default_size: self.width, (app.button_scale * 2)
BoxLayout:
size_hint_y: None
disabled: app.simple_interface
opacity: 0 if app.simple_interface else 1
height: 0 if app.simple_interface else app.button_scale
orientation: 'horizontal'
WideButton:
text: 'Previous'
on_press: root.previous_photo()
WideButton:
text: 'Next'
on_press: root.next_photo()
MainArea:
size_hint_x: .5
orientation: 'vertical'
RelativeLayout:
id: photoViewerContainer
Header:
height: app.button_scale if root.edit_panel == 'main' else 0
disabled: False if root.edit_panel == 'main' else True
opacity: 1 if root.edit_panel == 'main' else 0
id: buttonsFooter
NormalButton:
size_hint_y: 1
text: 'Full Screen'
on_press: root.fullscreen()
MenuStarterButton:
text: 'Export Album'
on_release: root.album_exports.open(self)
Label:
text: ''
NormalToggle:
size_hint_y: 1
text: ' Favorite '
id: favoriteButton
state: 'down' if root.favorite else 'normal'
on_press: root.set_favorite()
opacity: 0 if (app.standalone and not app.standalone_in_database) else 1
disabled: True if app.database_scanning or (app.standalone and not app.standalone_in_database) else False
NormalButton:
size_hint_y: 1
text: 'Share File' if (platform == 'android') else 'Open Folder'
disabled: True if (platform == 'android' and not root.view_image) else False
on_press: root.open_folder()
NormalButton:
size_hint_y: 1
width: self.texture_size[0] + 20 if root.canprint else 0
opacity: 1 if root.canprint else 0
disabled: not root.canprint
id: printButton
text: ' Print '
on_release: app.print_photo()
NormalButton:
size_hint_y: 1
id: deleteButton
warn: True
text: ' Delete '
on_release: root.delete_selected_confirm()
disabled: app.database_scanning
SplitterPanelRight:
id: rightpanel
width: 0
opacity: 0
PanelTabs:
tab: root.view_panel
BoxLayout:
tab: 'info'
opacity: 0
orientation: 'vertical'
pos: self.parent.pos
size: self.parent.size
padding: app.padding
Scroller:
NormalTreeView:
id: panelInfo
WideButton:
text: 'Refresh Photo Info'
on_release: root.full_photo_refresh()
BoxLayout:
tab: 'edit'
opacity: 0
pos: self.parent.pos
size: self.parent.size
padding: app.padding
GridLayout:
disabled: app.database_scanning
id: panelEdit
cols: 1
size_hint: 1, 1
BoxLayout:
tab: 'tags'
opacity: 0
pos: self.parent.pos
size: self.parent.size
padding: app.padding
Scroller:
size_hint: 1, 1
do_scroll_x: False
GridLayout:
disabled: app.database_scanning
size_hint: 1, None
cols: 1
height: self.minimum_height
GridLayout:
canvas.before:
Color:
rgba: app.theme.area_background
BorderImage:
pos: self.pos
size: self.size
source: 'data/buttonflat.png'
padding: app.padding
id: displayTags
cols: 1
size_hint: 1, None
height: self.minimum_height
NormalLabel:
id: albumLabel
text:"Current Tags:"
GridLayout:
id: panelDisplayTags
size_hint: 1, None
cols: 2
height: self.minimum_height
MediumBufferY:
GridLayout:
canvas.before:
Color:
rgba: app.theme.area_background
BorderImage:
pos: self.pos
size: self.size
source: 'data/buttonflat.png'
padding: app.padding
id: addToTags
cols: 1
size_hint: 1, None
height: self.minimum_height
NormalLabel:
id: albumLabel
text:"Add Tags:"
GridLayout:
id: panelTags
size_hint: 1, None
cols: 2
height: self.minimum_height
MediumBufferY:
BoxLayout:
canvas.before:
Color:
rgba: app.theme.area_background
BorderImage:
pos: self.pos
size: self.size
source: 'data/buttonflat.png'
padding: app.padding
orientation: 'vertical'
size_hint: 1, None
height: app.button_scale * 2 + app.padding * 2
NormalLabel:
text: "Create Tags:"
BoxLayout:
orientation: 'horizontal'
size_hint: 1, None
height: app.button_scale
NormalInput:
id: newTag
multiline: True
disable_lines: True
hint_text: 'Tag Name'
input_filter: app.test_tag
NormalButton:
disabled: not root.can_add_tag(newTag.text)
text: 'New'
on_release: root.add_tag()
size_hint_y: None
height: app.button_scale
StackLayout:
size_hint_x: None
width: app.button_scale
VerticalButton:
state: 'down' if root.view_panel == 'info' else 'normal'
vertical_text: "Photo Info"
on_press: root.show_info_panel()
VerticalButton:
state: 'down' if root.view_panel == 'edit' else 'normal'
vertical_text: "Editing"
on_press: root.show_edit_panel()
VerticalButton:
state: 'down' if root.view_panel == 'tags' else 'normal'
vertical_text: "Tags"
on_press: root.show_tags_panel()
disabled: True if (app.standalone and not app.standalone_in_database) else False
opacity: 0 if (app.standalone and not app.standalone_in_database) else 1
<VideoConverterScreen>:
canvas.before:
Color:
rgba: app.theme.background
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
orientation: 'vertical'
MainHeader:
NormalButton:
text: 'Back To Album' if not root.from_database else 'Back To Library'
on_release: root.back()
ShortLabel:
text: app.standalone_text
HeaderLabel:
text: "Editing "+root.target
InfoLabel:
DatabaseLabel:
InfoButton:
SettingsButton:
BoxLayout:
orientation: 'horizontal'
MainArea:
size_hint_x: .5
orientation: 'vertical'
Header:
NormalToggle:
text: ' Batch Conversion '
state: 'down' if root.use_batch else 'normal'
on_release: root.use_batch = not root.use_batch
NormalToggle:
text: ' Replace/Add Audio '
state: 'down' if root.use_audio else 'normal'
on_release: root.use_audio = not root.use_audio
disabled: root.use_batch
NormalToggle:
text: ' Use Custom Command '
state: 'down' if root.use_command else 'normal'
on_release: root.use_command = not root.use_command
NormalLabel:
NormalToggle:
text: ' Hide Log ' if root.show_log else ' Show Log '
state: 'down' if root.show_log else 'normal'
on_release: root.show_log = not root.show_log
NormalButton:
text: 'Browse Export Folder'
on_release: root.browse_export_folder()
disabled: root.export_folder == ''
#NormalButton:
# text: 'Test Conversion Settings'
NormalButton:
text: 'Convert Videos' if root.use_batch else 'Convert Video'
disabled: False if (root.photo or (root.use_batch and root.batch_list)) else True
on_release: root.save_edit()
ExpandablePanel:
expanded: not root.use_batch
Header:
ShortLabel:
text: "File: "
NormalInput:
disabled: True
text: root.photo
NormalButton:
text: 'Load Video...'
on_release: root.load_video_begin()
NormalButton:
text: 'Load Image Sequence...'
on_release: root.load_video_begin(image=True)
Header:
ShortLabel:
text: "Export To: "
NormalInput:
id: exportInput
hint_text: root.photo if not root.use_batch else ''
multiline: False
text: root.export_file
on_text: root.export_file = self.text
NormalButton:
text: 'Select File... '
on_release: root.browse_export_begin()
ExpandablePanel:
id: addAudioPanel
expanded: root.use_audio and not root.use_batch
disabled: True
Header:
ShortLabel:
text: "Replace Audio With: "
NormalInput:
id: audioInput
hint_text: "Path\\To\\Audio File.wav"
multiline: False
text: root.audio_file
on_text: root.audio_file = self.text
NormalButton:
text: 'Select File... '
on_release: root.load_audio_begin()
ExpandablePanel:
id: customCommandPanel
expanded: root.use_command
disabled: True
Header:
ShortLabel:
text: "Manual Command: ffmpeg.exe "
NormalInput:
id: commandInput
hint_text: '-sn %c %v %a %f %p %b %d'
multiline: False
text: app.encoding_settings.command_line
on_text: app.encoding_settings.command_line = self.text
BoxLayout:
orientation: 'horizontal'
ScreenManager:
transition: SlideTransition(direction='down', duration=app.animation_length)
current: root.photo_viewer_current
size_hint: 1, 1
Screen:
name: 'edit'
RelativeLayout:
size_hint: 1, 1
id: photoViewerContainer
Screen:
name: 'batch'
BoxLayout:
orientation: 'vertical'
Header:
size_hint_y: None
height: app.button_scale
WideButton:
text: 'Add Videos...'
on_release: root.add_batch()
WideButton:
text: 'Remove Selected'
on_release: root.remove_selected_batch()
disabled: not photos.selects
WideButton:
text: 'Remove Completed'
on_release: root.remove_completed_batch()
WideButton:
text: 'Clear All'
on_release: root.clear_batch()
disabled: not root.batch_list
PhotoListRecycleView:
canvas.before:
Color:
rgba: app.theme.sidebar_background
Rectangle:
size: self.size
pos: self.pos
source: 'data/panelbg.png'
scroll_distance: 10
scroll_timeout: 200
bar_width: int(app.button_scale * .5)
bar_color: app.theme.scroller_selected
bar_inactive_color: app.theme.scroller
scroll_type: ['bars', 'content']
data: root.batch_list
id: photosContainer
viewclass: 'BatchPhoto'
SelectableRecycleBoxLayout:
default_size: self.width, None
multiselect: True
id: photos
BoxLayout:
disabled: not root.show_log
opacity: 1 if root.show_log else 0
size_hint_x: .66 if root.show_log else 0
size_hint_y: 1
GridLayout:
cols: 1
size_hint_y: 1
id: extra
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: app.button_scale
LeftNormalLabel:
text: 'Conversion Log:'
NormalButton:
text: 'Clear Log'
on_release: root.clear_log()
NormalRecycleView:
id: logviewerscroller
size_hint: 1, 1
data: root.encode_log
viewclass: 'RecycleLabel'
RecycleBoxLayout:
default_size: None, app.text_scale
default_size_hint: 1, None
orientation: 'vertical'
size_hint_x: 1
size_hint_y: None
height: self.minimum_height
SplitterPanelRight:
id: rightpanel
width: app.right_panel_width()
PanelTabs:
size_hint_y: 1
tab: root.view_panel
BoxLayout:
tab: 'conversion'
opacity: 0
pos: self.parent.pos
size: self.parent.size
padding: app.padding
EditPanelVideo:
size_hint_y: 1
owner: root
advanced: True
name: 'video'
BoxLayout:
tab: 'info'
opacity: 0
orientation: 'vertical'
pos: self.parent.pos
size: self.parent.size
padding: app.padding
Scroller:
NormalTreeView:
id: panelInfo
WideButton:
text: 'Refresh Video Info'
on_release: root.refresh_photoinfo()
BoxLayout:
tab: 'edit'
opacity: 0
pos: self.parent.pos
size: self.parent.size
padding: app.padding
GridLayout:
id: panelEdit
cols: 1
size_hint: 1, 1
StackLayout:
size_hint_x: None
width: app.button_scale
VerticalButton:
state: 'down' if root.view_panel == 'conversion' else 'normal'
vertical_text: "Conversion"
on_press: root.show_conversion_panel()
VerticalButton:
state: 'down' if root.view_panel == 'info' else 'normal'
vertical_text: "Video Info"
on_press: root.show_info_panel()
disabled: root.use_batch
VerticalButton:
state: 'down' if root.view_panel == 'edit' else 'normal'
vertical_text: "Editing"
on_press: root.show_edit_panel()
disabled: not root.photo
<TreeViewInfo>:
color_selected: app.selected_color
odd_color: app.list_background_odd
even_color: app.list_background_even
size_hint_y: None
height: app.button_scale
orientation: 'horizontal'
LeftNormalLabel:
text: root.title
<VideoThumbnail>:
pos_hint: {'x': 0, 'y': 0}
image_overlay_play: 'atlas://data/images/defaulttheme/player-play-overlay'
image_loading: 'data/images/image-loading.gif'
AsyncThumbnail:
photoinfo: root.photoinfo
loadfullsize: False
fit_mode: 'contain'
mipmap: True
source: root.source
color: (.5, .5, .5, 1)
pos_hint: {'x': 0, 'y': 0}
Image:
source: root.image_overlay_play if not root.click_done else root.image_loading
pos_hint: {'x': 0, 'y': 0}
<PhotoViewer>:
orientation: 'vertical'
StencilViewTouch:
size_hint_y: 1
canvas.after:
Color:
rgba: app.theme.favorite if root.favorite else [0, 0, 0, 0]
Rectangle:
source: 'data/star.png'
pos: self.width - (self.width*.03), 0
size: (self.width*.03, self.width*.03)
id: photoStencil
LimitedScatterLayout:
bypass: root.bypass
id: wrapper
size: photoStencil.size
size_hint: None, None
scale_min: 1
scale_max: root.scale_max
do_rotation: False
PhotoShow:
bypass: root.bypass
id: photoShow
pos: photoStencil.pos
size_hint: 1, 1
AsyncThumbnail:
canvas.before:
PushMatrix
Scale:
x: 1 if (root.angle == 0 or root.angle == 180) or self.width == 0 else ((self.height/self.width) if (self.height/self.width) > .75 else .75)
y: 1 if (root.angle == 0 or root.angle == 180) or self.width == 0 else ((self.height/self.width) if (self.height/self.width) > .75 else .75)
origin: photoStencil.center
canvas.after:
PopMatrix
photoinfo: root.photoinfo
loadanyway: True
loadfullsize: True
source: root.file
mirror: root.mirror
fit_mode: 'contain'
id: image
mipmap: True
BoxLayout:
opacity: 0 if root.fullscreen or app.simple_interface or root.edit_mode != 'main' else 1
disabled: True if root.fullscreen or (root.edit_mode != 'main') or app.simple_interface else False
orientation: 'horizontal'
size_hint_y: None
height: 0 if root.fullscreen or app.simple_interface or root.edit_mode != 'main' else app.button_scale
Label:
size_hint_x: .25
ShortLabel:
size_hint_y: None
height: app.button_scale
text: "Zoom:"
NormalSlider:
size_hint_y: None
height: app.button_scale
id: zoomSlider
min: 0
max: 1
value: root.zoom
on_value: root.zoom = self.value
reset_value: root.reset_zoom
Label:
size_hint_x: .25
<-SpecialVideoPlayer>:
container: container
cols: 1
FloatLayout:
cols: 1
id: container
GridLayout:
rows: 1
size_hint_y: None
height: app.button_scale
VideoPlayerStop:
size_hint_x: None
video: root
width: '44dp'
source: root.image_stop
fit_mode: "contain"
VideoPlayerPlayPause:
size_hint_x: None
video: root
width: '44dp'
source: root.image_pause if root.state == 'play' else root.image_play
fit_mode: "contain"
VideoPlayerVolume:
video: root
size_hint_x: None
width: '44dp'
source: root.image_volumehigh if root.volume > 0.8 else (root.image_volumemedium if root.volume > 0.4 else (root.image_volumelow if root.volume > 0 else root.image_volumemuted))
fit_mode: "contain"
Widget:
size_hint_x: None
width: 5
VideoPlayerProgressBar:
video: root
max: max(root.duration, root.position, 1)
value: root.position
Widget:
size_hint_x: None
width: 10
ShortLabel:
text: time_index(root.position, 2)+'/'+time_index(root.duration, 2)
<VideoViewer>:
SpecialVideoPlayer:
canvas.after:
Color:
rgba: app.theme.favorite if root.favorite else [0, 0, 0, 0]
Rectangle:
source: 'data/star.png'
pos: self.width - (self.width*.03), 44
size: (self.width*.03, self.width*.03)
disabled: True if self.opacity == 0 else False
pos: root.pos
size: root.size
id: player
favorite: root.favorite
photoinfo: root.photoinfo
source: root.file
options: {'fit_mode': 'contain'}
BoxLayout:
orientation: 'vertical'
opacity: 0
id: overlay
pos: root.pos
size: root.size
RelativeLayout:
id: photoShow
height: root.height - 44 - app.button_scale
width: root.width
size_hint: None, None
BoxLayout:
size_hint: None, None
height: app.button_scale
orientation: 'horizontal'
width: root.width
NormalButton:
text: 'Set Start Point'
on_release: root.set_start_point()
NormalButton:
text: 'Clear Start Point'
warn: True
on_release: root.reset_start_point()
Label:
size_hint_x: 1
NormalButton:
text: 'Clear End Point'
warn: True
on_release: root.reset_end_point()
NormalButton:
text: 'Set End Point'
on_release: root.set_end_point()
FloatLayout:
width: root.width
size_hint: None, None
height: app.button_scale
HalfSliderLimited:
size_hint: 1, 1
pos: self.parent.pos
disabled: True if self.parent.opacity == 0 else False
value: root.position
start: root.start_point
end: root.end_point
on_value: root.position = self.value
ShortLabel:
text: root.position_time_index
pos: (self.parent.pos[0] + (self.parent.width * root.position - (self.width * root.position)), self.parent.pos[1])
<ExitFullscreenButton>:
text: 'Back'
<EditPanelConvert>:
orientation: 'vertical'
GridLayout:
size_hint: 1, None
cols: 1
height: self.minimum_height
WideButton:
text: "Clear All Edits"
on_release: root.reset_all()
BoxLayout:
canvas.before:
Color:
rgba:0,0,0,1
Rectangle:
size: self.size
pos: self.pos
size_hint_y: None
height: self.width * .5
Image:
id: histogram
fit_mode: 'fill'
opacity: 0
SmallBufferY:
ScreenManager:
id: sm
<EditPanel>:
orientation: 'vertical'
GridLayout:
size_hint: 1, None
cols: 1
height: self.minimum_height
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: app.button_scale
WideButton:
text: 'Confirm Edit'
on_release: root.confirm_edit()
WideButton:
text: 'Cancel Edit'
warn: True
on_release: root.cancel_edit()
WideButton:
disabled: not root.owner.view_image
size_hint_y: 0.01 if self.disabled else None
opacity: 0 if self.disabled else 1
text: 'Save Edit To New File'
on_release: root.confirm_edit_new()
WideButton:
id: loadLast
disabled: not root.owner.edit_color
text: "Load Last Settings"
on_release: root.load_last()
BoxLayout:
canvas.before:
Color:
rgba:0,0,0,1
Rectangle:
size: self.size
pos: self.pos
size_hint_y: None
height: self.width * .5
Image:
id: histogram
fit_mode: 'fill'
opacity: 0
SmallBufferY:
ScreenManager:
id: sm
<EditPanelConversionBase>:
name: 'edit'
ScrollerContainer:
cols: 1
do_scroll_x: False
GridLayout:
size_hint: 1, None
cols: 1
height: self.minimum_height
WideButton:
text: 'Color Adjustments'
on_release: root.owner.set_screen('color')
SmallBufferY:
WideButton:
text: 'Filters'
on_release: root.owner.set_screen('filter')
SmallBufferY:
WideButton:
text: 'Image Borders'
on_release: root.owner.set_screen('border')
SmallBufferY:
WideButton:
height: app.button_scale if app.opencv else 0
opacity: 1 if app.opencv else 0
text: 'Denoise'
on_release: root.owner.set_screen('denoise')
disabled: not app.opencv
SmallBufferY:
height: int(app.button_scale / 4) if app.opencv else 0
WideButton:
text: 'Rotate'
on_release: root.owner.set_screen('rotate')
SmallBufferY:
WideButton:
text: 'Crop'
on_release: root.owner.set_screen('crop')
<EditPanelAlbumBase>:
name: 'edit'
ScrollerContainer:
cols: 1
do_scroll_x: False
GridLayout:
size_hint: 1, None
cols: 1
height: self.minimum_height
padding: 0, 0, int(app.button_scale / 2), 0
WideButton:
text: 'Advanced Video Editing'
on_release: app.show_video_converter()
disabled: root.owner.owner.view_image or not app.ffmpeg
opacity: 0 if self.disabled else 1
height: 0 if self.disabled else app.button_scale
SmallBufferY:
height: 0 if (root.owner.owner.view_image or not app.ffmpeg) else (app.button_scale / 4)
WideButton:
text: 'Video Convert Settings'
on_release: root.owner.set_screen('video')
disabled: root.owner.owner.view_image or not app.ffmpeg
height: 0 if (root.owner.owner.view_image or not app.ffmpeg) else app.button_scale
opacity: 0 if (root.owner.owner.view_image or not app.ffmpeg) else 1
SmallBufferY:
WideButton:
text: 'Color Adjustments'
on_release: root.owner.set_screen('color')
disabled: not root.owner.owner.view_image and not app.ffmpeg
SmallBufferY:
WideButton:
text: 'Filters'
on_release: root.owner.set_screen('filter')
disabled: not root.owner.owner.view_image and not app.ffmpeg
SmallBufferY:
WideButton:
text: 'Image Borders'
on_release: root.owner.set_screen('border')
disabled: not root.owner.owner.view_image and not app.ffmpeg
SmallBufferY:
WideButton:
height: app.button_scale if app.opencv else 0
opacity: 1 if app.opencv else 0
text: 'Denoise'
on_release: root.owner.set_screen('denoise')
disabled: (not root.owner.owner.view_image and not app.ffmpeg) or not app.opencv
SmallBufferY:
height: int(app.button_scale / 4) if app.opencv else 0
WideButton:
text: 'Rotate'
on_release: root.owner.set_screen('rotate')
disabled: not root.owner.owner.view_image and not app.ffmpeg
SmallBufferY:
WideButton:
text: 'Crop'
on_release: root.owner.set_screen('crop')
disabled: not root.owner.owner.view_image and not app.ffmpeg
MediumBufferY:
WideButton:
id: deleteOriginal
text: 'Delete Unedited Original File'
disabled: True
warn: True
on_release: root.owner.owner.delete_original()
SmallBufferY:
WideButton:
id: deleteOriginalAll
disabled: True
text: 'Delete All Originals In Folder'
warn: True
on_release: root.owner.owner.delete_original_all()
SmallBufferY:
WideButton:
id: undoEdits
disabled: True
text: 'Restore Original Unedited File'
on_release: root.owner.owner.restore_original()
MediumBufferY:
GridLayout:
cols: 2
disabled: True if platform == 'android' else False
size_hint_y: None
height: 0 if self.disabled else app.button_scale
opacity: 0 if self.disabled else 1
LeftNormalLabel:
size_hint_x: 1
text: 'External Programs:'
NormalButton:
size_hint_x: None
text: 'New'
on_release: root.add_program()
GridLayout:
id: externalPrograms
height: self.minimum_height
size_hint_y: None
cols: 1
<EditPanelColor>:
name: 'color'
BoxLayout:
orientation: 'vertical'
WideButton:
text: 'More Editing'
on_release: root.owner.set_screen('edit')
SmallBufferY:
ScrollerContainer:
cols: 1
do_scroll_x: False
GridLayout:
padding: 0, 0, int(app.button_scale / 2), 0
size_hint: 1, None
cols: 1
height: self.minimum_height
BoxLayout:
orientation: 'horizontal'
size_hint_y: None