summaryrefslogtreecommitdiffstats
path: root/examples/mobile/guitartuner/src/mycomponents
diff options
context:
space:
mode:
Diffstat (limited to 'examples/mobile/guitartuner/src/mycomponents')
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/Adjuster.qml132
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/Meter.qml113
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/NoteButtonView.qml85
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/NotesModel.qml106
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/ToggleButton.qml111
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/adjustbars.js89
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/big_a.pngbin0 -> 575 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/big_b.pngbin0 -> 599 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/big_d.pngbin0 -> 465 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/big_e.pngbin0 -> 327 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/big_g.pngbin0 -> 610 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/glowing_a.pngbin0 -> 2978 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/glowing_b.pngbin0 -> 3084 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/glowing_d.pngbin0 -> 2940 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/glowing_e.pngbin0 -> 2696 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/glowing_g.pngbin0 -> 3046 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.pngbin0 -> 143243 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.pngbin0 -> 129068 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/lcdFrame.pngbin0 -> 176107 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/meterBG.pngbin0 -> 8378 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/mute.pngbin0 -> 3630 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/pointer.pngbin0 -> 965 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/pointerShadow.pngbin0 -> 1694 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/power.pngbin0 -> 3190 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/quit.pngbin0 -> 1363 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/sensitivity.pngbin0 -> 835 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_a.pngbin0 -> 3233 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_a_on.pngbin0 -> 3068 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_auto.pngbin0 -> 3619 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.pngbin0 -> 3281 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_b.pngbin0 -> 3324 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_b_on.pngbin0 -> 3132 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_d.pngbin0 -> 3266 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_d_on.pngbin0 -> 3009 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_e.pngbin0 -> 3171 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_e_on.pngbin0 -> 2955 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_g.pngbin0 -> 3292 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/tuner_g_on.pngbin0 -> 3089 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/voicemode_off.pngbin0 -> 3775 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/voicemode_on.pngbin0 -> 3484 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/volume.pngbin0 -> 351 bytes
-rw-r--r--examples/mobile/guitartuner/src/mycomponents/images/volume_off.pngbin0 -> 2235 bytes
42 files changed, 636 insertions, 0 deletions
diff --git a/examples/mobile/guitartuner/src/mycomponents/Adjuster.qml b/examples/mobile/guitartuner/src/mycomponents/Adjuster.qml
new file mode 100644
index 00000000..9fa2b5e6
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/Adjuster.qml
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $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/examples/mobile/guitartuner/src/mycomponents/Meter.qml b/examples/mobile/guitartuner/src/mycomponents/Meter.qml
new file mode 100644
index 00000000..cfb764ed
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/Meter.qml
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $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/examples/mobile/guitartuner/src/mycomponents/NoteButtonView.qml b/examples/mobile/guitartuner/src/mycomponents/NoteButtonView.qml
new file mode 100644
index 00000000..45e5b259
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/NoteButtonView.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $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/examples/mobile/guitartuner/src/mycomponents/NotesModel.qml b/examples/mobile/guitartuner/src/mycomponents/NotesModel.qml
new file mode 100644
index 00000000..e69fa847
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/NotesModel.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+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/examples/mobile/guitartuner/src/mycomponents/ToggleButton.qml b/examples/mobile/guitartuner/src/mycomponents/ToggleButton.qml
new file mode 100644
index 00000000..956a0daf
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/ToggleButton.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $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
+ }
+ }
+ ]
+}
diff --git a/examples/mobile/guitartuner/src/mycomponents/adjustbars.js b/examples/mobile/guitartuner/src/mycomponents/adjustbars.js
new file mode 100644
index 00000000..053c10e0
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/adjustbars.js
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** 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/examples/mobile/guitartuner/src/mycomponents/images/big_a.png b/examples/mobile/guitartuner/src/mycomponents/images/big_a.png
new file mode 100644
index 00000000..3838e766
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/big_a.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/big_b.png b/examples/mobile/guitartuner/src/mycomponents/images/big_b.png
new file mode 100644
index 00000000..114b32d3
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/big_b.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/big_d.png b/examples/mobile/guitartuner/src/mycomponents/images/big_d.png
new file mode 100644
index 00000000..3ede9f0f
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/big_d.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/big_e.png b/examples/mobile/guitartuner/src/mycomponents/images/big_e.png
new file mode 100644
index 00000000..cc1f4885
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/big_e.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/big_g.png b/examples/mobile/guitartuner/src/mycomponents/images/big_g.png
new file mode 100644
index 00000000..804177b3
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/big_g.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/glowing_a.png b/examples/mobile/guitartuner/src/mycomponents/images/glowing_a.png
new file mode 100644
index 00000000..b6fd0e20
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/glowing_a.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/glowing_b.png b/examples/mobile/guitartuner/src/mycomponents/images/glowing_b.png
new file mode 100644
index 00000000..b5fa016a
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/glowing_b.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/glowing_d.png b/examples/mobile/guitartuner/src/mycomponents/images/glowing_d.png
new file mode 100644
index 00000000..32f1a291
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/glowing_d.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/glowing_e.png b/examples/mobile/guitartuner/src/mycomponents/images/glowing_e.png
new file mode 100644
index 00000000..4be9f2a7
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/glowing_e.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/glowing_g.png b/examples/mobile/guitartuner/src/mycomponents/images/glowing_g.png
new file mode 100644
index 00000000..4216d828
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/glowing_g.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png b/examples/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png
new file mode 100644
index 00000000..dbe3fc79
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png b/examples/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png
new file mode 100644
index 00000000..5d53df9b
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/lcdFrame.png b/examples/mobile/guitartuner/src/mycomponents/images/lcdFrame.png
new file mode 100644
index 00000000..ff8dffc6
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/lcdFrame.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/meterBG.png b/examples/mobile/guitartuner/src/mycomponents/images/meterBG.png
new file mode 100644
index 00000000..4046355c
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/meterBG.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/mute.png b/examples/mobile/guitartuner/src/mycomponents/images/mute.png
new file mode 100644
index 00000000..382e6047
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/mute.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/pointer.png b/examples/mobile/guitartuner/src/mycomponents/images/pointer.png
new file mode 100644
index 00000000..d0cb21b8
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/pointer.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/pointerShadow.png b/examples/mobile/guitartuner/src/mycomponents/images/pointerShadow.png
new file mode 100644
index 00000000..a7086391
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/pointerShadow.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/power.png b/examples/mobile/guitartuner/src/mycomponents/images/power.png
new file mode 100644
index 00000000..8ec0c5ce
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/power.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/quit.png b/examples/mobile/guitartuner/src/mycomponents/images/quit.png
new file mode 100644
index 00000000..2a9443ec
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/quit.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/sensitivity.png b/examples/mobile/guitartuner/src/mycomponents/images/sensitivity.png
new file mode 100644
index 00000000..c3d2ea31
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/sensitivity.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_a.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_a.png
new file mode 100644
index 00000000..a1823e59
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_a.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png
new file mode 100644
index 00000000..7c78cbd8
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_auto.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_auto.png
new file mode 100644
index 00000000..b9e494bd
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_auto.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png
new file mode 100644
index 00000000..d5608d85
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_b.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_b.png
new file mode 100644
index 00000000..94977f87
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_b.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png
new file mode 100644
index 00000000..78841dc0
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_d.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_d.png
new file mode 100644
index 00000000..293ee55a
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_d.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png
new file mode 100644
index 00000000..705de41d
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_e.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_e.png
new file mode 100644
index 00000000..569d2c65
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_e.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png
new file mode 100644
index 00000000..1342a914
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_g.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_g.png
new file mode 100644
index 00000000..a8f0de57
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_g.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png b/examples/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png
new file mode 100644
index 00000000..6fdca419
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/voicemode_off.png b/examples/mobile/guitartuner/src/mycomponents/images/voicemode_off.png
new file mode 100644
index 00000000..0701dd34
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/voicemode_off.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/voicemode_on.png b/examples/mobile/guitartuner/src/mycomponents/images/voicemode_on.png
new file mode 100644
index 00000000..986d589a
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/voicemode_on.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/volume.png b/examples/mobile/guitartuner/src/mycomponents/images/volume.png
new file mode 100644
index 00000000..46fdb7fa
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/volume.png
Binary files differ
diff --git a/examples/mobile/guitartuner/src/mycomponents/images/volume_off.png b/examples/mobile/guitartuner/src/mycomponents/images/volume_off.png
new file mode 100644
index 00000000..a97e4224
--- /dev/null
+++ b/examples/mobile/guitartuner/src/mycomponents/images/volume_off.png
Binary files differ