aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/__init__.py1
-rw-r--r--components/original.py113
-rw-r--r--components/original.ui92
-rw-r--r--components/text.py59
-rw-r--r--components/text.ui329
-rw-r--r--core.py107
-rw-r--r--main.py104
-rw-r--r--main.ui564
-rw-r--r--mainwindow.ui1106
-rw-r--r--preview_thread.py42
-rw-r--r--video_thread.py82
11 files changed, 1100 insertions, 1499 deletions
diff --git a/components/__init__.py b/components/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/components/__init__.py
@@ -0,0 +1 @@
+
diff --git a/components/original.py b/components/original.py
new file mode 100644
index 0000000..d1caa7b
--- /dev/null
+++ b/components/original.py
@@ -0,0 +1,113 @@
+''' Original Audio Visualization '''
+import numpy
+from PIL import Image, ImageDraw
+from PyQt4 import uic
+import os, random
+
+
+class Component:
+ def widget(self,parent):
+ self.parent = parent
+
+ page = uic.loadUi(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'original.ui'))
+ page.comboBox_visLayout.addItem("Classic")
+ page.comboBox_visLayout.addItem("Split")
+ page.comboBox_visLayout.addItem("Bottom")
+ #visLayoutValue = int(self.settings.value('visLayout'))
+ page.comboBox_visLayout.setCurrentIndex(0)
+ page.comboBox_visLayout.currentIndexChanged.connect(self.update)
+
+ return page
+ def update(self):
+ self.layout = self.page.comboBox_visLayout.currentIndex()
+ print(self.layout)
+ self.parent.drawPreview()
+
+ def previewRender(self, previewWorker, widget):
+ spectrum = numpy.fromfunction(lambda x: 0.008*(x-128)**2, (255,), dtype="int16")
+ width = int(previewWorker.core.settings.value('outputWidth'))
+ height = int(previewWorker.core.settings.value('outputHeight'))
+ return drawBars(width, height, spectrum, (255, 255, 255), self.layout)
+
+ def preFrameRender(self, **kwargs):
+ for kwarg, value in kwargs.items():
+ exec('self.%s = value' % kwarg)
+ self.smoothConstantDown = 0.08
+ self.smoothConstantUp = 0.8
+ self.lastSpectrum = None
+
+ def frameRender(self, moduleNo, frameNo):
+ self.lastSpectrum = transformData(frameNo, self.completeAudioArray, self.sampleSize,
+ self.smoothConstantDown, self.smoothConstantUp, self.lastSpectrum)
+ width = int(self.worker.core.settings.value('outputWidth'))
+ height = int(self.worker.core.settings.value('outputHeight'))
+ return drawBars(width, height, self.lastSpectrum, (255,255,255), self.layout)
+
+def transformData(i, completeAudioArray, sampleSize, smoothConstantDown, smoothConstantUp, lastSpectrum):
+ if len(completeAudioArray) < (i + sampleSize):
+ sampleSize = len(completeAudioArray) - i
+ numpy.seterr(divide='ignore')
+ window = numpy.hanning(sampleSize)
+ data = completeAudioArray[i:i+sampleSize][::1] * window
+ paddedSampleSize = 2048
+ paddedData = numpy.pad(data, (0, paddedSampleSize - sampleSize), 'constant')
+ spectrum = numpy.fft.fft(paddedData)
+ sample_rate = 44100
+ frequencies = numpy.fft.fftfreq(len(spectrum), 1./sample_rate)
+
+ y = abs(spectrum[0:int(paddedSampleSize/2) - 1])
+
+ # filter the noise away
+ # y[y<80] = 0
+
+ y = 20 * numpy.log10(y)
+ y[numpy.isinf(y)] = 0
+
+ if lastSpectrum is not None:
+ lastSpectrum[y < lastSpectrum] = y[y < lastSpectrum] * smoothConstantDown + lastSpectrum[y < lastSpectrum] * (1 - smoothConstantDown)
+ lastSpectrum[y >= lastSpectrum] = y[y >= lastSpectrum] * smoothConstantUp + lastSpectrum[y >= lastSpectrum] * (1 - smoothConstantUp)
+ else:
+ lastSpectrum = y
+
+ x = frequencies[0:int(paddedSampleSize/2) - 1]
+
+ return lastSpectrum
+
+def drawBars(width, height, spectrum, color, layout):
+ vH = height-height/8
+ bF = width / 64
+ bH = bF / 2
+ bQ = bF / 4
+ imTop = Image.new("RGBA", (width, height),(0,0,0,0))
+ draw = ImageDraw.Draw(imTop)
+ r, g, b = color
+ color2 = (r, g, b, 125)
+
+ bP = height / 1200
+
+ for j in range(0, 63):
+ draw.rectangle((bH + j * bF, vH+bQ, bH + j * bF + bF, vH + bQ - spectrum[j * 4] * bP - bH), fill=color2)
+ draw.rectangle((bH + bQ + j * bF, vH , bH + bQ + j * bF + bH, vH - spectrum[j * 4] * bP), fill=color)
+
+
+ imBottom = imTop.transpose(Image.FLIP_TOP_BOTTOM)
+
+ im = Image.new("RGBA", (width, height),(0,0,0,0))
+
+ if layout == 0:
+ y = 0 - int(height/100*43)
+ im.paste(imTop, (0, y), mask=imTop)
+ y = 0 + int(height/100*43)
+ im.paste(imBottom, (0, y), mask=imBottom)
+
+ if layout == 1:
+ y = 0 + int(height/100*10)
+ im.paste(imTop, (0, y), mask=imTop)
+ y = 0 - int(height/100*10)
+ im.paste(imBottom, (0, y), mask=imBottom)
+
+ if layout == 2:
+ y = 0 + int(height/100*10)
+ im.paste(imTop, (0, y), mask=imTop)
+
+ return im
diff --git a/components/original.ui b/components/original.ui
new file mode 100644
index 0000000..0e6dd98
--- /dev/null
+++ b/components/original.ui
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>584</width>
+ <height>169</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>567</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_9">
+ <item>
+ <widget class="QLabel" name="label_visLayout">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Visualizer Layout</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBox_visLayout"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>5</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_visColor">
+ <property name="text">
+ <string>Visualizer Color</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_visColor">
+ <property name="maximumSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="MaximumSize" stdset="0">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_visColor"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/components/text.py b/components/text.py
new file mode 100644
index 0000000..68b02fe
--- /dev/null
+++ b/components/text.py
@@ -0,0 +1,59 @@
+''' Title Text '''
+import numpy
+from PIL import Image, ImageDraw
+from PyQt4 import uic
+import os
+
+
+class Component:
+ def widget(self,parent):
+ page = uic.loadUi(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'text.ui'))
+ return page
+ def previewRender(self, previewWorker, widget):
+ width = int(previewWorker.core.settings.value('outputWidth'))
+ height = int(previewWorker.core.settings.value('outputHeight'))
+ im = Image.new("RGBA", (width, height),(0,0,0,0))
+
+ return im
+
+ def preFrameRender(self, **kwargs):
+ pass
+ def frameRender(self, moduleNo, frameNo):
+ width = int(previewWorker.core.settings.value('outputWidth'))
+ height = int(previewWorker.core.settings.value('outputHeight'))
+ im = Image.new("RGBA", (width, height),(0,0,0,0))
+
+ return im
+
+ '''
+ self._image = ImageQt(im)
+
+ self._image1 = QtGui.QImage(self._image)
+ painter = QPainter(self._image1)
+ font = titleFont
+ font.setPixelSize(fontSize)
+ painter.setFont(font)
+ painter.setPen(QColor(*textColor))
+
+ yPosition = yOffset
+
+ fm = QtGui.QFontMetrics(font)
+ if alignment == 0: #Left
+ xPosition = xOffset
+ if alignment == 1: #Middle
+ xPosition = xOffset - fm.width(titleText)/2
+ if alignment == 2: #Right
+ xPosition = xOffset - fm.width(titleText)
+ painter.drawText(xPosition, yPosition, titleText)
+ painter.end()
+
+ buffer = QtCore.QBuffer()
+ buffer.open(QtCore.QIODevice.ReadWrite)
+ self._image1.save(buffer, "PNG")
+
+ strio = io.BytesIO()
+ strio.write(buffer.data())
+ buffer.close()
+ strio.seek(0)
+ return Image.open(strio)
+ '''
diff --git a/components/text.ui b/components/text.ui
new file mode 100644
index 0000000..4431278
--- /dev/null
+++ b/components/text.ui
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>584</width>
+ <height>169</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>567</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_title">
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_title">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Testing New GUI</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>5</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_xTitleAlign">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBox_xTextAlign">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>999999999</number>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>5</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_yTitleAlign">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBox_yTextAlign">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="maximum">
+ <number>999999999</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>51</y>
+ <width>567</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Font</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFontComboBox" name="fontComboBox_titleFont">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>5</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_fontSize">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Font Size</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBox_fontSize">
+ <property name="maximum">
+ <number>500</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>86</y>
+ <width>567</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_12">
+ <item>
+ <widget class="QLabel" name="label_textLayout">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Text Layout</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBox_textAlign"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>5</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_textColor">
+ <property name="text">
+ <string>Text Color</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_textColor">
+ <property name="maximumSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="MaximumSize" stdset="0">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_textColor"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>121</y>
+ <width>567</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_9"/>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/core.py b/core.py
index 8292f5b..c8bfbca 100644
--- a/core.py
+++ b/core.py
@@ -42,8 +42,7 @@ class Core():
else:
return self.getVideoFrames(backgroundImage, preview)
- def drawBaseImage(self, backgroundFile, titleText, titleFont, fontSize, alignment,\
- xOffset, yOffset, textColor, visColor):
+ def drawBaseImage(self, backgroundFile):
if backgroundFile == '':
im = Image.new("RGB", (int(self.settings.value('outputWidth')), int(self.settings.value('outputHeight'))), "black")
else:
@@ -51,81 +50,10 @@ class Core():
if self._image == None or not self.lastBackgroundImage == backgroundFile:
self.lastBackgroundImage = backgroundFile
-
# resize if necessary
if not im.size == (int(self.settings.value('outputWidth')), int(self.settings.value('outputHeight'))):
im = im.resize((int(self.settings.value('outputWidth')), int(self.settings.value('outputHeight'))), Image.ANTIALIAS)
-
- self._image = ImageQt(im)
-
- self._image1 = QtGui.QImage(self._image)
- painter = QPainter(self._image1)
- font = titleFont
- font.setPixelSize(fontSize)
- painter.setFont(font)
- painter.setPen(QColor(*textColor))
-
- fm = QtGui.QFontMetrics(font)
- yPosition = yOffset + fm.height()/6
-
- if alignment == 0: #Left
- xPosition = xOffset
- if alignment == 1: #Middle
- xPosition = xOffset - fm.width(titleText)/2
- if alignment == 2: #Right
- xPosition = xOffset - fm.width(titleText)
- painter.drawText(xPosition, yPosition, titleText)
- painter.end()
-
- buffer = QtCore.QBuffer()
- buffer.open(QtCore.QIODevice.ReadWrite)
- self._image1.save(buffer, "PNG")
-
- strio = io.BytesIO()
- strio.write(buffer.data())
- buffer.close()
- strio.seek(0)
- return Image.open(strio)
-
- def drawBars(self, spectrum, image, color):
-
- width = int(self.settings.value('outputWidth'))
- height = int(int(self.settings.value('outputHeight'))/2)
-
- vH = height-height/8
- bF = int(self.settings.value('outputWidth')) / 64
- bH = bF / 2
- bQ = bF / 4
- imTop = Image.new("RGBA", (width, height))
- draw = ImageDraw.Draw(imTop)
- r, g, b = color
- color2 = (r, g, b, 50)
-
- bP = int(self.settings.value('outputHeight')) / 800
-
- for j in range(0, 63):
- draw.rectangle((bH + j * bF, vH+bQ, bH + j * bF + bF, vH + bQ - spectrum[j * 4] * bP - bH), fill=color2)
- draw.rectangle((bH + bQ + j * bF, vH , bH + bQ + j * bF + bH, vH - spectrum[j * 4] * bP), fill=color)
-
-
- imBottom = imTop.transpose(Image.FLIP_TOP_BOTTOM)
-
- im = Image.new("RGB", (int(self.settings.value('outputWidth')), int(self.settings.value('outputHeight'))), "black")
- im.paste(image, (0, 0))
-
- layout = int(self.settings.value('visLayout'))
-
- if layout == 0:
- im.paste(imTop, (0, 0), mask=imTop)
- im.paste(imBottom, (0, int(vH+bF*1.8)), mask=imBottom)
-
- if layout == 1:
- im.paste(imTop, (0, int(height+bF*1.5)), mask=imTop)
- im.paste(imBottom, (0, int(0-bF*1.5)), mask=imBottom)
-
- if layout == 2:
- im.paste(imTop, (0, int(height+bF*1.5)), mask=imTop)
-
+
return im
def readAudioFile(self, filename):
@@ -159,41 +87,10 @@ class Core():
return completeAudioArray
- def transformData(self, i, completeAudioArray, sampleSize, smoothConstantDown, smoothConstantUp, lastSpectrum):
- if len(completeAudioArray) < (i + sampleSize):
- sampleSize = len(completeAudioArray) - i
-
- window = numpy.hanning(sampleSize)
- data = completeAudioArray[i:i+sampleSize][::1] * window
- paddedSampleSize = 2048
- paddedData = numpy.pad(data, (0, paddedSampleSize - sampleSize), 'constant')
- spectrum = numpy.fft.fft(paddedData)
- sample_rate = 44100
- frequencies = numpy.fft.fftfreq(len(spectrum), 1./sample_rate)
-
- y = abs(spectrum[0:int(paddedSampleSize/2) - 1])
-
- # filter the noise away
- # y[y<80] = 0
-
- y = 20 * numpy.log10(y)
- y[numpy.isinf(y)] = 0
-
- if lastSpectrum is not None:
- lastSpectrum[y < lastSpectrum] = y[y < lastSpectrum] * smoothConstantDown + lastSpectrum[y < lastSpectrum] * (1 - smoothConstantDown)
- lastSpectrum[y >= lastSpectrum] = y[y >= lastSpectrum] * smoothConstantUp + lastSpectrum[y >= lastSpectrum] * (1 - smoothConstantUp)
- else:
- lastSpectrum = y
-
- x = frequencies[0:int(paddedSampleSize/2) - 1]
-
- return lastSpectrum
-
def deleteTempDir(self):
if self.tempDir and os.path.exists(self.tempDir):
rmtree(self.tempDir)
-
def getVideoFrames(self, videoPath, firstOnly=False):
self.tempDir = os.path.join(tempfile.gettempdir(), 'audio-visualizer-python-data')
# recreate the temporary directory so it is empty
diff --git a/main.py b/main.py
index 4fe9315..b700ad7 100644
--- a/main.py
+++ b/main.py
@@ -10,15 +10,18 @@ import atexit
from queue import Queue
from PyQt4.QtCore import QSettings
import signal
+from importlib import import_module
import preview_thread, core, video_thread
class Command(QtCore.QObject):
- videoTask = QtCore.pyqtSignal(str, str, QFont, int, int, int, int, tuple, tuple, str, str)
+ videoTask = QtCore.pyqtSignal(str, str, QFont, int, int, int, int, tuple, tuple, str, str, list)
def __init__(self):
QtCore.QObject.__init__(self)
+ self.modules = []
+ self.selectedComponents = []
import argparse
self.parser = argparse.ArgumentParser(description='Create a visualization for an audio file')
@@ -90,7 +93,8 @@ class Command(QtCore.QObject):
self.textColor,
self.visColor,
self.args.input,
- self.args.output)
+ self.args.output,
+ self.selectedComponents)
def videoCreated(self):
self.videoThread.quit()
@@ -109,9 +113,9 @@ class Command(QtCore.QObject):
class Main(QtCore.QObject):
- newTask = QtCore.pyqtSignal(str, str, QFont, int, int, int, int, tuple, tuple)
+ newTask = QtCore.pyqtSignal(str, list)
processTask = QtCore.pyqtSignal()
- videoTask = QtCore.pyqtSignal(str, str, QFont, int, int, int, int, tuple, tuple, str, str)
+ videoTask = QtCore.pyqtSignal(str, str, str, list)
def __init__(self, window):
QtCore.QObject.__init__(self)
@@ -121,6 +125,8 @@ class Main(QtCore.QObject):
self.core = core.Core()
self.settings = QSettings('settings.ini', QSettings.IniFormat)
LoadDefaultSettings(self)
+
+ self.pages = []
# load colors as tuples from a comma-separated string
self.textColor = core.Core.RGBFromString(self.settings.value("textColor", '255, 255, 255'))
@@ -140,24 +146,26 @@ class Main(QtCore.QObject):
self.timer.timeout.connect(self.processTask.emit)
self.timer.start(500)
+ # begin decorating the window and connecting events
window.toolButton_selectAudioFile.clicked.connect(self.openInputFileDialog)
window.toolButton_selectBackground.clicked.connect(self.openBackgroundFileDialog)
window.toolButton_selectOutputFile.clicked.connect(self.openOutputFileDialog)
window.progressBar_createVideo.setValue(0)
window.pushButton_createVideo.clicked.connect(self.createAudioVisualisation)
window.setWindowTitle("Audio Visualizer")
- window.comboBox_textAlign.addItem("Left")
- window.comboBox_textAlign.addItem("Middle")
- window.comboBox_textAlign.addItem("Right")
- window.comboBox_textAlign.setCurrentIndex(1)
- window.comboBox_visLayout.addItem("Classic")
- window.comboBox_visLayout.addItem("Split")
- window.comboBox_visLayout.addItem("Bottom")
- visLayoutValue = int(self.settings.value('visLayout'))
- window.comboBox_visLayout.setCurrentIndex(visLayoutValue)
+ self.modules = self.findComponents()
+ for component in self.modules:
+ window.comboBox_componentSelection.addItem(component.__doc__)
+ window.listWidget_componentList.clicked.connect(lambda _: self.changeComponentWidget())
+ self.selectedComponents = []
+
+ self.window.pushButton_addComponent.clicked.connect( \
+ lambda _: self.addComponent(self.window.comboBox_componentSelection.currentIndex())
+ )
+ self.window.pushButton_removeComponent.clicked.connect(lambda _: self.removeComponent())
- currentRes = self.settings.value('outputWidth')+'x'+self.settings.value('outputHeight')
+ currentRes = str(self.settings.value('outputWidth'))+'x'+str(self.settings.value('outputHeight'))
for i, res in enumerate(self.resolutions):
window.comboBox_resolution.addItem(res)
if res == currentRes:
@@ -165,8 +173,12 @@ class Main(QtCore.QObject):
window.comboBox_resolution.setCurrentIndex(currentRes)
window.comboBox_resolution.currentIndexChanged.connect(self.updateResolution)
- # FIXME This needs to be changed in a future commit.
- # We should be setting these values somewhere else.
+ '''
+ window.comboBox_textAlign.addItem("Left")
+ window.comboBox_textAlign.addItem("Middle")
+ window.comboBox_textAlign.addItem("Right")
+ window.comboBox_textAlign.setCurrentIndex(1)
+
window.spinBox_fontSize.setValue(int(int(self.settings.value("outputHeight")) / 14 ))
window.spinBox_xTextAlign.setValue(int(int(self.settings.value('outputWidth'))/2))
window.spinBox_yTextAlign.setValue(int(int(self.settings.value('outputHeight'))/2))
@@ -206,7 +218,7 @@ class Main(QtCore.QObject):
window.spinBox_fontSize.valueChanged.connect(self.drawPreview)
window.lineEdit_textColor.textChanged.connect(self.drawPreview)
window.lineEdit_visColor.textChanged.connect(self.drawPreview)
-
+ '''
self.drawPreview()
window.show()
@@ -268,18 +280,10 @@ class Main(QtCore.QObject):
self.videoThread.start()
self.videoTask.emit(self.window.lineEdit_background.text(),
- self.window.lineEdit_title.text(),
- self.window.fontComboBox_titleFont.currentFont(),
- self.window.spinBox_fontSize.value(),
- self.window.comboBox_textAlign.currentIndex(),
- self.window.spinBox_xTextAlign.value(),
- self.window.spinBox_yTextAlign.value(),
- core.Core.RGBFromString(self.window.lineEdit_textColor.text()),
- core.Core.RGBFromString(self.window.lineEdit_visColor.text()),
self.window.lineEdit_audioFile.text(),
- self.window.lineEdit_outputFile.text())
+ self.window.lineEdit_outputFile.text(),
+ self.selectedComponents)
-
def progressBarUpdated(self, value):
self.window.progressBar_createVideo.setValue(value)
@@ -298,16 +302,8 @@ class Main(QtCore.QObject):
self.drawPreview
def drawPreview(self):
- self.settings.setValue('visLayout', self.window.comboBox_visLayout.currentIndex())
- self.newTask.emit(self.window.lineEdit_background.text(),
- self.window.lineEdit_title.text(),
- self.window.fontComboBox_titleFont.currentFont(),
- self.window.spinBox_fontSize.value(),
- self.window.comboBox_textAlign.currentIndex(),
- self.window.spinBox_xTextAlign.value(),
- self.window.spinBox_yTextAlign.value(),
- core.Core.RGBFromString(self.window.lineEdit_textColor.text()),
- core.Core.RGBFromString(self.window.lineEdit_visColor.text()))
+ #self.settings.setValue('visLayout', self.window.comboBox_visLayout.currentIndex())
+ self.newTask.emit(self.window.lineEdit_background.text(), self.selectedComponents)
# self.processTask.emit()
def showPreviewImage(self, image):
@@ -328,6 +324,40 @@ class Main(QtCore.QObject):
self.window.lineEdit_visColor.setText(RGBstring)
window.pushButton_visColor.setStyleSheet(btnStyle)
+ def findComponents(self):
+ def findComponents():
+ srcPath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'components')
+ if os.path.exists(srcPath):
+ for f in os.listdir(srcPath):
+ name, ext = os.path.splitext(f)
+ if name.startswith("__"):
+ continue
+ elif ext == '.py':
+ yield name
+ return [import_module('components.%s' % name) for name in findComponents()]
+
+ def addComponent(self, moduleIndex):
+ self.window.listWidget_componentList.addItem(self.modules[moduleIndex].__doc__)
+ self.selectedComponents.append(self.modules[moduleIndex].Component())
+ self.selectedComponents[-1].page = self.selectedComponents[-1].widget(self)
+ self.pages.append(self.selectedComponents[-1].page)
+ self.window.stackedWidget.addWidget(self.pages[-1])
+ self.selectedComponents[-1].update()
+
+ def removeComponent(self):
+ for selected in self.window.listWidget_componentList.selectedItems():
+ index = self.window.listWidget_componentList.row(selected)
+ self.window.stackedWidget.removeWidget(self.pages[index])
+ self.window.listWidget_componentList.takeItem(index)
+ self.selectedComponents.pop(index)
+ print(self.selectedComponents)
+ self.drawPreview()
+
+ def changeComponentWidget(self):
+ selected = self.window.listWidget_componentList.selectedItems()
+ index = self.window.listWidget_componentList.row(selected[0])
+ self.window.stackedWidget.setCurrentIndex(index)
+
def LoadDefaultSettings(self):
self.resolutions = [
'1920x1080',
diff --git a/main.ui b/main.ui
deleted file mode 100644
index 5acb7eb..0000000
--- a/main.ui
+++ /dev/null
@@ -1,564 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>635</width>
- <height>600</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>635</width>
- <height>600</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QGroupBox" name="groupBox_settings">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>200</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>GroupBox</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_6">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QPushButton" name="pushButton_selectInput">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>PushButton</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_input">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>2</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::Box</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QPushButton" name="pushButton_selectOutput">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>PushButton</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_output">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>2</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::Box</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="QPushButton" name="pushButton_selectBackground">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>PushButton</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_background">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>2</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::Box</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLabel" name="label_font">
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QFontComboBox" name="fontComboBox"/>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLabel" name="label_alignment">
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QComboBox" name="alignmentComboBox"/>
- </item>
- <item>
- <widget class="QLabel" name="label_fontsize">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="fontsizeSpinBox">
- <property name="maximum">
- <number>999</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_textX">
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text">
- <string>X</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="textXSpinBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimum">
- <number>-99999</number>
- </property>
- <property name="maximum">
- <number>99999</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_textY">
- <property name="text">
- <string>Y</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="textYSpinBox">
- <property name="minimum">
- <number>-99999</number>
- </property>
- <property name="maximum">
- <number>99999</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_6">
- <item>
- <widget class="QLabel" name="label_colorOptions">
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_textColor">
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit_textColor"/>
- </item>
- <item>
- <widget class="QLabel" name="label_visColor">
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit_visColor"/>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_7">
- <item>
- <widget class="QLabel" name="label_title">
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit_title"/>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_preview">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>220</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>220</height>
- </size>
- </property>
- <property name="title">
- <string>GroupBox</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_5">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_7">
- <item>
- <widget class="QLabel" name="label_preview">
- <property name="minimumSize">
- <size>
- <width>320</width>
- <height>180</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>320</width>
- <height>180</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::Box</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_create">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>GroupBox</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_7">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_4">
- <item>
- <widget class="QProgressBar" name="progressBar_create">
- <property name="value">
- <number>24</number>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- <property name="textVisible">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton_createVideo">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>PushButton</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/mainwindow.ui b/mainwindow.ui
index 3dbb817..ce8233e 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>1139</width>
- <height>658</height>
+ <width>1165</width>
+ <height>707</height>
</rect>
</property>
<property name="windowTitle">
@@ -109,119 +109,91 @@
<number>3</number>
</property>
<item>
- <widget class="QListView" name="listView_componentList">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>280</width>
- <height>200</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="verticalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOn</enum>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <property name="leftMargin">
+ <number>3</number>
</property>
- <property name="horizontalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_4">
- <property name="leftMargin">
- <number>3</number>
- </property>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
- <widget class="QPushButton" name="pushButton_openProject">
- <property name="text">
- <string>Open Project</string>
+ <layout class="QHBoxLayout" name="horizontalLayout_16">
+ <item>
+ <widget class="QPushButton" name="pushButton_openProject">
+ <property name="text">
+ <string>Open Project</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_saveProject">
+ <property name="text">
+ <string>Save Project</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- </widget>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
</item>
<item>
- <widget class="QPushButton" name="pushButton_saveProject">
- <property name="text">
- <string>Save Project</string>
+ <widget class="QComboBox" name="comboBox_componentSelection">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>280</width>
+ <height>0</height>
+ </size>
</property>
</widget>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_14">
+ <item>
+ <widget class="QPushButton" name="pushButton_addComponent">
+ <property name="text">
+ <string>Add Component</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_removeComponent">
+ <property name="text">
+ <string>Remove Component</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>10</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_componentSelection">
+ <widget class="QListWidget" name="listWidget_componentList">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>280</width>
- <height>0</height>
- </size>
- </property>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_14">
- <item>
- <widget class="QPushButton" name="pushButton_addComponent">
- <property name="text">
- <string>Add Component</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton_removeComponent">
- <property name="text">
- <string>Remove Component</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QPushButton" name="pushButton_openPreset">
@@ -251,456 +223,81 @@
<property name="topMargin">
<number>4</number>
</property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
<item>
- <layout class="QVBoxLayout" name="verticalLayout_8">
- <property name="spacing">
- <number>8</number>
- </property>
- <property name="rightMargin">
- <number>8</number>
- </property>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <property name="topMargin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="label_audioFile">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Audio File</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit_audioFile">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>340</width>
- <height>28</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>28</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="toolButton_selectAudioFile">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>28</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>28</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLabel" name="label_background">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Background</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit_background">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>28</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>28</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="toolButton_selectBackground">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>28</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>28</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_6">
- <item>
- <widget class="QLabel" name="label_outputFile">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Output File</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit_outputFile">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>28</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>28</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="toolButton_selectOutputFile">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>28</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>28</height>
- </size>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_13">
- <item>
- <widget class="QLabel" name="label_videoFormat">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>98</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Video Format</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_videoFormat"/>
- </item>
- <item>
- <widget class="QLabel" name="label_videoPreset">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Video Preset</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_videoPreset"/>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_10">
- <item>
- <widget class="QLabel" name="label_videoCodec">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>98</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Video Codec</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_videoCodec">
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>5</width>
- <height>5</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="label_resolution">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Resolution</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_resolution"/>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_11">
- <item>
- <widget class="QLabel" name="label_audioCodec">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>98</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Audio Codec</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_audioCodec">
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>5</width>
- <height>10</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="label_audioBitrate">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Bitrate</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboBox_bitrate"/>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer_3">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Maximum</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QStackedWidget" name="stackedWidget">
+ <widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="styleSheet">
- <string notr="true"/>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="tabPosition">
+ <enum>QTabWidget::North</enum>
+ </property>
+ <property name="tabShape">
+ <enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
- <widget class="QWidget" name="page_titleComponent">
- <layout class="QVBoxLayout" name="verticalLayout_5">
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Input Settings</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <property name="margin">
+ <number>10</number>
+ </property>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_7">
- <property name="leftMargin">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <property name="topMargin">
<number>0</number>
</property>
<item>
- <widget class="QLabel" name="label_title">
+ <widget class="QLabel" name="label_audioFile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="text">
- <string>Title</string>
+ <string>Audio File</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="lineEdit_title">
+ <widget class="QLineEdit" name="lineEdit_audioFile">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -709,158 +306,197 @@
</property>
<property name="minimumSize">
<size>
- <width>300</width>
- <height>0</height>
+ <width>340</width>
+ <height>28</height>
</size>
</property>
- <property name="text">
- <string>Testing New GUI</string>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>28</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_6">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <widget class="QToolButton" name="toolButton_selectAudioFile">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>28</height>
+ </size>
</property>
- <property name="sizeHint" stdset="0">
+ <property name="maximumSize">
<size>
- <width>5</width>
- <height>20</height>
+ <width>16777215</width>
+ <height>28</height>
</size>
</property>
- </spacer>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
</item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
- <widget class="QLabel" name="label_xTitleAlign">
+ <widget class="QLabel" name="label_background">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="text">
- <string>X</string>
+ <string>Background</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="spinBox_xTextAlign">
+ <widget class="QLineEdit" name="lineEdit_background">
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximumSize">
+ <property name="minimumSize">
<size>
- <width>80</width>
- <height>16777215</height>
+ <width>0</width>
+ <height>28</height>
</size>
</property>
- <property name="baseSize">
+ <property name="maximumSize">
<size>
- <width>0</width>
- <height>0</height>
+ <width>16777215</width>
+ <height>28</height>
</size>
</property>
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>999999999</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_7">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <widget class="QToolButton" name="toolButton_selectBackground">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>28</height>
+ </size>
</property>
- <property name="sizeHint" stdset="0">
+ <property name="maximumSize">
<size>
- <width>5</width>
- <height>20</height>
+ <width>16777215</width>
+ <height>28</height>
</size>
</property>
- </spacer>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
</item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Encoder Settings</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <property name="margin">
+ <number>10</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
- <widget class="QLabel" name="label_yTitleAlign">
+ <widget class="QLabel" name="label_videoFormat">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>98</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="text">
- <string>Y</string>
+ <string>Video Format</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="spinBox_yTextAlign">
+ <widget class="QComboBox" name="comboBox_videoFormat"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_videoPreset">
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="maximum">
- <number>999999999</number>
+ <property name="text">
+ <string>Video Preset</string>
</property>
</widget>
</item>
+ <item>
+ <widget class="QComboBox" name="comboBox_videoPreset"/>
+ </item>
</layout>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="label_videoCodec">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>98</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="text">
- <string>Font</string>
+ <string>Video Codec</string>
</property>
</widget>
</item>
<item>
- <widget class="QFontComboBox" name="fontComboBox_titleFont">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <widget class="QComboBox" name="comboBox_videoCodec">
<property name="minimumSize">
<size>
- <width>140</width>
+ <width>150</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_8">
+ <spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -870,13 +506,13 @@
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
- <height>20</height>
+ <height>5</height>
</size>
</property>
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_fontSize">
+ <widget class="QLabel" name="label_resolution">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -884,39 +520,48 @@
</sizepolicy>
</property>
<property name="text">
- <string>Font Size</string>
+ <string>Resolution</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="spinBox_fontSize">
- <property name="maximum">
- <number>500</number>
- </property>
- </widget>
+ <widget class="QComboBox" name="comboBox_resolution"/>
</item>
</layout>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_12">
+ <layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
- <widget class="QLabel" name="label_textLayout">
+ <widget class="QLabel" name="label_audioCodec">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>98</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="text">
- <string>Text Layout</string>
+ <string>Audio Codec</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="comboBox_textAlign"/>
+ <widget class="QComboBox" name="comboBox_audioCodec">
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
</item>
<item>
- <spacer name="horizontalSpacer_2">
+ <spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -926,186 +571,193 @@
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
- <height>20</height>
+ <height>10</height>
</size>
</property>
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_textColor">
+ <widget class="QLabel" name="label_audioBitrate">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
- <string>Text Color</string>
+ <string>Bitrate</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_textColor">
- <property name="maximumSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="MaximumSize" stdset="0">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- </widget>
+ <widget class="QComboBox" name="comboBox_bitrate"/>
</item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_5">
+ <attribute name="title">
+ <string>Export Video</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <property name="margin">
+ <number>10</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_11">
<item>
- <widget class="QLineEdit" name="lineEdit_textColor"/>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLabel" name="label_outputFile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Output File</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_outputFile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>28</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>28</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButton_selectOutputFile">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>28</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>28</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_9">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QLabel" name="label_visLayout">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <widget class="QProgressBar" name="progressBar_createVideo">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
</property>
- <property name="text">
- <string>Visualizer Layout</string>
+ <property name="value">
+ <number>24</number>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="comboBox_visLayout"/>
- </item>
- <item>
- <spacer name="horizontalSpacer_5">
+ <spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>5</width>
+ <width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_visColor">
+ <widget class="QPushButton" name="pushButton_createVideo">
<property name="text">
- <string>Visulizer Color</string>
+ <string>Create video</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_visColor">
- <property name="maximumSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
+ <widget class="QPushButton" name="pushButton_Cancel">
<property name="text">
- <string/>
- </property>
- <property name="MaximumSize" stdset="0">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
+ <string>Cancel</string>
</property>
</widget>
</item>
- <item>
- <widget class="QLineEdit" name="lineEdit_visColor"/>
- </item>
</layout>
</item>
- <item>
- <spacer name="verticalSpacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Minimum</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>80</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
<zorder></zorder>
- <zorder></zorder>
- <zorder>verticalSpacer_4</zorder>
</widget>
</widget>
</item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>20</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
<item>
- <widget class="QProgressBar" name="progressBar_createVideo">
+ <widget class="QStackedWidget" name="stackedWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>0</width>
- <height>0</height>
+ <height>180</height>
</size>
</property>
- <property name="value">
- <number>24</number>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Minimum</enum>
- </property>
- <property name="sizeHint" stdset="0">
+ <property name="maximumSize">
<size>
- <width>10</width>
- <height>20</height>
+ <width>16777215</width>
+ <height>180</height>
</size>
</property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton_createVideo">
- <property name="text">
- <string>Create video</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton_Cancel">
- <property name="text">
- <string>Cancel</string>
+ <property name="currentIndex">
+ <number>-1</number>
</property>
</widget>
</item>
diff --git a/preview_thread.py b/preview_thread.py
index 593a70f..e8b2021 100644
--- a/preview_thread.py
+++ b/preview_thread.py
@@ -18,23 +18,17 @@ class Worker(QtCore.QObject):
self.core = core.Core()
self.queue = queue
self.core.settings = parent.settings
+ self.stackedWidget = parent.window.stackedWidget
- @pyqtSlot(str, str, QtGui.QFont, int, int, int, int, tuple, tuple)
- def createPreviewImage(self, backgroundImage, titleText, titleFont, fontSize,\
- alignment, xOffset, yOffset, textColor, visColor):
+ @pyqtSlot(str, list)
+ def createPreviewImage(self, backgroundImage, components):
# print('worker thread id: {}'.format(QtCore.QThread.currentThreadId()))
dic = {
"backgroundImage": backgroundImage,
- "titleText": titleText,
- "titleFont": titleFont,
- "fontSize": fontSize,
- "alignment": alignment,
- "xoffset": xOffset,
- "yoffset": yOffset,
- "textColor" : textColor,
- "visColor" : visColor
+ "components": components,
}
+ print(components)
self.queue.put(dic)
@pyqtSlot()
@@ -56,21 +50,21 @@ class Worker(QtCore.QObject):
else:
bgImage = bgImage[0]
- im = self.core.drawBaseImage(
- bgImage,
- nextPreviewInformation["titleText"],
- nextPreviewInformation["titleFont"],
- nextPreviewInformation["fontSize"],
- nextPreviewInformation["alignment"],
- nextPreviewInformation["xoffset"],
- nextPreviewInformation["yoffset"],
- nextPreviewInformation["textColor"],
- nextPreviewInformation["visColor"])
- spectrum = numpy.fromfunction(lambda x: 0.008*(x-128)**2, (255,), dtype="int16")
+ im = self.core.drawBaseImage(bgImage)
+ frame = Image.new("RGBA", (1280, 720),(0,0,0,255))
+ frame.paste(im)
- im = self.core.drawBars(spectrum, im, nextPreviewInformation["visColor"])
- self._image = ImageQt(im)
+ componentWidgets = [self.stackedWidget.widget(i) for i in range(self.stackedWidget.count())]
+ components = nextPreviewInformation["components"]
+ print(components)
+ print(componentWidgets)
+ for component, componentWidget in zip(components, componentWidgets):
+ print('drawing')
+ newFrame = Image.alpha_composite(frame,component.previewRender(self, componentWidget))
+ frame = Image.alpha_composite(frame,newFrame)
+
+ self._image = ImageQt(frame)
self.imageCreated.emit(QtGui.QImage(self._image))
except Empty:
diff --git a/video_thread.py b/video_thread.py
index 5b9a896..ccb2730 100644
--- a/video_thread.py
+++ b/video_thread.py
@@ -17,24 +17,15 @@ class Worker(QtCore.QObject):
QtCore.QObject.__init__(self)
self.core = core.Core()
self.core.settings = parent.settings
+ self.modules = parent.modules
+ self.stackedWidget = parent.window.stackedWidget
parent.videoTask.connect(self.createVideo)
-
- @pyqtSlot(str, str, QtGui.QFont, int, int, int, int, tuple, tuple, str, str)
- def createVideo(self, backgroundImage, titleText, titleFont, fontSize, alignment,\
- xOffset, yOffset, textColor, visColor, inputFile, outputFile):
+ @pyqtSlot(str, str, str, list)
+ def createVideo(self, backgroundImage, inputFile, outputFile, components):
# print('worker thread id: {}'.format(QtCore.QThread.currentThreadId()))
def getBackgroundAtIndex(i):
- return self.core.drawBaseImage(
- backgroundFrames[i],
- titleText,
- titleFont,
- fontSize,
- alignment,
- xOffset,
- yOffset,
- textColor,
- visColor)
+ return self.core.drawBaseImage(backgroundFrames[i])
progressBarValue = 0
self.progressBarUpdate.emit(progressBarValue)
@@ -84,40 +75,47 @@ class Worker(QtCore.QObject):
out_pipe = sp.Popen(ffmpegCommand,
stdin=sp.PIPE,stdout=sys.stdout, stderr=sys.stdout)
- smoothConstantDown = 0.08
- smoothConstantUp = 0.8
- lastSpectrum = None
+ # initialize components
+ componentWidgets = [self.stackedWidget.widget(i) for i in range(self.stackedWidget.count())]
+
+ print('######################## Data')
+ print(components)
+ print(componentWidgets)
sampleSize = 1470
-
+ for component, widget in zip(components, componentWidgets):
+ component.preFrameRender(worker=self, widget=widget, completeAudioArray=completeAudioArray, sampleSize=sampleSize)
+
numpy.seterr(divide='ignore')
+ frame = getBackgroundAtIndex(0)
bgI = 0
+ # create video for output
for i in range(0, len(completeAudioArray), sampleSize):
- # create video for output
- lastSpectrum = self.core.transformData(
- i,
- completeAudioArray,
- sampleSize,
- smoothConstantDown,
- smoothConstantUp,
- lastSpectrum)
- if imBackground != None:
- im = self.core.drawBars(lastSpectrum, imBackground, visColor)
- else:
- im = self.core.drawBars(lastSpectrum, getBackgroundAtIndex(bgI), visColor)
- if bgI < len(backgroundFrames)-1:
- bgI += 1
+ newFrame = Image.new("RGBA", (int(self.core.settings.value('outputWidth')), int(self.core.settings.value('outputHeight'))),(0,0,0,255))
+
+ if imBackground:
+ newFrame.paste(imBackground)
+ else:
+ newFrame.paste(getBackgroundAtIndex(bgI))
+
+ for compNo, comp in enumerate(components):
+ newFrame = Image.alpha_composite(newFrame,comp.frameRender(compNo, i))
+ if not imBackground:
+ if bgI < len(backgroundFrames)-1:
+ bgI += 1
# write to out_pipe
- try:
- out_pipe.stdin.write(im.tobytes())
- finally:
- True
-
- # increase progress bar value
- if progressBarValue + 1 <= (i / len(completeAudioArray)) * 100:
- progressBarValue = numpy.floor((i / len(completeAudioArray)) * 100)
- self.progressBarUpdate.emit(progressBarValue)
- self.progressBarSetText.emit('%s%%' % str(int(progressBarValue)))
+ try:
+ frame = Image.new("RGB", (int(self.core.settings.value('outputWidth')), int(self.core.settings.value('outputHeight'))),(0,0,0))
+ frame.paste(newFrame)
+ out_pipe.stdin.write(frame.tobytes())
+ finally:
+ True
+
+ # increase progress bar value
+ if progressBarValue + 1 <= (i / len(completeAudioArray)) * 100:
+ progressBarValue = numpy.floor((i / len(completeAudioArray)) * 100)
+ self.progressBarUpdate.emit(progressBarValue)
+ self.progressBarSetText.emit('%s%%' % str(int(progressBarValue)))
numpy.seterr(all='print')