diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/component.py | 5 | ||||
| -rw-r--r-- | src/components/sound.py | 3 | ||||
| -rw-r--r-- | src/components/video.py | 14 | ||||
| -rw-r--r-- | src/mainwindow.py | 2 | ||||
| -rw-r--r-- | src/video_thread.py | 2 |
5 files changed, 14 insertions, 12 deletions
diff --git a/src/component.py b/src/component.py index 1c5ccb3..03023e7 100644 --- a/src/component.py +++ b/src/component.py @@ -33,7 +33,7 @@ class ComponentMetaclass(type(QtCore.QObject)): return func(self, *args, **kwargs) except Exception as e: try: - if e.__name__.startswith('Component'): + if e.__class__.__name__.startswith('Component'): raise else: raise ComponentError(self, 'renderer') @@ -213,7 +213,7 @@ class Component(QtCore.QObject, metaclass=ComponentMetaclass): image = BlankFrame(self.width, self.height) return image - def renderFinished(self): + def postFrameRender(self): pass # =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~==~=~=~=~=~=~=~=~=~=~=~=~=~=~ @@ -456,4 +456,5 @@ class ComponentError(RuntimeError): ) super().__init__(string) + caller.lockError(string) caller._error.emit(string, detail) diff --git a/src/components/sound.py b/src/components/sound.py index aff43d3..26ecf93 100644 --- a/src/components/sound.py +++ b/src/components/sound.py @@ -21,9 +21,6 @@ class Component(Component): 'sound': None, }) - def preFrameRender(self, **kwargs): - pass - def properties(self): props = ['static', 'audio'] if not os.path.exists(self.sound): diff --git a/src/components/video.py b/src/components/video.py index 48ac557..b2487c1 100644 --- a/src/components/video.py +++ b/src/components/video.py @@ -59,7 +59,7 @@ class Video: self.thread = threading.Thread( target=self.fillBuffer, - name=self.__doc__ + name='Video Frame-Fetcher' ) self.thread.daemon = True self.thread.start() @@ -150,6 +150,10 @@ class Component(Component): def properties(self): props = [] + if hasattr(self.parent, 'window'): + outputFile = self.parent.window.lineEdit_outputFile.text() + else: + outputFile = str(self.parent.args.output) if not self.videoPath: self.lockError("There is no video selected.") @@ -157,9 +161,7 @@ class Component(Component): self.lockError("Could not identify an audio stream in this video.") elif not os.path.exists(self.videoPath): self.lockError("The video selected does not exist!") - elif (os.path.realpath(self.videoPath) == - os.path.realpath( - self.parent.window.lineEdit_outputFile.text())): + elif os.path.realpath(self.videoPath) == os.path.realpath(outputFile): self.lockError("Input and output paths match.") if self.useAudio: @@ -193,7 +195,7 @@ class Component(Component): raise Video.threadError return self.video.frame(frameNo) - def renderFinished(self): + def postFrameRender(self): self.video.pipe.stdout.close() self.video.pipe.send_signal(signal.SIGINT) @@ -238,6 +240,8 @@ class Component(Component): def updateChunksize(self): if self.scale != 100 and not self.distort: width, height = scale(self.scale, self.width, self.height, int) + else: + width, height = self.width, self.height self.chunkSize = 4 * width * height def command(self, arg): diff --git a/src/mainwindow.py b/src/mainwindow.py index e478d19..070131c 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -54,7 +54,7 @@ class PreviewWindow(QtWidgets.QLabel): def threadError(self, msg): self.parent.showMessage( msg=msg, - icon='Warning', + icon='Critical', parent=self ) diff --git a/src/video_thread.py b/src/video_thread.py index 8c7d585..32e8a38 100644 --- a/src/video_thread.py +++ b/src/video_thread.py @@ -292,7 +292,7 @@ class Worker(QtCore.QObject): self.out_pipe.wait() for comp in reversed(self.components): - comp.renderFinished() + comp.postFrameRender() if self.canceled: print("Export Canceled") |
