-
Notifications
You must be signed in to change notification settings - Fork 0
/
fretboard_ui.py
163 lines (148 loc) · 7.88 KB
/
fretboard_ui.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fretboard.ui'
#
# Created by: PyQt5 UI code generator 5.15.11
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow, strings=...):
if strings==...:
strings=6
self.strings=strings
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1301, 581)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.titleLabel = QtWidgets.QLabel(self.centralwidget)
self.titleLabel.setMaximumSize(QtCore.QSize(16777215, 100))
font = QtGui.QFont()
font.setPointSize(20)
self.titleLabel.setFont(font)
self.titleLabel.setObjectName("titleLabel")
self.verticalLayout.addWidget(self.titleLabel)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.tuningButtons = [ QLineEditTabReact(self.centralwidget) for i in range(strings) ]
for i, button in enumerate(self.tuningButtons):
button.setMinimumSize(QtCore.QSize(40, 40))
button.setMaximumSize(QtCore.QSize(40, 16777215))
font = QtGui.QFont()
font.setPointSize(12)
button.setFont(font)
button.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout.addWidget(button, i, 0, 1, 1)
self.tuningButtons.reverse()
self.nutButton = QtWidgets.QPushButton(self.centralwidget)
self.nutButton.setMinimumSize(QtCore.QSize(40, 40))
self.nutButton.setMaximumSize(QtCore.QSize(40, 40))
font = QtGui.QFont()
font.setPointSize(12)
self.nutButton.setFont(font)
self.nutButton.setObjectName("nutButton")
self.gridLayout.addWidget(self.nutButton, strings, 0, 1, 1)
self.verticalLayout.addLayout(self.gridLayout)
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem1)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_2 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.notesOrIntervalsSlider = QtWidgets.QSlider(self.centralwidget)
self.notesOrIntervalsSlider.setMaximum(1)
self.notesOrIntervalsSlider.setPageStep(1)
self.notesOrIntervalsSlider.setOrientation(QtCore.Qt.Horizontal)
self.notesOrIntervalsSlider.setObjectName("notesOrIntervalsSlider")
self.horizontalLayout.addWidget(self.notesOrIntervalsSlider)
self.label_3 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.horizontalLayout.addWidget(self.label_3)
self.horizontalLayout_4.addLayout(self.horizontalLayout)
self.line = QtWidgets.QFrame(self.centralwidget)
self.line.setFrameShape(QtWidgets.QFrame.VLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.horizontalLayout_4.addWidget(self.line)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_4 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.horizontalLayout_2.addWidget(self.label_4)
self.scaleOrChordSlider = QtWidgets.QSlider(self.centralwidget)
self.scaleOrChordSlider.setMaximum(1)
self.scaleOrChordSlider.setPageStep(1)
self.scaleOrChordSlider.setOrientation(QtCore.Qt.Horizontal)
self.scaleOrChordSlider.setObjectName("scaleOrChordSlider")
self.horizontalLayout_2.addWidget(self.scaleOrChordSlider)
self.label_5 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.label_5.setFont(font)
self.label_5.setObjectName("label_5")
self.horizontalLayout_2.addWidget(self.label_5)
self.horizontalLayout_4.addLayout(self.horizontalLayout_2)
self.line_2 = QtWidgets.QFrame(self.centralwidget)
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.horizontalLayout_4.addWidget(self.line_2)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.rootNoteSelector = QComboBoxWithKeyEvents(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.rootNoteSelector.setFont(font)
self.rootNoteSelector.setObjectName("rootNoteSelector")
self.horizontalLayout_3.addWidget(self.rootNoteSelector)
self.scaleOrChordTypeSelector = QComboBoxWithKeyEvents(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.scaleOrChordTypeSelector.setFont(font)
self.scaleOrChordTypeSelector.setObjectName("scaleOrChordTypeSelector")
self.horizontalLayout_3.addWidget(self.scaleOrChordTypeSelector)
self.horizontalLayout_4.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4.setStretch(4, 10)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.horizontalLayout_5.addLayout(self.verticalLayout)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
for i in range(strings-1):
MainWindow.setTabOrder(self.tuningButtons[i], self.tuningButtons[i+1])
MainWindow.setTabOrder(self.tuningButtons[strings-1], self.rootNoteSelector)
MainWindow.setTabOrder(self.rootNoteSelector, self.scaleOrChordTypeSelector)
MainWindow.setTabOrder(self.scaleOrChordTypeSelector, self.notesOrIntervalsSlider)
MainWindow.setTabOrder(self.notesOrIntervalsSlider, self.scaleOrChordSlider)
MainWindow.setTabOrder(self.scaleOrChordSlider, self.nutButton)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.titleLabel.setText(_translate("MainWindow", "C major scale: C D E F G A B"))
self.nutButton.setText(_translate("MainWindow", "N"))
self.label_2.setText(_translate("MainWindow", "Notes"))
self.label_3.setText(_translate("MainWindow", "Intervals"))
self.label_4.setText(_translate("MainWindow", "Scale"))
self.label_5.setText(_translate("MainWindow", "Chord"))
from overloadedQtClasses import QComboBoxWithKeyEvents, QLineEditTabReact