diff options
-rw-r--r-- | voctocore/default-config.ini | 3 | ||||
-rw-r--r-- | voctocore/lib/videomix.py | 27 |
2 files changed, 22 insertions, 8 deletions
diff --git a/voctocore/default-config.ini b/voctocore/default-config.ini index adf8bdd..d5d89fa 100644 --- a/voctocore/default-config.ini +++ b/voctocore/default-config.ini @@ -31,7 +31,8 @@ mix_out=10000 [side-by-side-equal] ; defaults to 1% of the video width ;gutter=12 -;ypos=200 +;atop=50 +;btop=200 ; if configured, switching to the sbs-equal mode will automatically select these ; sources. if not configured, it will not change the last set sources diff --git a/voctocore/lib/videomix.py b/voctocore/lib/videomix.py index 2fa9200..aa2bedc 100644 --- a/voctocore/lib/videomix.py +++ b/voctocore/lib/videomix.py @@ -150,30 +150,43 @@ class VideoMix(object): targetWidth = int((width - gutter) / 2) targetHeight = int(targetWidth / width * height) - try: - y = Config.getint('side-by-side-equal', 'ypos') - self.log.debug('Y-Pos configured to %u', y) - except: - y = (height - targetHeight) / 2 - self.log.debug('Y-Pos calculated to %u', y) + self.log.debug('Video-Size calculated to %ux%u', targetWidth, targetHeight) xa = 0 xb = width - targetWidth + y = (height - targetHeight) / 2 + + try: + ya = Config.getint('side-by-side-equal', 'atop') + self.log.debug('A-Video Y-Pos configured to %u', ya) + except: + ya = y + self.log.debug('A-Video Y-Pos calculated to %u', ya) + + + try: + yb = Config.getint('side-by-side-equal', 'btop') + self.log.debug('B-Video Y-Pos configured to %u', yb) + except: + yb = y + self.log.debug('B-Video Y-Pos calculated to %u', yb) + for idx, name in enumerate(self.names): pad = self.padState[idx] pad.reset() - pad.ypos = y pad.width = targetWidth pad.height = targetHeight if idx == self.sourceA: pad.xpos = xa + pad.ypos = ya pad.zorder = 1 elif idx == self.sourceB: pad.xpos = xb + pad.ypos = yb pad.zorder = 2 else: |