Skip to content
Snippets Groups Projects
WizardOther.qml 2.2 KiB
Newer Older
  • Learn to ignore specific revisions
  • /** This file is part of Nootka (http://nootka.sf.net)               *
    
     * Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com)     *
    
     * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses)   */
    
    import "../"
    import "../score"
    
    SeeLook's avatar
    SeeLook committed
    import Nootka 1.0
    
    import QtQuick
    import Nootka.Music
    
    SeeLook's avatar
    SeeLook committed
    import Score 1.0
    
    SeeLook's avatar
    SeeLook committed
        property alias transposition: transpose.outShift
        property alias clef: score.clef
    
        function getNote(noteNr) {
            return score.scoreObj.noteAt(noteNr);
        }
    
        width: parent ? parent.width : 0
        spacing: NOO.factor()
    
        Text {
            width: parent.width
            wrapMode: Text.WordWrap
            horizontalAlignment: Text.AlignHCenter
            color: activPal.text
            text: qsTr("Select a clef and scale of notes appropriate for your instrument.")
    
            font {
                pixelSize: NOO.factor() * (NOO.isAndroid() ? 1.2 : 1.5)
                bold: true
    
    SeeLook's avatar
    SeeLook committed
    
        }
    
        Tile {
            width: score.width + NOO.factor() * 3
            bgColor: nootkaWindow.bgColor
    
            bgBorder {
                width: 2
                color: nootkaWindow.labelColor
    
    SeeLook's avatar
    SeeLook committed
    
            Item {
                width: score.width
                height: score.height
                anchors.horizontalCenter: parent.horizontalCenter
    
                Score {
                    id: score
    
                    height: Math.max(NOO.factor() * 18, nootkaWindow.height * 0.4)
                    width: Math.max(NOO.factor() * 12, nootkaWindow.height / 4)
                    scale: height / firstStaff.linesCount
                    bgColor: "transparent"
                    meter: Tmeter.NoMeter
                    scoreObj.editMode: true
                    scoreObj.showNoteNames: true
                    scoreObj.nameColor: GLOB.nameColor
                    scoreObj.nameStyle: GLOB.noteNameStyle
                    Component.onCompleted: {
                        addNote(scoreObj.lowestNote());
                        addNote(scoreObj.highestNote());
                    }
                    onClefChanged: {
                        score.scoreObj.setNote(0, score.scoreObj.lowestNote());
                        score.scoreObj.setNote(1, score.scoreObj.highestNote());
                    }
                }
    
            }
    
        }
    
        Transposition {
            id: transpose
    
            shift: 0