Skip to content
Snippets Groups Projects
Commit e1f48a26 authored by SeeLook's avatar SeeLook
Browse files

[Wizard]Initialize all needed props for selected instrument (tuning/scale,...

[Wizard]Initialize all needed props for selected instrument (tuning/scale, sound params, etc.). Key shortcuts for moving wizard pages
parent 6cabd0bb
Branches
Tags
No related merge requests found
1.5.3 beta1
- restored charts (analysis) with updated look
- improved start wizard to handle more supported instruments
1.5.2 alpha3
- adding/deleting notes to score works like in text editor
......
......@@ -91,25 +91,29 @@ ApplicationWindow {
color: Qt.tint(activPal.window, Noo.alpha(aboutPage.color, 50)) // Qt.darker(activPal.window, 0.9)
Rectangle { color: aboutPage.color; height: fontSize / 6; width: parent.width; anchors.top: parent.top }
TcuteButton {
id: prevBut
anchors.verticalCenter: parent.verticalCenter
x: parent.width / 2 - width - fontSize
id: prevBut
text: Noo.TR("QWizard", "< &Back").replace("&", "")
enabled: swipe.currentIndex > 0
onClicked: swipe.currentIndex -= 1
Shortcut { sequence: StandardKey.MoveToPreviousChar; onActivated: { if (prevBut.enabled) swipe.currentIndex -= 1 }}
}
TcuteButton {
id: nextBut
anchors.verticalCenter: parent.verticalCenter
x: parent.width / 2 + fontSize
text: Noo.TR("QWizard", "&Next >").replace("&", "")
enabled: swipe.currentIndex < swipe.count - 1
onClicked: swipe.currentIndex += 1
Shortcut { sequence: StandardKey.MoveToNextChar; onActivated: { if (nextBut.enabled) swipe.currentIndex += 1 }}
}
TcuteButton {
anchors.verticalCenter: parent.verticalCenter
x: parent.width - width - fontSize
text: Noo.TR("QWizard", "&Finish").replace("&", "")
onClicked: nootkaWindow.close()
Shortcut { sequence: "Return"; onActivated: nootkaWindow.close() }
}
}
......@@ -118,8 +122,9 @@ ApplicationWindow {
GLOB.setInstrument(instrPage.getInstrument())
clefPage.setInstrParams()
optionsPage.setOptions()
GLOB.keyNameStyle = (Noo.keyNameTranslated() !== "letters" ? (Qt.locale().name.indexOf("ru") === -1 ? 2 : 5) : (is7B ? 3 : 0))
GLOB.keyNameStyle = (Noo.keyNameTranslated() !== "letters" ? (Qt.locale().name.indexOf("ru") === -1 ? 2 : 5) : (GLOB.seventhIsB ? 3 : 0))
GLOB.updateKeySignatureNames()
GLOB.audioInstrument = instrPage.getInstrument()
GLOB.preferFlats = GLOB.instrument.isSax ? true : false
Qt.quit()
}
......
......@@ -21,13 +21,36 @@ Tflickable {
}
function setInstrParams() {
if (instrDetails && nootkaWindow.instrument === 0) {
var selectedIns = instrPage.getInstrument()
if (instrDetails && selectedIns === 0) {
GLOB.clefType = instrDetails.clef
GLOB.transposition = instrDetails.transposition
} else {
GLOB.clefType = Noo.instr(nootkaWindow.instrument).clef
GLOB.transposition = Noo.instr(nootkaWindow.instrument).transposition
GLOB.clefType = Noo.instr(selectedIns).clef
if (instrDetails && (selectedIns === 6 || selectedIns === 7)) // saxophones
GLOB.transposition = instrDetails.transposition
else
GLOB.transposition = Noo.instr(selectedIns).transposition
}
var tuning
if (selectedIns === 3) // bass
tuning = Noo.tuning(100)
else if (selectedIns === 1 || selectedIns === 2) // guitars
tuning = Noo.tuning(0)
else if (selectedIns === 0) {
if (instrDetails)
tuning = Noo.tuning(Noo.transpose(instrDetails.getNote(0), GLOB.transposition), Noo.transpose(instrDetails.getNote(1), GLOB.transposition),
Noo.emptyNote(), Noo.emptyNote(), Noo.emptyNote(), Noo.emptyNote())
else
tuning = Noo.tuning(Noo.note(10), Noo.note(54), Noo.emptyNote(), Noo.emptyNote(), Noo.emptyNote(), Noo.emptyNote())
}
GLOB.minSplitVol = GLOB.instrument.minSplitVol
GLOB.skipStillerVal = GLOB.instrument.skipStillerVal
if (GLOB.instrument.isGuitar)
GLOB.setGuitarParams(GLOB.instrument.fretNumber, tuning)
else if (selectedIns === 0)
GLOB.setGuitarParams(0, tuning)
}
// private
......
......@@ -16,6 +16,10 @@ Column {
width: parent ? parent.width : 0
spacing: Noo.fontSize()
function getNote(noteNr) {
return score.scoreObj.noteAt(noteNr)
}
Text {
width: parent.width
font { pixelSize: Noo.fontSize() * 2; bold: true }
......@@ -40,8 +44,8 @@ Column {
addNote(scoreObj.highestNote())
}
onClefChanged: {
setNote(scoreObj.note(0), scoreObj.lowestNote())
setNote(scoreObj.note(1), scoreObj.highestNote())
score.scoreObj.setNote(0, score.scoreObj.lowestNote())
score.scoreObj.setNote(1, score.scoreObj.highestNote())
}
}
}
......
......@@ -8,6 +8,8 @@ import "../"
Column {
property alias transposition: transpose.outShift
spacing: Noo.fontSize()
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * 0.9
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment