aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortassaron2022-05-02 20:16:47 -0400
committertassaron2022-05-02 20:16:47 -0400
commit7f97e8f155c4a51517670c0dc7574f88afeffe6c (patch)
treea0a672ead97d3cf6ac9fecba18c522b12531fd92
parent8293328d66a27245e1c90e19b1fbc004ee8ef033 (diff)
add commandline option to disable preview during export
the weird use of type() is to avoid restructuring the code at this time. I will refactor this in a different pull request
-rw-r--r--src/command.py9
-rw-r--r--src/core.py1
-rw-r--r--src/video_thread.py3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/command.py b/src/command.py
index bf7941a..6d76906 100644
--- a/src/command.py
+++ b/src/command.py
@@ -58,12 +58,16 @@ class Command(QtCore.QObject):
)
self.parser.add_argument(
'--test', action='store_true',
- help='run tests, generate logfiles, then exit'
+ help='run tests and create a report full of debugging info'
)
self.parser.add_argument(
'--debug', action='store_true',
help='create bigger logfiles while program is running'
)
+ self.parser.add_argument(
+ '--no-preview', action='store_true',
+ help='disable live preview during export in GUI mode'
+ )
# optional arguments
self.parser.add_argument(
@@ -140,6 +144,9 @@ class Command(QtCore.QObject):
self.createAudioVisualisation(self.args.input, self.args.output)
return "commandline"
+ elif self.args.no_preview:
+ core.Core.previewEnabled = False
+
elif 'help' not in sys.argv and self.args.projpath is None and '--debug' not in sys.argv:
self.parser.print_help()
quit(1)
diff --git a/src/core.py b/src/core.py
index 77b0894..1ad4a67 100644
--- a/src/core.py
+++ b/src/core.py
@@ -487,6 +487,7 @@ class Core:
],
'logDir': os.path.join(dataDir, 'log'),
'logEnabled': False,
+ 'previewEnabled': True,
}
settings['videoFormats'] = toolkit.appendUppercase([
diff --git a/src/video_thread.py b/src/video_thread.py
index 0895547..27379ef 100644
--- a/src/video_thread.py
+++ b/src/video_thread.py
@@ -44,6 +44,7 @@ class Worker(QtCore.QObject):
self.settings = parent.settings
self.modules = parent.core.modules
parent.createVideo.connect(self.createVideo)
+ self.previewEnabled = type(parent.core).previewEnabled
#self.parent = parent
self.components = components
@@ -327,7 +328,7 @@ class Worker(QtCore.QObject):
break
# Update live preview
- if time.time() - self.lastPreview > 0.5:
+ if self.previewEnabled and time.time() - self.lastPreview > 0.5:
self.showPreview(frameBuffer[audioI])
try: