aboutsummaryrefslogtreecommitdiff
path: root/components/original.py
diff options
context:
space:
mode:
authorBrianna2017-06-15 23:21:34 -0400
committerGitHub2017-06-15 23:21:34 -0400
commitfc7ee6d8e5b5a96ec06918f9b5dd9310cdf814de (patch)
tree99fd013c1c87f6bb1d2ed22859b56b0bced081bc /components/original.py
parent02795503d09743b5225eed7e7b7112208dfc28d0 (diff)
parentee8031925fcd93d7bedceff6e98a06f3806426b3 (diff)
Redesigned preset UI + video & image component scaling/positioning
Added preset manager
Diffstat (limited to 'components/original.py')
-rw-r--r--components/original.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/components/original.py b/components/original.py
index 4d0e83b..5e2f9d4 100644
--- a/components/original.py
+++ b/components/original.py
@@ -1,9 +1,8 @@
import numpy
from PIL import Image, ImageDraw
-from PyQt4 import uic, QtGui
+from PyQt4 import uic, QtGui, QtCore
from PyQt4.QtGui import QColor
import os
-import random
from . import __base__
import time
from copy import copy
@@ -11,6 +10,9 @@ from copy import copy
class Component(__base__.Component):
'''Original Audio Visualization'''
+
+ modified = QtCore.pyqtSignal(int, dict)
+
def widget(self, parent):
self.parent = parent
self.visColor = (255, 255, 255)
@@ -36,8 +38,11 @@ class Component(__base__.Component):
self.layout = self.page.comboBox_visLayout.currentIndex()
self.visColor = self.RGBFromString(self.page.lineEdit_visColor.text())
self.parent.drawPreview()
+ super().update()
+
+ def loadPreset(self, pr, presetName=None):
+ super().loadPreset(pr, presetName)
- def loadPreset(self, pr):
self.page.lineEdit_visColor.setText('%s,%s,%s' % pr['visColor'])
btnStyle = "QPushButton { background-color : %s; outline: none; }" \
% QColor(*pr['visColor']).name()
@@ -46,6 +51,7 @@ class Component(__base__.Component):
def savePreset(self):
return {
+ 'preset': self.currentPreset,
'layout': self.layout,
'visColor': self.visColor,
}
@@ -139,7 +145,7 @@ class Component(__base__.Component):
bF = width / 64
bH = bF / 2
bQ = bF / 4
- imTop = Image.new("RGBA", (width, height), (0, 0, 0, 0))
+ imTop = self.blankFrame(width, height)
draw = ImageDraw.Draw(imTop)
r, g, b = color
color2 = (r, g, b, 125)
@@ -157,7 +163,7 @@ class Component(__base__.Component):
imBottom = imTop.transpose(Image.FLIP_TOP_BOTTOM)
- im = Image.new("RGBA", (width, height), (0, 0, 0, 0))
+ im = self.blankFrame(width, height)
if layout == 0:
y = 0 - int(height/100*43)