diff options
| author | Brianna | 2017-06-23 07:18:46 -0400 |
|---|---|---|
| committer | GitHub | 2017-06-23 07:18:46 -0400 |
| commit | 5607bff61faacb4decd641275fbf17f2e08413ad (patch) | |
| tree | d8294bae70979f1134410f7794ca74a395f125ab /components/video.py | |
| parent | 8c9914850e9987d4f05e8b88dedb058ffbb4f53f (diff) | |
| parent | 7d4fb7843849f8a90de13c1a1cb93ca9428fd3b1 (diff) | |
Merge pull request #32 from djfun/newgui-commandline
making commandline features from master work with the new component system
Diffstat (limited to 'components/video.py')
| -rw-r--r-- | components/video.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/components/video.py b/components/video.py index 3d43a18..1d250bd 100644 --- a/components/video.py +++ b/components/video.py @@ -221,6 +221,23 @@ class Component(__base__.Component): width, height = scale(self.scale, width, height, int) self.chunkSize = 4*width*height + def command(self, arg): + if not arg.startswith('preset=') and '=' in arg: + key, arg = arg.split('=', 1) + if key == 'path' and os.path.exists(arg): + if os.path.splitext(arg)[1] in self.core.videoFormats: + self.page.lineEdit_video.setText(arg) + self.page.spinBox_scale.setValue(100) + self.page.checkBox_loop.setChecked(True) + return + else: + print("Not a supported video format") + quit(1) + super().command(arg) + + def commandHelp(self): + print('Load a video:\n path=/filepath/to/video.mp4') + def scale(scale, width, height, returntype=None): width = (float(width) / 100.0) * float(scale) height = (float(height) / 100.0) * float(scale) |
