Skip to content

Commit 88320ae

Browse files
committed
fixed tuning plugins
1 parent 27ce714 commit 88320ae

File tree

3 files changed

+100
-152
lines changed

3 files changed

+100
-152
lines changed

share/plugins/tuning/tuning.qml

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

17-
import QtQuick 2.2
18-
import QtQuick.Controls 2.15
19-
import QtQuick.Layouts 1.15
17+
import QtQuick
18+
import QtQuick.Controls
19+
import QtQuick.Layouts
2020

2121
import MuseScore 3.0
2222
import FileIO 3.0
@@ -739,115 +739,104 @@ MuseScore {
739739
Item {
740740
anchors.fill: parent
741741

742+
ButtonGroup { id: temperamentTypeGroup }
743+
744+
component TuningItem: RadioButton {
745+
padding: 4
746+
ButtonGroup.group: temperamentTypeGroup
747+
}
748+
742749
GridLayout {
743750
columns: 2
744751
anchors.fill: parent
745752
anchors.margins: 10
746753
GroupBox {
747754
title: "Temperament"
748755
ColumnLayout {
749-
ButtonGroup { id: tempamentTypeGroup }
750-
RadioButton {
756+
TuningItem {
751757
id: equal_button
752758
text: "Equal"
753759
checked: true
754-
ButtonGroup.group: tempamentTypeGroup
755760
onClicked: { temperamentClicked(equal) }
756761
}
757-
RadioButton {
762+
TuningItem {
758763
id: pythagorean_button
759764
text: "Pythagorean"
760-
ButtonGroup.group: tempamentTypeGroup
761765
onClicked: { temperamentClicked(pythagorean) }
762766
}
763-
RadioButton {
767+
TuningItem {
764768
id: aaron_button
765769
text: "Aaron"
766-
ButtonGroup.group: tempamentTypeGroup
767770
onClicked: { temperamentClicked(aaron) }
768771
}
769-
RadioButton {
772+
TuningItem {
770773
id: silberman_button
771774
text: "Silberman"
772-
ButtonGroup.group: tempamentTypeGroup
773775
onClicked: { temperamentClicked(silberman) }
774776
}
775-
RadioButton {
777+
TuningItem {
776778
id: salinas_button
777779
text: "Salinas"
778-
ButtonGroup.group: tempamentTypeGroup
779780
onClicked: { temperamentClicked(salinas) }
780781
}
781-
RadioButton {
782+
TuningItem {
782783
id: kirnberger_button
783784
text: "Kirnberger"
784-
ButtonGroup.group: tempamentTypeGroup
785785
onClicked: { temperamentClicked(kirnberger) }
786786
}
787-
RadioButton {
787+
TuningItem {
788788
id: vallotti_button
789789
text: "Vallotti"
790-
ButtonGroup.group: tempamentTypeGroup
791790
onClicked: { temperamentClicked(vallotti) }
792791
}
793-
RadioButton {
792+
TuningItem {
794793
id: werkmeister_button
795794
text: "Werkmeister"
796-
ButtonGroup.group: tempamentTypeGroup
797795
onClicked: { temperamentClicked(werkmeister) }
798796
}
799-
RadioButton {
797+
TuningItem {
800798
id: marpurg_button
801799
text: "Marpurg"
802-
ButtonGroup.group: tempamentTypeGroup
803800
onClicked: { temperamentClicked(marpurg) }
804801
}
805-
RadioButton {
802+
TuningItem {
806803
id: just_button
807804
text: "Just"
808-
ButtonGroup.group: tempamentTypeGroup
809805
onClicked: { temperamentClicked(just) }
810806
}
811-
RadioButton {
807+
TuningItem {
812808
id: meanSemitone_button
813809
text: "Mean Semitone"
814-
ButtonGroup.group: tempamentTypeGroup
815810
onClicked: { temperamentClicked(meanSemitone) }
816811
}
817-
RadioButton {
812+
TuningItem {
818813
id: grammateus_button
819814
text: "Grammateus"
820-
ButtonGroup.group: tempamentTypeGroup
821815
onClicked: { temperamentClicked(grammateus) }
822816
}
823-
RadioButton {
817+
TuningItem {
824818
id: french_button
825819
text: "French"
826-
ButtonGroup.group: tempamentTypeGroup
827820
onClicked: { temperamentClicked(french) }
828821
}
829-
RadioButton {
822+
TuningItem {
830823
id: french2_button
831824
text: "Tempérament Ordinaire"
832-
ButtonGroup.group: tempamentTypeGroup
833825
onClicked: { temperamentClicked(french2) }
834826
}
835-
RadioButton {
827+
TuningItem {
836828
id: rameau_button
837829
text: "Rameau"
838-
ButtonGroup.group: tempamentTypeGroup
839830
onClicked: { temperamentClicked(rameau) }
840831
}
841-
RadioButton {
832+
TuningItem {
842833
id: irrFr17e_button
843834
text: "Irr Fr 17e"
844-
ButtonGroup.group: tempamentTypeGroup
845835
onClicked: { temperamentClicked(irrFr17e) }
846836
}
847-
RadioButton {
837+
TuningItem {
848838
id: bachLehman_button
849839
text: "Bach/Lehman"
850-
ButtonGroup.group: tempamentTypeGroup
851840
onClicked: { temperamentClicked(bachLehman) }
852841
}
853842
}
@@ -1288,7 +1277,6 @@ MuseScore {
12881277
id: annotateValue
12891278
text: qsTr("Annotate")
12901279
checked: false
1291-
onClicked: checked = !checked
12921280
}
12931281
}
12941282
}

share/plugins/tuning_modal/Modal_Tuning.qml

Lines changed: 37 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

17-
import QtQuick 2.2
18-
import QtQuick.Controls 2.15
19-
import QtQuick.Layouts 1.15
17+
import QtQuick
18+
import QtQuick.Controls
19+
import QtQuick.Layouts
2020

2121
import MuseScore 3.0
2222
import FileIO 3.0
@@ -30,7 +30,7 @@ MuseScore {
3030
thumbnailName: "modal_tuning.png"
3131

3232
width: 860
33-
height: 722
33+
height: 740
3434

3535
property var offsetTextWidth: 40;
3636
property var offsetLabelAlignment: 0x02 | 0x40;
@@ -228,7 +228,7 @@ MuseScore {
228228
var selection = new scoreSelection()
229229
curScore.startCmd()
230230
selection.map(filterNotes, reTune(getFinalTuning()))
231-
if (annotateValue.checkedState == Qt.Checked) {
231+
if (annotateValue.checked) {
232232
selection.map(filterNotes, annotate)
233233
}
234234
curScore.endCmd()
@@ -823,163 +823,144 @@ MuseScore {
823823
Item {
824824
anchors.fill: parent
825825

826+
ButtonGroup { id: temperamentTypeGroup }
827+
828+
component TuningItem: RadioButton {
829+
padding: 2
830+
ButtonGroup.group: temperamentTypeGroup
831+
}
832+
826833
GridLayout {
827834
columns: 2
828835
anchors.fill: parent
829836
anchors.margins: 10
830837
GroupBox {
831838
title: "Tuning"
832839
ColumnLayout {
833-
ButtonGroup { id: tempamentTypeGroup }
834-
RadioButton {
840+
TuningItem {
835841
id: equal_button
836842
text: "Equal"
837843
checked: true
838-
ButtonGroup.group: tempamentTypeGroup
839844
onClicked: { temperamentClicked(equal) }
840845
}
841-
RadioButton {
846+
TuningItem {
842847
id: tuning01_button
843848
text: "Melodic 1# 2b"
844-
ButtonGroup.group: tempamentTypeGroup
845849
onClicked: { temperamentClicked(tuning01) }
846850
}
847-
RadioButton {
851+
TuningItem {
848852
id: tuning02_button
849853
text: "Harmonic 1# 2b"
850-
ButtonGroup.group: tempamentTypeGroup
851854
onClicked: { temperamentClicked(tuning02) }
852855
}
853-
RadioButton {
856+
TuningItem {
854857
id: tuning03_button
855858
text: "Rast, Sikah"
856-
ButtonGroup.group: tempamentTypeGroup
857859
onClicked: { temperamentClicked(tuning03) }
858860
}
859-
RadioButton {
861+
TuningItem {
860862
id: tuning04_button
861863
text: "Suznak, Huzam"
862-
ButtonGroup.group: tempamentTypeGroup
863864
onClicked: { temperamentClicked(tuning04) }
864865
}
865-
RadioButton {
866+
TuningItem {
866867
id: tuning05_button
867868
text: "Nayruz"
868-
ButtonGroup.group: tempamentTypeGroup
869869
onClicked: { temperamentClicked(tuning05) }
870870
}
871-
RadioButton {
871+
TuningItem {
872872
id: tuning06_button
873873
text: "Bayati, Kurd, Huseyni"
874-
ButtonGroup.group: tempamentTypeGroup
875874
onClicked: { temperamentClicked(tuning06) }
876875
}
877-
RadioButton {
876+
TuningItem {
878877
id: tuning07_button
879878
text: "Qarjighar"
880-
ButtonGroup.group: tempamentTypeGroup
881879
onClicked: { temperamentClicked(tuning07) }
882880
}
883-
RadioButton {
881+
TuningItem {
884882
id: tuning08_button
885883
text: "Saba, Basta Nikar, Zanjaran"
886-
ButtonGroup.group: tempamentTypeGroup
887884
onClicked: { temperamentClicked(tuning08) }
888885
}
889-
RadioButton {
886+
TuningItem {
890887
id: tuning09_button
891888
text: "Hijaz, Nikriz"
892-
ButtonGroup.group: tempamentTypeGroup
893889
onClicked: { temperamentClicked(tuning09) }
894890
}
895-
RadioButton {
891+
TuningItem {
896892
id: tuning10_button
897893
text: "Nawa'athar, Shad Araban"
898-
ButtonGroup.group: tempamentTypeGroup
899894
onClicked: { temperamentClicked(tuning10) }
900895
}
901-
RadioButton {
896+
TuningItem {
902897
id: tuning11_button
903898
text: "Shehnaz"
904-
ButtonGroup.group: tempamentTypeGroup
905899
onClicked: { temperamentClicked(tuning11) }
906900
}
907-
RadioButton {
901+
TuningItem {
908902
id: tuning12_button
909903
text: "Nahawand, Hijaz Kar"
910-
ButtonGroup.group: tempamentTypeGroup
911904
onClicked: { temperamentClicked(tuning12) }
912905
}
913-
RadioButton {
906+
TuningItem {
914907
id: tuning13_button
915908
text: "Nahawand, Hijaz Kar Kurd"
916-
ButtonGroup.group: tempamentTypeGroup
917909
onClicked: { temperamentClicked(tuning13) }
918910
}
919-
RadioButton {
911+
TuningItem {
920912
id: tuning14_button
921913
text: "Iraq, Yekah, Nawa"
922-
ButtonGroup.group: tempamentTypeGroup
923914
onClicked: { temperamentClicked(tuning14) }
924915
}
925-
RadioButton {
916+
TuningItem {
926917
id: tuning15_button
927918
text: "Farahnak, Yekah, Nawa"
928-
ButtonGroup.group: tempamentTypeGroup
929919
onClicked: { temperamentClicked(tuning15) }
930920
}
931-
RadioButton {
921+
TuningItem {
932922
id: tuning16_button
933923
text: "Jiharkah"
934-
ButtonGroup.group: tempamentTypeGroup
935924
onClicked: { temperamentClicked(tuning16) }
936925
}
937-
RadioButton {
926+
TuningItem {
938927
id: tuning17_button
939928
text: "Ajam Ashyran, Shawq Afza"
940-
ButtonGroup.group: tempamentTypeGroup
941929
onClicked: { temperamentClicked(tuning17) }
942930
}
943-
RadioButton {
931+
TuningItem {
944932
id: tuning18_button
945933
text: "Hisar"
946-
ButtonGroup.group: tempamentTypeGroup
947934
onClicked: { temperamentClicked(tuning18) }
948935
}
949-
RadioButton {
936+
TuningItem {
950937
id: tuning19_button
951938
text: "Nishaburek (Rast in D & A)"
952-
ButtonGroup.group: tempamentTypeGroup
953939
onClicked: { temperamentClicked(tuning19) }
954940
}
955-
RadioButton {
941+
TuningItem {
956942
id: tuning20_button
957943
text: "Nishaburek (Rast in D, Bayati in A)"
958-
ButtonGroup.group: tempamentTypeGroup
959944
onClicked: { temperamentClicked(tuning20) }
960945
}
961-
RadioButton {
946+
TuningItem {
962947
id: tuning21_button
963948
text: "Saba Zamzam"
964-
ButtonGroup.group: tempamentTypeGroup
965949
onClicked: { temperamentClicked(tuning21) }
966950
}
967-
RadioButton {
951+
TuningItem {
968952
id: tuning22_button
969953
text: "Rakb"
970-
ButtonGroup.group: tempamentTypeGroup
971954
onClicked: { temperamentClicked(tuning22) }
972955
}
973-
RadioButton {
956+
TuningItem {
974957
id: tuning23_button
975958
text: "Sikah Baladi"
976-
ButtonGroup.group: tempamentTypeGroup
977959
onClicked: { temperamentClicked(tuning23) }
978960
}
979-
RadioButton {
961+
TuningItem {
980962
id: tuning24_button
981963
text: "Iraq (Cadence)"
982-
ButtonGroup.group: tempamentTypeGroup
983964
onClicked: { temperamentClicked(tuning24) }
984965
}
985966
}
@@ -1421,7 +1402,6 @@ MuseScore {
14211402
id: annotateValue
14221403
text: qsTr("Annotate")
14231404
checked: false
1424-
onClicked: checked = !checked
14251405
}
14261406
}
14271407
}

0 commit comments

Comments
 (0)