diff options
Diffstat (limited to 'demos/mobile/guitartuner/src/mycomponents')
43 files changed, 0 insertions, 644 deletions
diff --git a/demos/mobile/guitartuner/src/mycomponents/adjustbars.js b/demos/mobile/guitartuner/src/mycomponents/adjustbars.js deleted file mode 100644 index a96292d..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/adjustbars.js +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* JavaScript functions for creating, handling and - * destroying the bars of the adjuster component. */ - -var maxBars = 10; -var firstBarHeight = 5; -var bars = new Array(maxBars); -var colors = new Array(maxBars); -var barWidthFactor = 2.3; - -function createBars() { - var barWidth = adjuster.width/maxBars/barWidthFactor; - for (var i = 1; i <= maxBars; i++) { - //Create, configure and store the bars. - var bar = Qt.createQmlObject('import QtQuick 1.0; Rectangle {smooth: true}', adjuster, "dynamicBar"); - bar.width = barWidth; - bar.height = firstBarHeight+(i/maxBars)*(adjuster.height*0.8-firstBarHeight); - bar.radius = bar.width/2; - bar.x = (i-1)*(barWidthFactor*barWidth); - bar.y = adjuster.height/2 - bar.height/2; - bars[i-1] = bar; - - //Calculate and store the colors - if (i < maxBars/2) { - colors[i-1] = Qt.rgba(1-i/(maxBars/2), 1, 1-i/(maxBars/2), i); - } - else { - colors[i-1] = Qt.rgba((i-(maxBars/2))/(maxBars/2), 1-((i-(maxBars/2))/(maxBars/2)), 0, i); - } - } -} - -function destroyBars() { - for (var i = 0; i < maxBars; i++) { - bars[i].color = "transparent" //Colors must be set to transparent or otherwise the bars will stay appeared. - bars[i].destroy(); - } -} - -function fillBars(barNumber) { - //Set the color for the bars (transparent from the selected bar to the end). - for (var i = 0; i < maxBars; i++) { - if (i < barNumber) { - bars[i].color = colors[i]; - } - else { - bars[i].color = "black"; - } - } -} diff --git a/demos/mobile/guitartuner/src/mycomponents/adjuster.qml b/demos/mobile/guitartuner/src/mycomponents/adjuster.qml deleted file mode 100755 index 8f43740..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/adjuster.qml +++ /dev/null @@ -1,124 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * Contact: Nokia Corporation (qt-info@nokia.com) - * - * $QT_BEGIN_LICENSE:BSD$ - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the author organization nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $QT_END_LICENSE$ - * - *****************************************************************************/ - -import QtQuick 1.0 -import "adjustbars.js" as AdjustBars - -/* A barchart-like adjuster component. */ -Rectangle { - id: adjuster - - property real max: 100 - property real value: 0 - property bool created: false - - signal valueChanged(real value) - signal focusChangedByClick() - signal arrowPressedWhenValueOverLimits() - - function setValue(pValue) { - value = pValue; - AdjustBars.fillBars(value/max*AdjustBars.maxBars); - valueChanged(value); - } - - height: 60; width: 300 - color: "transparent" - Keys.onRightPressed: { - var val = value+max/AdjustBars.maxBars; - if (val <= max) { - value = val; - AdjustBars.fillBars(value/max*AdjustBars.maxBars); - valueChanged(value); - } - else { - arrowPressedWhenValueOverLimits() - } - } - Keys.onLeftPressed: { - var val = value-max/AdjustBars.maxBars; - if (0 <= val) { - value = val; - AdjustBars.fillBars(value/max*AdjustBars.maxBars); - valueChanged(value); - } - else { - arrowPressedWhenValueOverLimits() - } - } - Component.onCompleted: { - AdjustBars.createBars(); - AdjustBars.fillBars(value/max*AdjustBars.maxBars); - created = true; - } - Component.onDestruction: { - AdjustBars.destroyBars; - } - //Dynamic objects have to be recreated when the window size changes. - onWidthChanged: { - if (created) { - AdjustBars.destroyBars(); - AdjustBars.createBars(); - AdjustBars.fillBars(value/max*AdjustBars.maxBars); - } - } - onHeightChanged: { - if (created) { - AdjustBars.destroyBars(); - AdjustBars.createBars(); - AdjustBars.fillBars(value/max*AdjustBars.maxBars); - } - } - - MouseArea { - anchors.fill: parent - onPositionChanged: { - focusChangedByClick(); - var val = mouse.x/parent.width*parent.max; - if (0 < val && val < max) { - parent.value = val; - AdjustBars.fillBars(parent.value/parent.max*AdjustBars.maxBars); - valueChanged(parent.value); - } - } - onClicked: { - focusChangedByClick(); - var val = mouse.x/parent.width*parent.max; - if (0 < val && val < max) { - parent.value = val; - AdjustBars.fillBars(parent.value/parent.max*AdjustBars.maxBars); - valueChanged(parent.value); - } - } - } -} diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_a.png b/demos/mobile/guitartuner/src/mycomponents/images/big_a.png Binary files differdeleted file mode 100644 index 3838e76..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/big_a.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_b.png b/demos/mobile/guitartuner/src/mycomponents/images/big_b.png Binary files differdeleted file mode 100644 index 114b32d..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/big_b.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_d.png b/demos/mobile/guitartuner/src/mycomponents/images/big_d.png Binary files differdeleted file mode 100644 index 3ede9f0..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/big_d.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_e.png b/demos/mobile/guitartuner/src/mycomponents/images/big_e.png Binary files differdeleted file mode 100644 index cc1f488..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/big_e.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_g.png b/demos/mobile/guitartuner/src/mycomponents/images/big_g.png Binary files differdeleted file mode 100644 index 804177b..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/big_g.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png Binary files differdeleted file mode 100644 index b6fd0e2..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png Binary files differdeleted file mode 100644 index b5fa016..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png Binary files differdeleted file mode 100644 index 32f1a29..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png Binary files differdeleted file mode 100644 index 4be9f2a..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png Binary files differdeleted file mode 100644 index 4216d82..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png Binary files differdeleted file mode 100644 index dbe3fc7..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png Binary files differdeleted file mode 100644 index 5d53df9..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png b/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png Binary files differdeleted file mode 100644 index ff8dffc..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png b/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png Binary files differdeleted file mode 100644 index 4046355..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/mute.png b/demos/mobile/guitartuner/src/mycomponents/images/mute.png Binary files differdeleted file mode 100644 index 382e6047..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/mute.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/pointer.png b/demos/mobile/guitartuner/src/mycomponents/images/pointer.png Binary files differdeleted file mode 100644 index d0cb21b..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/pointer.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png b/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png Binary files differdeleted file mode 100644 index a708639..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/power.png b/demos/mobile/guitartuner/src/mycomponents/images/power.png Binary files differdeleted file mode 100644 index 8ec0c5c..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/power.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/quit.png b/demos/mobile/guitartuner/src/mycomponents/images/quit.png Binary files differdeleted file mode 100644 index 2a9443e..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/quit.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png b/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png Binary files differdeleted file mode 100644 index c3d2ea3..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png Binary files differdeleted file mode 100644 index a1823e5..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png Binary files differdeleted file mode 100644 index 7c78cbd..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png Binary files differdeleted file mode 100644 index b9e494b..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png Binary files differdeleted file mode 100644 index d5608d8..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png Binary files differdeleted file mode 100644 index 94977f8..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png Binary files differdeleted file mode 100644 index 78841dc..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png Binary files differdeleted file mode 100644 index 293ee55..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png Binary files differdeleted file mode 100644 index 705de41..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png Binary files differdeleted file mode 100644 index 569d2c6..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png Binary files differdeleted file mode 100644 index 1342a91..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png Binary files differdeleted file mode 100644 index a8f0de5..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png Binary files differdeleted file mode 100644 index 6fdca41..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png Binary files differdeleted file mode 100644 index 0701dd3..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png Binary files differdeleted file mode 100644 index 986d589..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/volume.png b/demos/mobile/guitartuner/src/mycomponents/images/volume.png Binary files differdeleted file mode 100644 index 46fdb7f..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/volume.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png b/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png Binary files differdeleted file mode 100644 index a97e422..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png +++ /dev/null diff --git a/demos/mobile/guitartuner/src/mycomponents/meter.qml b/demos/mobile/guitartuner/src/mycomponents/meter.qml deleted file mode 100755 index 151c62f..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/meter.qml +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * Contact: Nokia Corporation (qt-info@nokia.com) - * - * $QT_BEGIN_LICENSE:BSD$ - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the author organization nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $QT_END_LICENSE$ - * - *****************************************************************************/ - -import QtQuick 1.0 - -/* A meter component. */ -Rectangle { - id: meter - - property real value: 0 - property real minValue: -1 - property real maxValue: 1 - property alias imageSize: meterImage.sourceSize - - function valueChanged(pValue) { - value = pValue; - scaleValueToAngle(); - } - function scaleValueToAngle() { - pointer.angle = (((value-minValue)/(maxValue-minValue))* - (pointer.angleMax-pointer.angleMin))+ - pointer.angleMin; - } - - color: "transparent" - - Image { - id: meterImage - - smooth: true - source: "./images/meterBG.png" - anchors.fill: parent - } - - Image { - id:pointerShadow - - x: pointer.x - 2 - y: pointer.y - 2 - height: pointer.height - smooth: true - source: "./images/pointerShadow.png" - transform: Rotation { - origin.x: 2 - origin.y: height - angle: -pointer.angle - } - } - - Image { - id: pointer - - property real angle: 0 - property real angleMax: -45 - property real angleMin: 45 - - height: parent.height*0.92 - transformOrigin: "Bottom" - rotation: -angle - smooth: true - source: "./images/pointer.png" - anchors { - bottomMargin: 2 - bottom: parent.bottom; - horizontalCenter: parent.horizontalCenter - } - - Behavior on angle { - SpringAnimation { - spring: 1.4 - damping: 0.15 - } - } - } -} diff --git a/demos/mobile/guitartuner/src/mycomponents/notebuttonview.qml b/demos/mobile/guitartuner/src/mycomponents/notebuttonview.qml deleted file mode 100755 index 8e68c43..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/notebuttonview.qml +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * Contact: Nokia Corporation (qt-info@nokia.com) - * - * $QT_BEGIN_LICENSE:BSD$ - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the author organization nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $QT_END_LICENSE$ - * - *****************************************************************************/ - -import QtQuick 1.0 - -/* A view component for buttons for choosing notes. */ -ListView { - id: noteChooser - - property real currentFrequency: 82.407 - - signal noteSelected(string note, real frequency, int index) - - //Press down the button corresponding to the given note. - function pushButton(index) { - currentIndex = index; - } - - width: 50*model.count + spacing*(model.count-1); height: 50 - orientation: ListView.Horizontal - model: NotesModel {} - delegate: notesDelegate - keyNavigationWraps: true - boundsBehavior: Flickable.StopAtBounds - - Component { - id: notesDelegate - - ToggleButton { - id: noteButton - - width: height; height: noteChooser.height - offImageSource: offSource - onImageSource: onSource - state: noteButton.ListView.isCurrentItem ? "pressed" : "unPressed" - onSelected: { - noteChooser.noteSelected(note, frequency, index) - if (note != "Auto") { - currentFrequency = frequency - } - } - onPushed: { - noteButton.ListView.view.currentIndex = index - } - } - } -} diff --git a/demos/mobile/guitartuner/src/mycomponents/notesmodel.qml b/demos/mobile/guitartuner/src/mycomponents/notesmodel.qml deleted file mode 100755 index 297adb9..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/notesmodel.qml +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2011 Nokia Corporation. All rights reserved. - * - * Nokia and Nokia Connecting People are registered trademarks of Nokia - * Corporation. Oracle and Java are registered trademarks of Oracle and/or its - * affiliates. Other product and company names mentioned herein may be - * trademarks or trade names of their respective owners. - * - * - * Subject to the conditions below, you may, without charge: - * - * * Use, copy, modify and/or merge copies of this software and associated - * documentation files (the "Software") - * - * * Publish, distribute, sub-licence and/or sell new software derived from - * or incorporating the Software. - * - * - * - * This file, unmodified, shall be included with all copies or substantial - * portions of the Software that are distributed in source code form. - * - * The Software cannot constitute the primary value of any new software derived - * from or incorporating the Software. - * - * Any person dealing with the Software shall not misrepresent the source of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -import QtQuick 1.0 - -/* The model component for the NoteButtonView. */ -ListModel { - ListElement { - note: "E" - offSource: "./images/tuner_e.png" - onSource: "./images/tuner_e_on.png" - bigSource: "./mycomponents/images/big_e.png" - glowSource: "./mycomponents/images/glowing_e.png" - frequency: "82.407" - interval: "5" - } - ListElement { - note: "A" - offSource: "./images/tuner_a.png" - onSource: "./images/tuner_a_on.png" - bigSource: "./mycomponents/images/big_a.png" - glowSource: "./mycomponents/images/glowing_a.png" - frequency: "110.00" - interval: "5" - } - ListElement { - note: "D" - offSource: "./images/tuner_d.png" - onSource: "./images/tuner_d_on.png" - bigSource: "./mycomponents/images/big_d.png" - glowSource: "./mycomponents/images/glowing_d.png" - frequency: "146.83" - interval: "5" - } - ListElement { - note: "G" - offSource: "./images/tuner_g.png" - onSource: "./images/tuner_g_on.png" - bigSource: "./mycomponents/images/big_g.png" - glowSource: "./mycomponents/images/glowing_g.png" - frequency: "196.00" - interval: "4" - } - ListElement { - note: "B" - offSource: "./images/tuner_b.png" - onSource: "./images/tuner_b_on.png" - bigSource: "./mycomponents/images/big_b.png" - glowSource: "./mycomponents/images/glowing_b.png" - frequency: "246.94" - interval: "5" - } - ListElement { - note: "e" - offSource: "./images/tuner_e.png" - onSource: "./images/tuner_e_on.png" - bigSource: "./mycomponents/images/big_e.png" - glowSource: "./mycomponents/images/glowing_e.png" - frequency: "329.63" - interval: "9999" //Big enough that we can't move over this note - } - ListElement { - note: "Auto" - offSource: "./images/tuner_auto.png" - onSource: "./images/tuner_auto_on.png" - frequency: "82.407" - } -} diff --git a/demos/mobile/guitartuner/src/mycomponents/qmldir b/demos/mobile/guitartuner/src/mycomponents/qmldir deleted file mode 100644 index cad46c4..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/qmldir +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ -NotesModel ./notesmodel.qml -Adjuster ./adjuster.qml -Meter ./meter.qml -NoteButtonView ./notebuttonview.qml -ToggleButton ./togglebutton.qml diff --git a/demos/mobile/guitartuner/src/mycomponents/togglebutton.qml b/demos/mobile/guitartuner/src/mycomponents/togglebutton.qml deleted file mode 100755 index 47e4d41..0000000 --- a/demos/mobile/guitartuner/src/mycomponents/togglebutton.qml +++ /dev/null @@ -1,103 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * Contact: Nokia Corporation (qt-info@nokia.com) - * - * $QT_BEGIN_LICENSE:BSD$ - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the author organization nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $QT_END_LICENSE$ - * - *****************************************************************************/ - -import QtQuick 1.0 - -/* A toggle button component. */ -Rectangle { - id: toggleButton - - property url offImageSource: "" - property url onImageSource: "" - property alias imageSource: buttonImage.source - - signal selected() - signal pushed() - - color: "transparent" - state: "unPressed" - onStateChanged: { - if (state == "pressed") { - selected() - } - } - - Image { - id: buttonImage - - smooth: true - anchors.fill: parent - } - MouseArea { - id: mouseArea - - anchors.fill: parent - onPressed: { - if (parent.state == "unPressed") { - pushed() - } - } - } - - states: [ - State { - name: "pressed" - PropertyChanges { - target: toggleButton - scale: 0.95 - imageSource: onImageSource - } - }, - State { - name: "unPressed" - PropertyChanges { - target: toggleButton - scale: 1/0.95 - imageSource: offImageSource - } - } - ] - - transitions: [ - Transition { - from: "unPressed" - to: "pressed" - reversible: true - PropertyAnimation { - target: toggleButton - properties: "scale" - duration: 100 - } - } - ] -} |