-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.py
314 lines (308 loc) · 15.5 KB
/
Window.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(940, 714)
MainWindow.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"\n"
"\n"
"\n"
"\n"
"")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout_6 = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout_6.setObjectName("gridLayout_6")
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.tabWidget.setFont(font)
self.tabWidget.setStyleSheet("background-color: rgb(0, 0, 0);")
self.tabWidget.setObjectName("tabWidget")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.gridLayout_8 = QtWidgets.QGridLayout(self.tab)
self.gridLayout_8.setObjectName("gridLayout_8")
self.gridLayout_7 = QtWidgets.QGridLayout()
self.gridLayout_7.setObjectName("gridLayout_7")
self.label_2 = QtWidgets.QLabel(self.tab)
self.label_2.setMaximumSize(QtCore.QSize(150, 16777215))
self.label_2.setStyleSheet("font: 10pt \"MS Shell Dlg 2\";\n"
"color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"")
self.label_2.setObjectName("label_2")
self.gridLayout_7.addWidget(self.label_2, 0, 0, 1, 1)
self.browseButton = QtWidgets.QPushButton(self.tab)
self.browseButton.setMaximumSize(QtCore.QSize(100, 16777215))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.browseButton.setFont(font)
self.browseButton.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(85, 85, 255);\n"
"border-color: rgb(85, 85, 255);\n"
"gridline-color: rgb(85, 85, 255);\n"
"")
self.browseButton.setObjectName("browseButton")
self.gridLayout_7.addWidget(self.browseButton, 0, 1, 1, 1)
self.soundRecogniserOuput = QtWidgets.QTextBrowser(self.tab)
self.soundRecogniserOuput.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.soundRecogniserOuput.setStyleSheet("color: rgb(85, 85, 255);\n"
"border-color: rgb(85, 85, 255);")
self.soundRecogniserOuput.setObjectName("soundRecogniserOuput")
self.gridLayout_7.addWidget(self.soundRecogniserOuput, 1, 0, 2, 1)
self.recordingButton = QtWidgets.QPushButton(self.tab)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.recordingButton.setFont(font)
self.recordingButton.setStyleSheet("background-color: rgb(255, 0, 4);\n"
"color: rgb(255, 255, 255);")
self.recordingButton.setObjectName("recordingButton")
self.gridLayout_7.addWidget(self.recordingButton, 1, 1, 1, 1)
self.playButton = QtWidgets.QPushButton(self.tab)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.playButton.setFont(font)
self.playButton.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"color: rgb(0, 0, 0);")
self.playButton.setObjectName("playButton")
self.gridLayout_7.addWidget(self.playButton, 2, 1, 1, 1)
self.gridLayout_8.addLayout(self.gridLayout_7, 0, 0, 1, 1)
self.label_3 = QtWidgets.QLabel(self.tab)
self.label_3.setStyleSheet("font: 14pt \"MS Shell Dlg 2\";")
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.gridLayout_8.addWidget(self.label_3, 1, 0, 1, 1)
self.soundRecogniserOuput_2 = QtWidgets.QTextBrowser(self.tab)
self.soundRecogniserOuput_2.setStyleSheet("color: rgb(85, 85, 255);\n"
"border-color: rgb(85, 85, 255);")
self.soundRecogniserOuput_2.setObjectName("soundRecogniserOuput_2")
self.gridLayout_8.addWidget(self.soundRecogniserOuput_2, 2, 0, 1, 1)
self.showResult = QtWidgets.QPushButton(self.tab)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.showResult.setFont(font)
self.showResult.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(98, 0, 147);\n"
"")
self.showResult.setObjectName("showResult")
self.gridLayout_8.addWidget(self.showResult, 3, 0, 1, 1)
self.tabWidget.addTab(self.tab, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_3)
self.gridLayout_5.setObjectName("gridLayout_5")
self.gridLayout_4 = QtWidgets.QGridLayout()
self.gridLayout_4.setObjectName("gridLayout_4")
self.plottingGraph = PlotWidget(self.tab_3)
self.plottingGraph.setStyleSheet("border-color: rgb(85, 85, 255);")
self.plottingGraph.setObjectName("plottingGraph")
self.gridLayout_4.addWidget(self.plottingGraph, 1, 0, 1, 1)
self.comboBox = QtWidgets.QComboBox(self.tab_3)
font = QtGui.QFont()
font.setPointSize(11)
font.setBold(True)
font.setWeight(75)
self.comboBox.setFont(font)
self.comboBox.setStyleSheet("color: rgb(85, 85, 255);\n"
"color: rgb(255, 255, 255);")
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.gridLayout_4.addWidget(self.comboBox, 0, 0, 1, 1)
self.gridLayout_5.addLayout(self.gridLayout_4, 0, 0, 1, 1)
self.tabWidget.addTab(self.tab_3, "")
self.Mixer = QtWidgets.QWidget()
self.Mixer.setObjectName("Mixer")
self.gridLayout_11 = QtWidgets.QGridLayout(self.Mixer)
self.gridLayout_11.setObjectName("gridLayout_11")
self.gridLayout_10 = QtWidgets.QGridLayout()
self.gridLayout_10.setObjectName("gridLayout_10")
self.verticalSlider = QtWidgets.QSlider(self.Mixer)
self.verticalSlider.setSingleStep(10)
self.verticalSlider.setOrientation(QtCore.Qt.Vertical)
self.verticalSlider.setTickPosition(QtWidgets.QSlider.TicksBothSides)
self.verticalSlider.setObjectName("verticalSlider")
self.gridLayout_10.addWidget(self.verticalSlider, 0, 0, 1, 1)
self.gridLayout_9 = QtWidgets.QGridLayout()
self.gridLayout_9.setObjectName("gridLayout_9")
self.showMixingResult = QtWidgets.QPushButton(self.Mixer)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.showMixingResult.setFont(font)
self.showMixingResult.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(98, 0, 147);\n"
"")
self.showMixingResult.setObjectName("showMixingResult")
self.gridLayout_9.addWidget(self.showMixingResult, 3, 0, 1, 3)
self.mixbrowse1 = QtWidgets.QPushButton(self.Mixer)
self.mixbrowse1.setMaximumSize(QtCore.QSize(200, 16777215))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.mixbrowse1.setFont(font)
self.mixbrowse1.setStyleSheet("color: rgb(0, 0, 0);\n"
"background-color: rgb(255, 255, 255);\n"
"gridline-color: rgb(85, 85, 255);\n"
"border-color: rgb(85, 85, 255);\n"
"selection-color: rgb(85, 85, 255);")
self.mixbrowse1.setObjectName("mixbrowse1")
self.gridLayout_9.addWidget(self.mixbrowse1, 0, 0, 1, 1)
self.mixerSpectrogramButton = QtWidgets.QPushButton(self.Mixer)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.mixerSpectrogramButton.setFont(font)
self.mixerSpectrogramButton.setStyleSheet("background-color: rgb(255, 170, 255);")
self.mixerSpectrogramButton.setObjectName("mixerSpectrogramButton")
self.gridLayout_9.addWidget(self.mixerSpectrogramButton, 4, 0, 1, 3)
self.tableView = QtWidgets.QTableView(self.Mixer)
self.tableView.setObjectName("tableView")
self.gridLayout_9.addWidget(self.tableView, 2, 0, 1, 3)
self.mixbrowse2 = QtWidgets.QPushButton(self.Mixer)
self.mixbrowse2.setMaximumSize(QtCore.QSize(200, 16777215))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.mixbrowse2.setFont(font)
self.mixbrowse2.setStyleSheet("color: rgb(0, 0, 0);\n"
"background-color: rgb(255, 255, 255);")
self.mixbrowse2.setObjectName("mixbrowse2")
self.gridLayout_9.addWidget(self.mixbrowse2, 0, 2, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_9.addItem(spacerItem, 0, 1, 1, 1)
self.gridLayout_10.addLayout(self.gridLayout_9, 0, 1, 1, 1)
self.verticalSlider_2 = QtWidgets.QSlider(self.Mixer)
self.verticalSlider_2.setSingleStep(10)
self.verticalSlider_2.setOrientation(QtCore.Qt.Vertical)
self.verticalSlider_2.setTickPosition(QtWidgets.QSlider.TicksBothSides)
self.verticalSlider_2.setObjectName("verticalSlider_2")
self.gridLayout_10.addWidget(self.verticalSlider_2, 0, 2, 1, 1)
self.gridLayout_11.addLayout(self.gridLayout_10, 0, 0, 1, 1)
self.tabWidget.addTab(self.Mixer, "")
self.mixingSoectrogram = QtWidgets.QWidget()
self.mixingSoectrogram.setObjectName("mixingSoectrogram")
self.gridLayout_3 = QtWidgets.QGridLayout(self.mixingSoectrogram)
self.gridLayout_3.setObjectName("gridLayout_3")
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setObjectName("gridLayout_2")
self.plottingGraph_4 = PlotWidget(self.mixingSoectrogram)
self.plottingGraph_4.setObjectName("plottingGraph_4")
self.gridLayout_2.addWidget(self.plottingGraph_4, 0, 0, 1, 3)
self.mixpausebutton = QtWidgets.QPushButton(self.mixingSoectrogram)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.mixpausebutton.setFont(font)
self.mixpausebutton.setStyleSheet("background-color: rgb(255, 214, 62);\n"
"\n"
"color: rgb(255, 255, 255);")
self.mixpausebutton.setObjectName("mixpausebutton")
self.gridLayout_2.addWidget(self.mixpausebutton, 1, 0, 1, 1)
self.mixplaybutton = QtWidgets.QPushButton(self.mixingSoectrogram)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.mixplaybutton.setFont(font)
self.mixplaybutton.setStyleSheet("background-color: rgb(0, 170, 0);\n"
"color: rgb(255, 255, 255);")
self.mixplaybutton.setObjectName("mixplaybutton")
self.gridLayout_2.addWidget(self.mixplaybutton, 1, 1, 1, 1)
self.mixstopbutton = QtWidgets.QPushButton(self.mixingSoectrogram)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.mixstopbutton.setFont(font)
self.mixstopbutton.setStyleSheet("background-color: rgb(255, 0, 4);\n"
"color: rgb(255, 255, 255);")
self.mixstopbutton.setObjectName("mixstopbutton")
self.gridLayout_2.addWidget(self.mixstopbutton, 1, 2, 1, 1)
self.gridLayout_3.addLayout(self.gridLayout_2, 3, 0, 1, 3)
self.label_6 = QtWidgets.QLabel(self.mixingSoectrogram)
self.label_6.setStyleSheet("font: 14pt \"MS Shell Dlg 2\";")
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
self.label_6.setObjectName("label_6")
self.gridLayout_3.addWidget(self.label_6, 2, 0, 1, 3)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.plottingGraph_2 = PlotWidget(self.mixingSoectrogram)
self.plottingGraph_2.setObjectName("plottingGraph_2")
self.gridLayout.addWidget(self.plottingGraph_2, 0, 0, 1, 1)
self.plottingGraph_3 = PlotWidget(self.mixingSoectrogram)
self.plottingGraph_3.setObjectName("plottingGraph_3")
self.gridLayout.addWidget(self.plottingGraph_3, 0, 1, 1, 1)
self.gridLayout_3.addLayout(self.gridLayout, 1, 0, 1, 3)
self.label_5 = QtWidgets.QLabel(self.mixingSoectrogram)
self.label_5.setMaximumSize(QtCore.QSize(120, 16777215))
self.label_5.setText("")
self.label_5.setObjectName("label_5")
self.gridLayout_3.addWidget(self.label_5, 0, 2, 1, 1)
self.label = QtWidgets.QLabel(self.mixingSoectrogram)
self.label.setText("")
self.label.setObjectName("label")
self.gridLayout_3.addWidget(self.label, 0, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(self.mixingSoectrogram)
self.label_4.setMaximumSize(QtCore.QSize(120, 16777215))
self.label_4.setText("")
self.label_4.setObjectName("label_4")
self.gridLayout_3.addWidget(self.label_4, 0, 0, 1, 1)
self.tabWidget.addTab(self.mixingSoectrogram, "")
self.gridLayout_6.addWidget(self.tabWidget, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_2.setText(_translate("MainWindow", "SONG INFO:"))
self.browseButton.setText(_translate("MainWindow", "Browse"))
self.recordingButton.setText(_translate("MainWindow", "Record"))
self.playButton.setText(_translate("MainWindow", "Play"))
self.label_3.setText(_translate("MainWindow", "SIMILAR SONGS"))
self.showResult.setText(_translate("MainWindow", "Show Result"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Sound Recogniser"))
self.comboBox.setItemText(0, _translate("MainWindow", "Choose Spectrogram"))
self.comboBox.setItemText(1, _translate("MainWindow", "Browsed audio"))
self.comboBox.setItemText(2, _translate("MainWindow", "Recorded Audio"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Spectrogram"))
self.showMixingResult.setText(_translate("MainWindow", "Show Result"))
self.mixbrowse1.setText(_translate("MainWindow", "SONG 1"))
self.mixerSpectrogramButton.setText(_translate("MainWindow", "Spectrogram"))
self.mixbrowse2.setText(_translate("MainWindow", "SONG 2"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.Mixer), _translate("MainWindow", "Mixer"))
self.mixpausebutton.setText(_translate("MainWindow", "PAUSE"))
self.mixplaybutton.setText(_translate("MainWindow", "PLAY"))
self.mixstopbutton.setText(_translate("MainWindow", "STOP"))
self.label_6.setText(_translate("MainWindow", "MIXED SPECTROGRAM"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.mixingSoectrogram), _translate("MainWindow", "Mixer Spectrogram"))
from pyqtgraph import PlotWidget