Skip to content
Snippets Groups Projects
Commit d008e7d1 authored by SeeLook's avatar SeeLook :musical_note:
Browse files

Make use of shorten instrument check/comparison calls

parent c4df0fca
No related branches found
No related tags found
No related merge requests found
Pipeline #3293 skipped
......@@ -41,7 +41,7 @@ Score {
scoreObj.enableDoubleAccidentals: GLOB.enableDoubleAccids
scoreObj.enharmNotesEnabled: GLOB.showEnharmNotes
scoreObj.bgColor: activPal.base
scoreObj.enableTechnical: GLOB.instrument.type === Tinstrument.Bandoneon
scoreObj.enableTechnical: GLOB.instrument.bandoneon
TmainScoreObject {
id: mainObj
......
......@@ -46,7 +46,7 @@ Flickable {
instrument = Qt.createComponent("qrc:/instruments/" + GLOB.instrument.qmlFile + ".qml").createObject(sizable)
else
instrument = null
if (GLOB.instrument.type === Tinstrument.Piano)
if (GLOB.instrument.piano)
instrument.setAmbitus(score.scoreObj.lowestNote(), score.scoreObj.highestNote())
NOO.instrument = instrument
if (instrument && !GLOB.instrument.isSax)
......@@ -55,7 +55,7 @@ Flickable {
Connections {
target: score
enabled: GLOB.instrument.type === Tinstrument.Piano
enabled: GLOB.instrument.piano
onClefChanged: instrument.setAmbitus(score.scoreObj.lowestNote(), score.scoreObj.highestNote())
}
}
......@@ -50,7 +50,7 @@ Flickable {
else
setTuning(NOO.tuning(Ttune.Standard_EADGBE))
fretsNrSpin.value = ins.fretNumber
} else if (ins.type === Tinstrument.NoInstrument) {
} else if (ins.none) {
setTuning(NOO.tuning(score.scoreObj.lowestNote(), score.scoreObj.highestNote(), NOO.emptyNote(), NOO.emptyNote(), NOO.emptyNote(), NOO.emptyNote()))
}
}
......@@ -92,7 +92,7 @@ Flickable {
id: tuningCombo
visible: instrSel.instrument !== 0
width: NOO.factor() * 18
model: GLOB.instrument.type === Tinstrument.BassGuitar ? NOO.bassTunings() : NOO.guitarTunings()
model: GLOB.instrument.bassGuitar ? NOO.bassTunings() : NOO.guitarTunings()
}
}
Item {
......@@ -215,7 +215,7 @@ Flickable {
GLOB.tuning.string(4), GLOB.tuning.string(5), GLOB.tuning.string(6)))
tuningCombo.currentIndex = tuningCombo.count - 1
} else {
tuningCombo.currentIndex = GLOB.tuning.type - (GLOB.instrument.type === Tinstrument.BassGuitar ? 100 : 0)
tuningCombo.currentIndex = GLOB.tuning.type - (GLOB.instrument.bassGuitar ? 100 : 0)
setTuning(NOO.tuning(GLOB.tuning.type))
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment