diff options
| author | tassaron | 2017-08-14 14:28:30 -0400 |
|---|---|---|
| committer | tassaron | 2017-08-14 14:28:30 -0400 |
| commit | ea1a422cc52bc972574070fbe784a35876ff8baa (patch) | |
| tree | 40cbe0eef0ef622a7a5002dda993b4c6f418c6aa /src/components/waveform.py | |
| parent | bed07479f1b4bf24a0b9c84217d41ebbe880a8fb (diff) | |
better aevalsrc inputs for spectrum previews
Diffstat (limited to 'src/components/waveform.py')
| -rw-r--r-- | src/components/waveform.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/components/waveform.py b/src/components/waveform.py index 1517be2..0743e55 100644 --- a/src/components/waveform.py +++ b/src/components/waveform.py @@ -140,13 +140,16 @@ class Component(Component): opacity = "{0:.1f}".format(self.opacity / 100) genericPreview = self.settings.value("pref_genericPreview") if self.mode < 3: - filter_ = 'showwaves=r=%s:s=%sx%s:mode=%s:colors=%s@%s:scale=%s' % ( - self.settings.value("outputFrameRate"), - self.settings.value("outputWidth"), - self.settings.value("outputHeight"), - self.page.comboBox_mode.currentText().lower() - if self.mode != 3 else 'p2p', - hexcolor, opacity, amplitude, + filter_ = ( + 'showwaves=' + 'r=%s:s=%sx%s:mode=%s:colors=%s@%s:scale=%s' % ( + self.settings.value("outputFrameRate"), + self.settings.value("outputWidth"), + self.settings.value("outputHeight"), + self.page.comboBox_mode.currentText().lower() + if self.mode != 3 else 'p2p', + hexcolor, opacity, amplitude, + ) ) elif self.mode > 2: filter_ = ( @@ -160,18 +163,20 @@ class Component(Component): ) ) + baselineHeight = int(self.height * (4 / 1080)) return [ '-filter_complex', '%s%s%s' '%s%s%s [v1]; ' '[v1] scale=%s:%s%s [v]' % ( - exampleSound() if preview and genericPreview else '[0:a] ', + exampleSound('wave', extra='') + if preview and genericPreview else '[0:a] ', 'compand=gain=4,' if self.compress else '', 'aformat=channel_layouts=mono,' if self.mono and self.mode < 3 else '', filter_, - ', drawbox=x=(iw-w)/2:y=(ih-h)/2:w=iw:h=4:color=%s@%s' % ( - hexcolor, opacity + ', drawbox=x=(iw-w)/2:y=(ih-h)/2:w=iw:h=%s:color=%s@%s' % ( + baselineHeight, hexcolor, opacity, ) if self.mode < 2 else '', ', hflip' if self.mirror else'', w, h, |
