renamed Original Audio Visualization to Classic Visualizer
This commit is contained in:
parent
f284acbf19
commit
252639e9a2
|
@ -144,6 +144,11 @@ class Component(QtCore.QObject):
|
||||||
height = int(self.worker.core.settings.value('outputHeight'))
|
height = int(self.worker.core.settings.value('outputHeight'))
|
||||||
image = Image.new("RGBA", (width, height), (0,0,0,0))
|
image = Image.new("RGBA", (width, height), (0,0,0,0))
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def names(cls):
|
||||||
|
# Alternative names for renaming a component between project files
|
||||||
|
return []
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,14 @@ from copy import copy
|
||||||
|
|
||||||
|
|
||||||
class Component(__base__.Component):
|
class Component(__base__.Component):
|
||||||
'''Original Audio Visualization'''
|
'''Classic Visualizer'''
|
||||||
|
|
||||||
modified = QtCore.pyqtSignal(int, dict)
|
modified = QtCore.pyqtSignal(int, dict)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def names(cls):
|
||||||
|
return ['Original Audio Visualization']
|
||||||
|
|
||||||
def widget(self, parent):
|
def widget(self, parent):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.visColor = (255, 255, 255)
|
self.visColor = (255, 255, 255)
|
||||||
|
|
19
src/core.py
19
src/core.py
|
@ -1,5 +1,4 @@
|
||||||
import sys
|
import sys
|
||||||
import io
|
|
||||||
import os
|
import os
|
||||||
from PyQt5 import QtCore, QtGui, uic
|
from PyQt5 import QtCore, QtGui, uic
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
|
@ -81,8 +80,15 @@ class Core():
|
||||||
import_module('components.%s' % name)
|
import_module('components.%s' % name)
|
||||||
for name in findComponents()
|
for name in findComponents()
|
||||||
]
|
]
|
||||||
|
# store canonical module names and indexes
|
||||||
self.moduleIndexes = [i for i in range(len(self.modules))]
|
self.moduleIndexes = [i for i in range(len(self.modules))]
|
||||||
self.compNames = [mod.Component.__doc__ for mod in self.modules]
|
self.compNames = [mod.Component.__doc__ for mod in self.modules]
|
||||||
|
self.altCompNames = []
|
||||||
|
# store alternative names for modules
|
||||||
|
for i, mod in enumerate(self.modules):
|
||||||
|
if hasattr(mod.Component, 'names'):
|
||||||
|
for name in mod.Component.names():
|
||||||
|
self.altCompNames.append((name, i))
|
||||||
|
|
||||||
def componentListChanged(self):
|
def componentListChanged(self):
|
||||||
for i, component in enumerate(self.selectedComponents):
|
for i, component in enumerate(self.selectedComponents):
|
||||||
|
@ -132,8 +138,13 @@ class Core():
|
||||||
self.selectedComponents[i].update()
|
self.selectedComponents[i].update()
|
||||||
|
|
||||||
def moduleIndexFor(self, compName):
|
def moduleIndexFor(self, compName):
|
||||||
index = self.compNames.index(compName)
|
try:
|
||||||
return self.moduleIndexes[index]
|
index = self.compNames.index(compName)
|
||||||
|
return self.moduleIndexes[index]
|
||||||
|
except ValueError:
|
||||||
|
for altName, modI in self.altCompNames:
|
||||||
|
if altName == compName:
|
||||||
|
return self.moduleIndexes[modI]
|
||||||
|
|
||||||
def clearPreset(self, compIndex):
|
def clearPreset(self, compIndex):
|
||||||
self.selectedComponents[compIndex].currentPreset = None
|
self.selectedComponents[compIndex].currentPreset = None
|
||||||
|
@ -247,7 +258,7 @@ class Core():
|
||||||
print('file missing value: %s' % value)
|
print('file missing value: %s' % value)
|
||||||
return
|
return
|
||||||
if hasattr(loader, 'createNewProject'):
|
if hasattr(loader, 'createNewProject'):
|
||||||
loader.createNewProject()
|
loader.createNewProject(prompt=False)
|
||||||
import traceback
|
import traceback
|
||||||
msg = '%s: %s\n\nTraceback:\n' % (typ.__name__, value)
|
msg = '%s: %s\n\nTraceback:\n' % (typ.__name__, value)
|
||||||
msg += "\n".join(traceback.format_tb(tb))
|
msg += "\n".join(traceback.format_tb(tb))
|
||||||
|
|
|
@ -8,11 +8,11 @@ import video_thread
|
||||||
|
|
||||||
|
|
||||||
def disableWhenEncoding(func):
|
def disableWhenEncoding(func):
|
||||||
def decorator(*args):
|
def decorator(*args, **kwargs):
|
||||||
if args[0].encoding:
|
if args[0].encoding:
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
return func(*args)
|
return func(*args, **kwargs)
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -644,8 +644,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||||
field.blockSignals(False)
|
field.blockSignals(False)
|
||||||
|
|
||||||
@disableWhenEncoding
|
@disableWhenEncoding
|
||||||
def createNewProject(self):
|
def createNewProject(self, prompt=True):
|
||||||
self.openSaveChangesDialog('starting a new project')
|
if prompt:
|
||||||
|
self.openSaveChangesDialog('starting a new project')
|
||||||
|
|
||||||
self.clear()
|
self.clear()
|
||||||
self.currentProject = None
|
self.currentProject = None
|
||||||
|
|
Reference in New Issue