-
Notifications
You must be signed in to change notification settings - Fork 1
/
separateLeadQtGUI2.py
260 lines (253 loc) · 17.7 KB
/
separateLeadQtGUI2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'separateLeadQtGUI2.ui'
#
# Created: Thu Mar 15 19:04:46 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_separateLeadMainWindow(object):
def setupUi(self, separateLeadMainWindow):
separateLeadMainWindow.setObjectName(_fromUtf8("separateLeadMainWindow"))
separateLeadMainWindow.resize(717, 711)
separateLeadMainWindow.setWindowTitle(QtGui.QApplication.translate("separateLeadMainWindow", "Separate Lead GUI", None, QtGui.QApplication.UnicodeUTF8))
self.centralwidget = QtGui.QWidget(separateLeadMainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.openFileButton = QtGui.QPushButton(self.centralwidget)
self.openFileButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Open File", None, QtGui.QApplication.UnicodeUTF8))
self.openFileButton.setObjectName(_fromUtf8("openFileButton"))
self.horizontalLayout.addWidget(self.openFileButton)
self.filenameWidget = SLFilename(self.centralwidget)
self.filenameWidget.setDragEnabled(True)
self.filenameWidget.setObjectName(_fromUtf8("filenameWidget"))
self.horizontalLayout.addWidget(self.filenameWidget)
self.verticalLayout.addLayout(self.horizontalLayout)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
self.labelOutputDirSuf = QtGui.QLabel(self.centralwidget)
self.labelOutputDirSuf.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Output Directory suffix:", None, QtGui.QApplication.UnicodeUTF8))
self.labelOutputDirSuf.setObjectName(_fromUtf8("labelOutputDirSuf"))
self.horizontalLayout_3.addWidget(self.labelOutputDirSuf)
self.outputDirSuffixEdit = QtGui.QLineEdit(self.centralwidget)
self.outputDirSuffixEdit.setObjectName(_fromUtf8("outputDirSuffixEdit"))
self.horizontalLayout_3.addWidget(self.outputDirSuffixEdit)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.mplHF0Widget = MplWidget3Axes(self.centralwidget)
self.mplHF0Widget.setObjectName(_fromUtf8("mplHF0Widget"))
self.verticalLayout_2 = QtGui.QVBoxLayout(self.mplHF0Widget)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.horizontalLayout_2.addWidget(self.mplHF0Widget)
self.verticalLayout_3 = QtGui.QVBoxLayout()
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayout_6.setContentsMargins(0, -1, -1, -1)
self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
self.modelParams0 = QtGui.QFormLayout()
self.modelParams0.setObjectName(_fromUtf8("modelParams0"))
self.windLenLabel = QtGui.QLabel(self.centralwidget)
self.windLenLabel.setMaximumSize(QtCore.QSize(50, 16777215))
self.windLenLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "window len (s)", None, QtGui.QApplication.UnicodeUTF8))
self.windLenLabel.setWordWrap(True)
self.windLenLabel.setObjectName(_fromUtf8("windLenLabel"))
self.modelParams0.setWidget(0, QtGui.QFormLayout.LabelRole, self.windLenLabel)
self.windowLenMS = QtGui.QDoubleSpinBox(self.centralwidget)
self.windowLenMS.setObjectName(_fromUtf8("windowLenMS"))
self.modelParams0.setWidget(0, QtGui.QFormLayout.FieldRole, self.windowLenMS)
self.filtNbLabel = QtGui.QLabel(self.centralwidget)
self.filtNbLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "# Filter", None, QtGui.QApplication.UnicodeUTF8))
self.filtNbLabel.setObjectName(_fromUtf8("filtNbLabel"))
self.modelParams0.setWidget(1, QtGui.QFormLayout.LabelRole, self.filtNbLabel)
self.filtNbSpin = QtGui.QSpinBox(self.centralwidget)
self.filtNbSpin.setObjectName(_fromUtf8("filtNbSpin"))
self.modelParams0.setWidget(1, QtGui.QFormLayout.FieldRole, self.filtNbSpin)
self.accompNbSpin = QtGui.QSpinBox(self.centralwidget)
self.accompNbSpin.setObjectName(_fromUtf8("accompNbSpin"))
self.modelParams0.setWidget(2, QtGui.QFormLayout.FieldRole, self.accompNbSpin)
self.accompNbLabel = QtGui.QLabel(self.centralwidget)
self.accompNbLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "# Acc. \n"
"Elements", None, QtGui.QApplication.UnicodeUTF8))
self.accompNbLabel.setObjectName(_fromUtf8("accompNbLabel"))
self.modelParams0.setWidget(2, QtGui.QFormLayout.LabelRole, self.accompNbLabel)
self.iterLabel = QtGui.QLabel(self.centralwidget)
self.iterLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "# iter.", None, QtGui.QApplication.UnicodeUTF8))
self.iterLabel.setObjectName(_fromUtf8("iterLabel"))
self.modelParams0.setWidget(3, QtGui.QFormLayout.LabelRole, self.iterLabel)
self.iterSpin = QtGui.QSpinBox(self.centralwidget)
self.iterSpin.setObjectName(_fromUtf8("iterSpin"))
self.modelParams0.setWidget(3, QtGui.QFormLayout.FieldRole, self.iterSpin)
self.horizontalLayout_6.addLayout(self.modelParams0)
self.modelParams = QtGui.QFrame(self.centralwidget)
self.modelParams.setStyleSheet(_fromUtf8("border-color: rgb(0, 0, 0);"))
self.modelParams.setFrameShape(QtGui.QFrame.StyledPanel)
self.modelParams.setLineWidth(4)
self.modelParams.setMidLineWidth(4)
self.modelParams.setObjectName(_fromUtf8("modelParams"))
self.formLayout = QtGui.QFormLayout(self.modelParams)
self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.FieldsStayAtSizeHint)
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.minF0Label = QtGui.QLabel(self.modelParams)
self.minF0Label.setText(QtGui.QApplication.translate("separateLeadMainWindow", "min F0", None, QtGui.QApplication.UnicodeUTF8))
self.minF0Label.setObjectName(_fromUtf8("minF0Label"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.minF0Label)
self.minF0Spin = QtGui.QSpinBox(self.modelParams)
self.minF0Spin.setObjectName(_fromUtf8("minF0Spin"))
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.minF0Spin)
self.maxF0Label = QtGui.QLabel(self.modelParams)
self.maxF0Label.setText(QtGui.QApplication.translate("separateLeadMainWindow", "max F0", None, QtGui.QApplication.UnicodeUTF8))
self.maxF0Label.setObjectName(_fromUtf8("maxF0Label"))
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.maxF0Label)
self.maxF0Spin = QtGui.QSpinBox(self.modelParams)
self.maxF0Spin.setObjectName(_fromUtf8("maxF0Spin"))
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.maxF0Spin)
self.launchDecompLabel = QtGui.QLabel(self.modelParams)
self.launchDecompLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Launch\n"
"decomp.", None, QtGui.QApplication.UnicodeUTF8))
self.launchDecompLabel.setObjectName(_fromUtf8("launchDecompLabel"))
self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.launchDecompLabel)
self.loadFileButton = QtGui.QPushButton(self.modelParams)
self.loadFileButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Load File", None, QtGui.QApplication.UnicodeUTF8))
self.loadFileButton.setObjectName(_fromUtf8("loadFileButton"))
self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.loadFileButton)
self.horizontalLayout_6.addWidget(self.modelParams)
self.verticalLayout_3.addLayout(self.horizontalLayout_6)
self.displayParams = QtGui.QFrame(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.displayParams.sizePolicy().hasHeightForWidth())
self.displayParams.setSizePolicy(sizePolicy)
self.displayParams.setStyleSheet(_fromUtf8("border-color: rgb(0, 0, 0);"))
self.displayParams.setFrameShape(QtGui.QFrame.StyledPanel)
self.displayParams.setFrameShadow(QtGui.QFrame.Raised)
self.displayParams.setLineWidth(4)
self.displayParams.setMidLineWidth(4)
self.displayParams.setObjectName(_fromUtf8("displayParams"))
self.verticalLayout_4 = QtGui.QVBoxLayout(self.displayParams)
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
self.formLayout_2 = QtGui.QFormLayout()
self.formLayout_2.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout_2.setObjectName(_fromUtf8("formLayout_2"))
self.minValLabel = QtGui.QLabel(self.displayParams)
self.minValLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "min value", None, QtGui.QApplication.UnicodeUTF8))
self.minValLabel.setObjectName(_fromUtf8("minValLabel"))
self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.minValLabel)
self.minValEdit = QtGui.QSpinBox(self.displayParams)
self.minValEdit.setObjectName(_fromUtf8("minValEdit"))
self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.minValEdit)
self.maxValueLabel = QtGui.QLabel(self.displayParams)
self.maxValueLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "max value", None, QtGui.QApplication.UnicodeUTF8))
self.maxValueLabel.setObjectName(_fromUtf8("maxValueLabel"))
self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.maxValueLabel)
self.maxValEdit = QtGui.QSpinBox(self.displayParams)
self.maxValEdit.setObjectName(_fromUtf8("maxValEdit"))
self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.maxValEdit)
self.verticalLayout_4.addLayout(self.formLayout_2)
self.label = QtGui.QLabel(self.displayParams)
self.label.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Choose normalise\n"
"option for display:", None, QtGui.QApplication.UnicodeUTF8))
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout_4.addWidget(self.label)
self.normaliseNoneButton = QtGui.QRadioButton(self.displayParams)
self.normaliseNoneButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Don\'t normalise", None, QtGui.QApplication.UnicodeUTF8))
self.normaliseNoneButton.setChecked(True)
self.normaliseNoneButton.setObjectName(_fromUtf8("normaliseNoneButton"))
self.buttonGroup_2 = QtGui.QButtonGroup(separateLeadMainWindow)
self.buttonGroup_2.setObjectName(_fromUtf8("buttonGroup_2"))
self.buttonGroup_2.addButton(self.normaliseNoneButton)
self.verticalLayout_4.addWidget(self.normaliseNoneButton)
self.normaliseMaxButton = QtGui.QRadioButton(self.displayParams)
self.normaliseMaxButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Norm. by Max", None, QtGui.QApplication.UnicodeUTF8))
self.normaliseMaxButton.setObjectName(_fromUtf8("normaliseMaxButton"))
self.buttonGroup_2.addButton(self.normaliseMaxButton)
self.verticalLayout_4.addWidget(self.normaliseMaxButton)
self.normaliseSumButton = QtGui.QRadioButton(self.displayParams)
self.normaliseSumButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Norm. by Sum", None, QtGui.QApplication.UnicodeUTF8))
self.normaliseSumButton.setObjectName(_fromUtf8("normaliseSumButton"))
self.buttonGroup_2.addButton(self.normaliseSumButton)
self.verticalLayout_4.addWidget(self.normaliseSumButton)
self.verticalLayout_3.addWidget(self.displayParams)
self.selectionFrame = QtGui.QFrame(self.centralwidget)
self.selectionFrame.setStyleSheet(_fromUtf8("border-color: rgb(0, 0, 0);"))
self.selectionFrame.setFrameShape(QtGui.QFrame.StyledPanel)
self.selectionFrame.setFrameShadow(QtGui.QFrame.Raised)
self.selectionFrame.setLineWidth(4)
self.selectionFrame.setMidLineWidth(4)
self.selectionFrame.setObjectName(_fromUtf8("selectionFrame"))
self.verticalLayout_5 = QtGui.QVBoxLayout(self.selectionFrame)
self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
self.selectExplaneLabel = QtGui.QLabel(self.selectionFrame)
self.selectExplaneLabel.setStyleSheet(_fromUtf8("border-color: rgb(0, 0, 0);"))
self.selectExplaneLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Choose which part\n"
"to label:", None, QtGui.QApplication.UnicodeUTF8))
self.selectExplaneLabel.setObjectName(_fromUtf8("selectExplaneLabel"))
self.verticalLayout_5.addWidget(self.selectExplaneLabel)
self.formLayout_3 = QtGui.QFormLayout()
self.formLayout_3.setObjectName(_fromUtf8("formLayout_3"))
self.heightSelectLabel = QtGui.QLabel(self.selectionFrame)
self.heightSelectLabel.setText(QtGui.QApplication.translate("separateLeadMainWindow", "height (in semitone)", None, QtGui.QApplication.UnicodeUTF8))
self.heightSelectLabel.setObjectName(_fromUtf8("heightSelectLabel"))
self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole, self.heightSelectLabel)
self.heightSelectSpin = QtGui.QDoubleSpinBox(self.selectionFrame)
self.heightSelectSpin.setObjectName(_fromUtf8("heightSelectSpin"))
self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole, self.heightSelectSpin)
self.verticalLayout_5.addLayout(self.formLayout_3)
self.selectLeadButton = QtGui.QRadioButton(self.selectionFrame)
self.selectLeadButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Lead", None, QtGui.QApplication.UnicodeUTF8))
self.selectLeadButton.setChecked(True)
self.selectLeadButton.setObjectName(_fromUtf8("selectLeadButton"))
self.buttonGroup = QtGui.QButtonGroup(separateLeadMainWindow)
self.buttonGroup.setObjectName(_fromUtf8("buttonGroup"))
self.buttonGroup.addButton(self.selectLeadButton)
self.verticalLayout_5.addWidget(self.selectLeadButton)
self.selectDelButton = QtGui.QRadioButton(self.selectionFrame)
self.selectDelButton.setEnabled(False)
self.selectDelButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Delete", None, QtGui.QApplication.UnicodeUTF8))
self.selectDelButton.setObjectName(_fromUtf8("selectDelButton"))
self.buttonGroup.addButton(self.selectDelButton)
self.verticalLayout_5.addWidget(self.selectDelButton)
self.verticalLayout_3.addWidget(self.selectionFrame)
self.separateButton = QtGui.QPushButton(self.centralwidget)
self.separateButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Separate", None, QtGui.QApplication.UnicodeUTF8))
self.separateButton.setObjectName(_fromUtf8("separateButton"))
self.verticalLayout_3.addWidget(self.separateButton)
self.separateAutoButton = QtGui.QPushButton(self.centralwidget)
self.separateAutoButton.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Separate (Auto)", None, QtGui.QApplication.UnicodeUTF8))
self.separateAutoButton.setObjectName(_fromUtf8("separateAutoButton"))
self.verticalLayout_3.addWidget(self.separateAutoButton)
self.horizontalLayout_2.addLayout(self.verticalLayout_3)
self.verticalLayout.addLayout(self.horizontalLayout_2)
separateLeadMainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(separateLeadMainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 717, 22))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.mplmenuMenu = QtGui.QMenu(self.menubar)
self.mplmenuMenu.setTitle(QtGui.QApplication.translate("separateLeadMainWindow", "Menu", None, QtGui.QApplication.UnicodeUTF8))
self.mplmenuMenu.setObjectName(_fromUtf8("mplmenuMenu"))
separateLeadMainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(separateLeadMainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
separateLeadMainWindow.setStatusBar(self.statusbar)
self.actionOpen = QtGui.QAction(separateLeadMainWindow)
self.actionOpen.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Open...", None, QtGui.QApplication.UnicodeUTF8))
self.actionOpen.setObjectName(_fromUtf8("actionOpen"))
self.actionQuit = QtGui.QAction(separateLeadMainWindow)
self.actionQuit.setText(QtGui.QApplication.translate("separateLeadMainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setObjectName(_fromUtf8("actionQuit"))
self.mplmenuMenu.addAction(self.actionOpen)
self.mplmenuMenu.addAction(self.actionQuit)
self.menubar.addAction(self.mplmenuMenu.menuAction())
self.retranslateUi(separateLeadMainWindow)
QtCore.QMetaObject.connectSlotsByName(separateLeadMainWindow)
def retranslateUi(self, separateLeadMainWindow):
pass
from mplwidget import MplWidget3Axes, SLFilename