diff options
author | Lasse Räihä <lasse.raiha@digia.com> | 2013-05-21 09:08:23 +0300 |
---|---|---|
committer | Kimmo Ollila <kimmo.ollila@digia.com> | 2013-05-21 09:14:41 +0300 |
commit | 2d68b636bfbbdf37a08f01af7091c550e8bc4329 (patch) | |
tree | 14a11dbe92942aabaaf1eebd0a4277a59906889f | |
parent | 78e479323838e27a762146707fb84f33f6e1cccc (diff) |
Removed cutetime. Added video-description demo.
Change-Id: Ia19a764f6b5305f3efe0d081a2925dfd9bb8ee9a
Reviewed-by: Kimmo Ollila <kimmo.ollila@digia.com>
95 files changed, 535 insertions, 4704 deletions
diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Content.qml b/QtDemo/qml/QtDemo/demos/cutetime/Content.qml deleted file mode 100755 index 022d5ef..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Content.qml +++ /dev/null @@ -1,125 +0,0 @@ - /**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtMultimedia 5.0 - -Rectangle { - id: root - property alias effect: effectLoader.item - property string effectSource - property alias videoPlayer: videoContent - signal contentSizeChanged(size contentSize) - - color: "black" - - ShaderEffectSource { - id: theSource - smooth: true - hideSource: true - } - - Intro { - id: introBackground - anchors.fill: root - visible: videoContent.mediaSource == "" ? true : false - } - - ContentVideo { - id: videoContent - anchors.fill: root - visible: mediaSource == "" ? false : true - - onSourceRectChanged: { - contentSizeChanged(Qt.size(sourceRect.width, sourceRect.height)); - } - } - - Loader { - id: effectLoader - source: effectSource - } - - onWidthChanged: { - if (effectLoader.item) - effectLoader.item.targetWidth = root.width - } - - onHeightChanged: { - if (effectLoader.item) - effectLoader.item.targetHeight = root.height - } - - onEffectSourceChanged: { - effectLoader.source = effectSource - effectLoader.item.parent = root - effectLoader.item.targetWidth = root.width - effectLoader.item.targetHeight = root.height - updateSource() - effectLoader.item.source = theSource - } - - function init() { - theSource.sourceItem = introBackground - root.effectSource = "Effects/EffectPassThrough.qml" - } - - function updateSource() { - - theSource.sourceItem = videoContent.mediaSource == "" ? introBackground : videoContent - if (effectLoader.item) - effectLoader.item.anchors.fill = videoContent - } - - function openVideo(path) { - stop(); -// videoContent.mediaSource = path; - videoContent.mediaSource = "qrc:///qml/CuteTime/sample.3gp" //"file:///sdcard/DCIM/Camera/VID_20130418_151050.3gp"//sample.3gp" //"qrc:/qml/CuteTime/sample.3gp" //"sample.3gp"; - updateSource(); - } - - function stop() { - theSource.sourceItem = introBackground - if (videoContent.mediaSource !== undefined) { - videoContent.stop(); - } - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/ContentVideo.qml b/QtDemo/qml/QtDemo/demos/cutetime/ContentVideo.qml deleted file mode 100755 index 5d08c48..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/ContentVideo.qml +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtMultimedia 5.0 - -VideoOutput { - id: videoOutput - source: mediaPlayer - fillMode: VideoOutput.PreserveAspectFit - property alias mediaSource: mediaPlayer.source - property alias mediaPlayer: mediaPlayer - property bool isPlaying: false - - onMediaSourceChanged: print ("\n\n\n\n\nMEEDIA SOURCE CHANGED TO: "+mediaSource) - MediaPlayer { - id: mediaPlayer - autoLoad: true - autoPlay: true - - onPlaybackRateChanged: { - //console.debug("playbackRate: " + playbackRate); - } - - onPlaybackStateChanged: { - //console.debug("playbackState = " + mediaPlayer.playbackState); - if (playbackState === MediaPlayer.PlayingState) - videoOutput.isPlaying = true; - else - videoOutput.isPlaying = false; - } - - onAvailabilityChanged: { - //console.debug("availability = " + mediaPlayer.availability); - } - - onErrorChanged: { - //console.debug("error = " + mediaPlayer.error); - } - - onStatusChanged: { - console.debug("status = " + mediaPlayer.status); - if ((mediaPlayer.status == MediaPlayer.Loaded) || (mediaPlayer.status == MediaPlayer.Buffered)) { - //now that media is loaded, we should know its size, and should request a resize - //if we are not fullscreen, then the window should resize to the native size of the video - //TODO: automatically resize video window to native move size - } - } - - onBufferProgressChanged: { - //console.debug("buffer progress = " + mediaPlayer.bufferProgress); - } - } - function play() { mediaPlayer.play() } - function stop() { mediaPlayer.stop() } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/EffectSelectionPanel.qml b/QtDemo/qml/QtDemo/demos/cutetime/EffectSelectionPanel.qml deleted file mode 100755 index a17bd59..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/EffectSelectionPanel.qml +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 - -Rectangle { - id: root - color: "#BB333333" - height: 78 - property int itemHeight: 25 - property string effectSource: "" - property bool isMouseAbove: mouseAboveMonitor.containsMouse - - Keys.onEscapePressed: visible = false - - signal clicked - QtObject { - id: d - property Item selectedItem - } - - ListModel { - id: sources - ListElement { name: "No effect"; source: "Effects/EffectPassThrough.qml" } - ListElement { name: "Billboard"; source: "Effects/EffectBillboard.qml" } - ListElement { name: "Black & white"; source: "Effects/EffectBlackAndWhite.qml" } - ListElement { name: "Blur"; source: "Effects/EffectGaussianBlur.qml" } - ListElement { name: "Edge detection"; source: "Effects/EffectSobelEdgeDetection1.qml" } - ListElement { name: "Emboss"; source: "Effects/EffectEmboss.qml" } - ListElement { name: "Glow"; source: "Effects/EffectGlow.qml" } - ListElement { name: "Isolate"; source: "Effects/EffectIsolate.qml" } - //ListElement { name: "Magnify"; source: "Effects/EffectMagnify.qml" } -// ListElement { name: "Page curl"; source: "Effects/EffectPageCurl.qml" } - ListElement { name: "Pixelate"; source: "Effects/EffectPixelate.qml" } - ListElement { name: "Posterize"; source: "Effects/EffectPosterize.qml" } - ListElement { name: "Ripple"; source: "Effects/EffectRipple.qml" } - ListElement { name: "Sepia"; source: "Effects/EffectSepia.qml" } - ListElement { name: "Sharpen"; source: "Effects/EffectSharpen.qml" } - ListElement { name: "Shockwave"; source: "Effects/EffectShockwave.qml" } -// ListElement { name: "Tilt shift"; source: "Effects/EffectTiltShift.qml" } - ListElement { name: "Toon"; source: "Effects/EffectToon.qml" } - ListElement { name: "Warhol"; source: "Effects/EffectWarhol.qml" } - ListElement { name: "Wobble"; source: "Effects/EffectWobble.qml" } - ListElement { name: "Vignette"; source: "Effects/EffectVignette.qml" } - } - - Component { - id: sourceDelegate - Item { - id: sourceDelegateItem - width: root.width - height: itemHeight - - Text { - id: sourceSelectorItem - anchors.centerIn: parent - width: 0.9 * parent.width - height: 0.8 * itemHeight - text: name - color: "white" - } - - states: [ - State { - name: "selected" - PropertyChanges { - target: sourceSelectorItem - bgColor: "#ff8888" - } - } - ] - - transitions: [ - Transition { - from: "*" - to: "*" - ColorAnimation { - properties: "color" - easing.type: Easing.OutQuart - duration: 500 - } - } - ] - } - } - - MouseArea { - id: mouseAboveMonitor - anchors.fill: parent - hoverEnabled: true - } - - ListView { - id: list - anchors.fill: parent - clip: true - anchors.margins: 14 - model: sources - focus: root.visible && root.opacity && urlBar.opacity === 0 - - currentIndex: 0 - - onCurrentIndexChanged : { - effectSource = model.get(currentIndex).source - root.clicked() - applicationWindow.resetTimer() - } - - delegate: Item { - height: 40 - width: parent.width - Rectangle { - anchors.fill: parent - border.color: index == list.currentIndex ? "#44ffffff" : "transparent" - color: index == list.currentIndex ? "#22ffffff" : "transparent" - radius: 3 - Text { color: "white" ; text: name ; anchors.centerIn: parent; font.pixelSize: 20 } - MouseArea { - anchors.fill: parent - onClicked: list.currentIndex = index - } - } - } - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/Effect.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/Effect.qml deleted file mode 100755 index ddd67a9..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/Effect.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -ShaderEffect { - property variant source - property ListModel parameters: ListModel { } - property bool divider: false - property real dividerValue: 1.0 - property real targetWidth: 0 - property real targetHeight: 0 - property string fragmentShaderFilename - property string vertexShaderFilename - - QtObject { - id: d - property string fragmentShaderCommon: " - #ifdef GL_ES - precision mediump float; - #else - # define lowp - # define mediump - # define highp - #endif // GL_ES - " - } - - // The following is a workaround for the fact that ShaderEffect - // doesn't provide a way for shader programs to be read from a file, - // rather than being inline in the QML file - - onFragmentShaderFilenameChanged: - fragmentShader = d.fragmentShaderCommon + loadFile(fragmentShaderFilename) - onVertexShaderFilenameChanged: - vertexShader = loadFile(vertexShaderFilename) - - function loadFile(filename){ - //TODO: fileloader - } - -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectBillboard.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectBillboard.qml deleted file mode 100755 index 124a2a1..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectBillboard.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "grid spacing" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real grid: parameters.get(0).value * 10 - - property real step_x: 0.0015625 - property real step_y: targetHeight ? (step_x * targetWidth / targetHeight) : 0.0 - - fragmentShaderFilename: "shaders/billboard.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectEmboss.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectEmboss.qml deleted file mode 100755 index 4bf5771..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectEmboss.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - fragmentShaderFilename: "shaders/emboss.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectGaussianBlur.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectGaussianBlur.qml deleted file mode 100755 index e63e17a..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectGaussianBlur.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://www.geeks3d.com/20100909/shader-library-gaussian-blur-post-processing-filter-in-glsl/ - -import QtQuick 2.0 - -Item { - id: root - property bool divider: true - property real dividerValue: 1 - property ListModel parameters: ListModel { - ListElement { - name: "radius" - value: 0.5 - } - } - - property alias targetWidth: verticalShader.targetWidth - property alias targetHeight: verticalShader.targetHeight - property alias source: verticalShader.source - - Effect { - id: verticalShader - anchors.fill: parent - dividerValue: parent.dividerValue - property real blurSize: 4.0 * parent.parameters.get(0).value / targetHeight - fragmentShaderFilename: "shaders/gaussianblur_v.fsh" - } - - Effect { - id: horizontalShader - anchors.fill: parent - dividerValue: parent.dividerValue - property real blurSize: 4.0 * parent.parameters.get(0).value / parent.targetWidth - fragmentShaderFilename: "shaders/gaussianblur_h.fsh" - source: horizontalShaderSource - - ShaderEffectSource { - id: horizontalShaderSource - sourceItem: verticalShader - smooth: true - hideSource: true - } - } -} - diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectGlow.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectGlow.qml deleted file mode 100755 index d6e987d..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectGlow.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - fragmentShaderFilename: "shaders/glow.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectIsolate.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectIsolate.qml deleted file mode 100755 index 2425a25..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectIsolate.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "hue" - value: 0.5 - } - ListElement { - name: "width" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real targetHue: parameters.get(0).value * 360 - property real windowWidth: parameters.get(1).value * 60 - - fragmentShaderFilename: "shaders/isolate.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectMagnify.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectMagnify.qml deleted file mode 100755 index 5a207f9..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectMagnify.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - id: root - divider: false - parameters: ListModel { - ListElement { - name: "radius" - value: 0.5 - } - ListElement { - name: "diffraction" - value: 0.5 - } - } - - property real posX: -1 - property real posY: -1 - - QtObject { - id: d - property real oldTargetWidth: root.targetWidth - property real oldTargetHeight: root.targetHeight - } - - // Transform slider values, and bind result to shader uniforms - property real radius: parameters.get(0).value * 100 - property real diffractionIndex: parameters.get(1).value - - onTargetWidthChanged: { - if (posX == -1) - posX = targetWidth / 2 - else if (d.oldTargetWidth != 0) - posX *= (targetWidth / d.oldTargetWidth) - d.oldTargetWidth = targetWidth - } - - onTargetHeightChanged: { - if (posY == -1) - posY = targetHeight / 2 - else if (d.oldTargetHeight != 0) - posY *= (targetHeight / d.oldTargetHeight) - d.oldTargetHeight = targetHeight - } - - fragmentShaderFilename: "shaders/magnify.fsh" - - MouseArea { - anchors.fill: parent - onPositionChanged: { root.posX = mouse.x; root.posY = root.targetHeight - mouse.y } - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPageCurl.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPageCurl.qml deleted file mode 100755 index 7724bfa..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPageCurl.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - divider: false - parameters: ListModel { - ListElement { - name: "extent" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real curlExtent: 1.0 - parameters.get(0).value - - fragmentShaderFilename: "shaders/pagecurl.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPassThrough.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPassThrough.qml deleted file mode 100755 index 1f259be..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPassThrough.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - divider: false -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPixelate.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPixelate.qml deleted file mode 100755 index 71f7da9..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPixelate.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "granularity" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real granularity: parameters.get(0).value * 20 - - fragmentShaderFilename: "shaders/pixelate.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPosterize.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPosterize.qml deleted file mode 100755 index 0cf16a0..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectPosterize.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "gamma" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real gamma: parameters.get(0).value - - property real numColors: 8.0 - - fragmentShaderFilename: "shaders/posterize.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectRipple.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectRipple.qml deleted file mode 100755 index 0b7c48c..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectRipple.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "amplitude" - value: 0.5 - } - ListElement { - name: "frequency" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real amplitude: parameters.get(0).value * 0.03 - property real n: parameters.get(1).value * 7 - - property real time: 0 - NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 } - - fragmentShaderFilename: "shaders/ripple.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSepia.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSepia.qml deleted file mode 100755 index 446e779..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSepia.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - fragmentShaderFilename: "shaders/sepia.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSharpen.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSharpen.qml deleted file mode 100755 index 99ece3c..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSharpen.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "sharpness" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real amount: parameters.get(0).value * 18 - - fragmentShaderFilename: "shaders/sharpen.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectShockwave.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectShockwave.qml deleted file mode 100755 index fe91781..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectShockwave.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - id: root - parameters: ListModel { - ListElement { - name: "amplitude" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real granularity: parameters.get(0).value * 20 - property real weight: parameters.get(0).value - - property real centerX - property real centerY - property real time - - SequentialAnimation { - running: true - loops: Animation.Infinite - ScriptAction { - script: { - centerX = Math.random() - centerY = Math.random() - } - } - NumberAnimation { - target: root - property: "time" - from: 0 - to: 1 - duration: 1000 - } - } - - fragmentShaderFilename: "shaders/shockwave.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSobelEdgeDetection1.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSobelEdgeDetection1.qml deleted file mode 100755 index 189d5d3..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSobelEdgeDetection1.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "threshold" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real mixLevel: parameters.get(0).value - property real targetSize: 250 - (200 * mixLevel) // TODO: fix ... - property real resS: targetSize - property real resT: targetSize - - fragmentShaderFilename: "shaders/sobeledgedetection1.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSobelEdgeDetection2.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSobelEdgeDetection2.qml deleted file mode 100755 index 4bcc6ef..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectSobelEdgeDetection2.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "threshold" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real weight: parameters.get(0).value - - fragmentShaderFilename: "shaders/sobeledgedetection2.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectTiltShift.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectTiltShift.qml deleted file mode 100755 index b1f214b..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectTiltShift.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - fragmentShaderFilename: "shaders/tiltshift.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectToon.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectToon.qml deleted file mode 100755 index 08f1849..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectToon.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - parameters: ListModel { - ListElement { - name: "threshold" - value: 0.5 - } - } - - // Transform slider values, and bind result to shader uniforms - property real threshold: parameters.get(0).value - property real targetSize: 250 - (200 * threshold) // TODO: fix ... - property real resS: targetSize - property real resT: targetSize - - // TODO - property real magTol: 0.3 - property real quantize: 8.0 - - fragmentShaderFilename: "shaders/toon.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectVignette.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectVignette.qml deleted file mode 100755 index 1120161..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectVignette.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - fragmentShaderFilename: "shaders/vignette.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectWarhol.qml b/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectWarhol.qml deleted file mode 100755 index e96d052..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectWarhol.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Effect { - fragmentShaderFilename: "shaders/warhol.fsh" -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/FileBrowser.qml b/QtDemo/qml/QtDemo/demos/cutetime/FileBrowser.qml deleted file mode 100644 index 314d1b4..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/FileBrowser.qml +++ /dev/null @@ -1,415 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt.labs.folderlistmodel 2.0 - -Rectangle { - id: fileBrowser - color: "transparent" - - property string folder: "file:///sdcard/Movies" - - signal fileSelected(string file) - - function selectFile(file) { - if (file != "") - folder = loader.item.folders.folder - loader.sourceComponent = undefined - if (file != "") - fileBrowser.fileSelected("file://" + file) - } - - Loader { - id: loader - } - - function show() { - loader.sourceComponent = fileBrowserComponent - loader.item.parent = fileBrowser - loader.item.anchors.fill = fileBrowser - loader.item.folder = fileBrowser.folder - } - - Component { - id: fileBrowserComponent - - Rectangle { - id: root - gradient: Gradient { - GradientStop { position: 0; color: "#111111" } - GradientStop { position: 1; color: "#222222"} - } - property bool showFocusHighlight: false - property variant folders: folders1 - property variant view: view1 - property alias folder: folders1.folder - property color textColor: "white" - - FolderListModel { - id: folders1 - folder: folder - } - - FolderListModel { - id: folders2 - folder: folder - } - - SystemPalette { - id: palette - } - - Component { - id: folderDelegate - - Rectangle { - id: wrapper - function launch() { - if (folders.isFolder(index)) - down(filePath); - else - fileBrowser.selectFile(filePath) - } - width: root.width - height: 50 - color: "transparent" - - Rectangle { - id: highlight; visible: false - anchors.fill: parent - color: palette.highlight - gradient: Gradient { - GradientStop { id: t1; position: 0.0; color: palette.highlight } - GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) } - } - } - - Item { - width: 40; height: 40 - y: 3 - x: 5 - Image { - source: "images/FileButton.png" - width: 34; height: 34 - anchors.centerIn: parent - visible: folders.isFolder(index) - } - } - - Text { - id: nameText - anchors.fill: parent; verticalAlignment: Text.AlignVCenter - text: fileName - anchors.leftMargin: 54 - font.pixelSize: 24 - color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor - elide: Text.ElideRight - } - - MouseArea { - id: mouseRegion - anchors.fill: parent - onPressed: { - root.showFocusHighlight = false; - wrapper.ListView.view.currentIndex = index; - } - onClicked: { if (folders == wrapper.ListView.view.model) launch() } - } - - states: [ - State { - name: "pressed" - when: mouseRegion.pressed - PropertyChanges { target: highlight; visible: true } - PropertyChanges { target: nameText; color: palette.highlightedText } - } - ] - } - } - - ListView { - id: view1 - anchors.top: titleBar.bottom - anchors.topMargin: 15 - anchors.bottom: parent.bottom - x: 0 - width: parent.width - model: folders1 - delegate: folderDelegate - highlight: Rectangle { - color: palette.highlight - visible: root.showFocusHighlight && view1.count != 0 - gradient: Gradient { - GradientStop { id: t1; position: 0.0; color: palette.highlight } - GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) } - } - width: view1.currentItem == null ? 0 : view1.currentItem.width - } - highlightMoveVelocity: 1000 - pressDelay: 100 - focus: true - state: "current" - states: [ - State { - name: "current" - PropertyChanges { target: view1; x: 0 } - }, - State { - name: "exitLeft" - PropertyChanges { target: view1; x: -root.width } - }, - State { - name: "exitRight" - PropertyChanges { target: view1; x: root.width } - } - ] - transitions: [ - Transition { - to: "current" - SequentialAnimation { - NumberAnimation { properties: "x"; duration: 250 } - } - }, - Transition { - NumberAnimation { properties: "x"; duration: 250 } - NumberAnimation { properties: "x"; duration: 250 } - } - ] - Keys.onPressed: root.keyPressed(event.key) - } - - ListView { - id: view2 - anchors.top: titleBar.bottom - anchors.topMargin: 15 - anchors.bottom: parent.bottom - x: parent.width - width: parent.width - model: folders2 - delegate: folderDelegate - highlight: Rectangle { - color: palette.highlight - visible: root.showFocusHighlight && view2.count != 0 - gradient: Gradient { - GradientStop { id: t1; position: 0.0; color: palette.highlight } - GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) } - } - width: view1.currentItem == null ? 0 : view1.currentItem.width - } - highlightMoveVelocity: 1000 - pressDelay: 100 - states: [ - State { - name: "current" - PropertyChanges { target: view2; x: 0 } - }, - State { - name: "exitLeft" - PropertyChanges { target: view2; x: -root.width } - }, - State { - name: "exitRight" - PropertyChanges { target: view2; x: root.width } - } - ] - transitions: [ - Transition { - to: "current" - SequentialAnimation { - NumberAnimation { properties: "x"; duration: 250 } - } - }, - Transition { - NumberAnimation { properties: "x"; duration: 250 } - } - ] - Keys.onPressed: root.keyPressed(event.key) - } - - Keys.onPressed: { - root.keyPressed(event.key); - if (event.key == Qt.Key_Return || event.key == Qt.Key_Select || event.key == Qt.Key_Right) { - view.currentItem.launch(); - event.accepted = true; - } else if (event.key == Qt.Key_Left) { - up(); - } - } - - Rectangle { - width: parent.width; - height: 70 - color: "#111111" - y: -7 - id: titleBar - - Rectangle { - id: upButton - width: 90 - height: titleBar.height - 7 - color: "transparent" - Image { anchors.centerIn: parent; source: "images/up.png"; width: 32; height: 32 } - MouseArea { id: upRegion; anchors.centerIn: parent - anchors.fill: parent - onClicked: if (folders.parentFolder != "") up() - } - states: [ - State { - name: "pressed" - when: upRegion.pressed - PropertyChanges { target: upButton; color: palette.highlight } - } - ] - } - -// Rectangle { -// color: "gray" -// x: 70 -// width: 1 -// height: 63 -// } - - Rectangle { - id: cancelButton - width: 100 - height: titleBar.height - 7 - color: "transparent" - anchors { left: upButton.right; leftMargin: 1; } - - Text { - anchors { fill: parent; topMargin: 3 } - text: "Cancel" - color: "white" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: 22 - } - - MouseArea { - id: cancelRegion - anchors.fill: parent - onClicked: fileBrowser.selectFile("") - } - - states: [ - State { - name: "pressed" - when: cancelRegion.pressed - PropertyChanges { target: cancelButton; color: palette.highlight } - } - ] - } - -// Rectangle { -// color: "gray" -// x: 171 -// width: 1 -// height: 63 -// } - - Text { - anchors.left: cancelButton.right; anchors.right: parent.right; height: parent.height - anchors.leftMargin: 4; anchors.rightMargin: 4 - text: String(folders.folder).replace("file://", "") - color: "white" - elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter - font.pixelSize: 28 - } - - Rectangle { - width: parent.width - anchors.bottom: parent.bottom - anchors.bottomMargin: 3 - height: 2 - color: palette.highlight - } - } - - function down(path) { - if (folders == folders1) { - view = view2 - folders = folders2; - view1.state = "exitLeft"; - } else { - view = view1 - folders = folders1; - view2.state = "exitLeft"; - } - view.x = root.width; - view.state = "current"; - view.focus = true; - folders.folder = "file://" + path; - } - - function up() { - var path = folders.parentFolder; - if (folders == folders1) { - view = view2 - folders = folders2; - view1.state = "exitRight"; - } else { - view = view1 - folders = folders1; - view2.state = "exitRight"; - } - view.x = -root.width; - view.state = "current"; - view.focus = true; - folders.folder = path; - } - - function keyPressed(key) { - switch (key) { - case Qt.Key_Up: - case Qt.Key_Down: - case Qt.Key_Left: - case Qt.Key_Right: - root.showFocusHighlight = true; - break; - default: - // do nothing - break; - } - } - } - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Intro.qml b/QtDemo/qml/QtDemo/demos/cutetime/Intro.qml deleted file mode 100644 index a5dbb2a..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/Intro.qml +++ /dev/null @@ -1,48 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - color: "#111111" - -// Image { -// anchors.fill: parent -// source: "images/gradient.png" -// } - - Image { - id: logo - anchors.centerIn: root - anchors.verticalCenterOffset: -60 - source: "images/qt-logo.png" - opacity: 0.5 - - } -// Rectangle { -// id: button -// opacity: mouse.containsMouse ? 1 : 0 -// Behavior on opacity {NumberAnimation{duration: 100}} -// color: mouse.pressed ? "#11000000" : "#11ffffff" -// anchors.top: logo.bottom -// anchors.horizontalCenter: parent.horizontalCenter -// border.color: "#33ffffff" -// width: text.width + 40 -// height: text.height + 4 -// antialiasing: true -// radius: 4 -// MouseArea { -// id: mouse -// anchors.fill: parent -// hoverEnabled: true -// onClicked: applicationWindow.openVideo() -// } -// } - -// Text { -// id: text -// color: "#44ffffff" -// text: "Open File" -// font.bold: true -// font.pixelSize: 18 -// anchors.centerIn: button -// } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/MetadataView.qml b/QtDemo/qml/QtDemo/demos/cutetime/MetadataView.qml deleted file mode 100644 index b0b907b..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/MetadataView.qml +++ /dev/null @@ -1,173 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - - property variant mediaPlayer: null - - anchors.fill: parent - color: "#AA000000" - Behavior on opacity { NumberAnimation { } } - opacity: 0 - - Rectangle { - height: column.height + 30 - width: 500 - color: "#BB222222" - anchors.centerIn: parent - anchors.verticalCenterOffset: -50 - - - Column { - id: column - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 15 - spacing: 12 - - Text { - text: "Media Type: " + (mediaPlayer ? mediaPlayer.metaData.mediaType : "") - visible: mediaPlayer && mediaPlayer.metaData.mediaType !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Title: " + (mediaPlayer ? mediaPlayer.metaData.title : "") - visible: mediaPlayer && mediaPlayer.metaData.title !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Artist: " + (mediaPlayer ? mediaPlayer.metaData.leadPerformer : "") - visible: mediaPlayer && mediaPlayer.metaData.leadPerformer !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Artist: " + (mediaPlayer ? mediaPlayer.metaData.contributingArtist : "") - visible: mediaPlayer && mediaPlayer.metaData.contributingArtist !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Album: " + (mediaPlayer ? mediaPlayer.metaData.albumTitle : "") - visible: mediaPlayer && mediaPlayer.metaData.albumTitle !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Album Artist: " + (mediaPlayer ? mediaPlayer.metaData.albumArtist : "") - visible: mediaPlayer && mediaPlayer.metaData.albumArtist !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Author: " + (mediaPlayer ? mediaPlayer.metaData.author : "") - visible: mediaPlayer && mediaPlayer.metaData.author !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Composer: " + (mediaPlayer ? mediaPlayer.metaData.composer : "") - visible: mediaPlayer && mediaPlayer.metaData.composer !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Writer: " + (mediaPlayer ? mediaPlayer.metaData.writer : "") - visible: mediaPlayer && mediaPlayer.metaData.writer !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Genre: " + (mediaPlayer ? mediaPlayer.metaData.genre : "") - visible: mediaPlayer && mediaPlayer.metaData.genre !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Track Number: " + (mediaPlayer ? mediaPlayer.metaData.trackNumber : "") - visible: mediaPlayer && mediaPlayer.metaData.trackNumber !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Year: " + (mediaPlayer ? mediaPlayer.metaData.year : "") - visible: mediaPlayer && mediaPlayer.metaData.year !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Duration: " + (mediaPlayer ? Qt.formatTime(new Date(mediaPlayer.metaData.duration), mediaPlayer.metaData.duration >= 3600000 ? "H:mm:ss" : "m:ss") : "") - visible: mediaPlayer && mediaPlayer.metaData.duration !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Resolution: " + (mediaPlayer && mediaPlayer.metaData.resolution !== undefined ? (mediaPlayer.metaData.resolution.width + "x" + mediaPlayer.metaData.resolution.height) : "") - visible: mediaPlayer && mediaPlayer.metaData.resolution !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Audio Bitrate: " + (mediaPlayer ? Math.round(mediaPlayer.metaData.audioBitRate / 1000) + " kbps" : "") - visible: mediaPlayer && mediaPlayer.metaData.audioBitRate !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Video Bitrate: " + (mediaPlayer ? Math.round(mediaPlayer.metaData.videoBitRate / 1000) + " kbps" : "") - visible: mediaPlayer && mediaPlayer.metaData.videoBitRate !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - Text { - text: "Date: " + (mediaPlayer ? Qt.formatDate(mediaPlayer.metaData.date) : "") - visible: mediaPlayer && mediaPlayer.metaData.date !== undefined - color: "white" - font.pixelSize: 24 - width: parent.width - wrapMode: Text.WordWrap - } - } - } - - MouseArea { - anchors.fill: parent - onClicked: root.opacity = 0 - enabled: root.opacity !== 0 - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/ParameterPanel.qml b/QtDemo/qml/QtDemo/demos/cutetime/ParameterPanel.qml deleted file mode 100644 index 51b9938..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/ParameterPanel.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: root - height: view.model.count * sliderHeight - color: "#BB333333" - property color lineColor: "black" - property real spacing: 10 - property real sliderHeight: 50 - property bool isMouseAbove: mouseAboveMonitor.containsMouse - - property ListModel model: ListModel { } - - MouseArea { - id: mouseAboveMonitor - anchors.fill: parent - hoverEnabled: true; - } - - Component { - id: editDelegate - - Rectangle { - id: delegate - width: parent.width - height: root.sliderHeight - color: "transparent" - - Text { - id: text - text: name - color: "white" - anchors { - top: parent.top - bottom: parent.bottom - leftMargin: 15 - left: parent.left - } - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: 20 - font.capitalization: Font.Capitalize - width: 90 - } - - Slider { - anchors { - verticalCenter: text.verticalCenter - verticalCenterOffset: 3 - left: text.right - leftMargin: 20 - right: parent.right - rightMargin: 20 - } - value: model.value - onValueChanged: view.model.setProperty(index, "value", value) - } - } - } - - ListView { - id: view - anchors.fill: parent - anchors.margins: 8 - model: root.model - delegate: editDelegate - interactive: false - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/UrlBar.qml b/QtDemo/qml/QtDemo/demos/cutetime/UrlBar.qml deleted file mode 100644 index cfada41..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/UrlBar.qml +++ /dev/null @@ -1,80 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: root - height: 50 - signal urlAccepted(string text) - color: "#cc222222" - Behavior on opacity { NumberAnimation{} } - onOpacityChanged: { - if (opacity == 1) - urlInput.focus = true - else if (opacity == 0) - urlInput.focus = false - } - - Keys.onEscapePressed: root.opacity = 0 - - MouseArea { - anchors.fill: parent - onClicked: root.opacity = 0 - } - - Text { - anchors.bottom: urlBar.top - anchors.left: urlBar.left - anchors.bottomMargin: 8 - text: "Enter URL" - color: "white" - font.pixelSize: 20 - } - - BorderImage { - id: urlBar - source: "images/ControlBar.png" - border.top: 12 - border.bottom: 12 - border.left: 12 - border.right: 12 - height: 70 - anchors.centerIn: parent - anchors.verticalCenterOffset: -170 - width: 600 - - Rectangle { - anchors.fill: parent - anchors.margins: 16 - color: "#66ffffff" - border.color: "#bbffffff" - radius: 2 - antialiasing: true - - TextInput { - id: urlInput - selectionColor: "#aaffffff" - selectedTextColor: "black" - selectByMouse: true - anchors.fill: parent - anchors.margins: 5 - font.pixelSize: 24 - color: "black" - text: "http://" - onAccepted: root.urlAccepted(urlInput.text); - - } - } - } - -// Rectangle { -// anchors.right: urlBar.left -// anchors.rightMargin: 32 -// anchors.verticalCenter: urlBar.verticalCenter -// height: 70 -// width: 70 -// color: "gray" -// MouseArea { -// anchors.fill: parent -// onClicked: { urlInput.text = ""; urlInput.paste(); } -// } -// } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/CameraButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/CameraButton.png Binary files differdeleted file mode 100644 index d950f78..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/CameraButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/ControlBar.png b/QtDemo/qml/QtDemo/demos/cutetime/images/ControlBar.png Binary files differdeleted file mode 100644 index 8b5f545..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/ControlBar.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/FXButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/FXButton.png Binary files differdeleted file mode 100644 index 04530f4..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/FXButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/FileButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/FileButton.png Binary files differdeleted file mode 100644 index d65e681..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/FileButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/FullscreenButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/FullscreenButton.png Binary files differdeleted file mode 100755 index 413872a..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/FullscreenButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/PauseButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/PauseButton.png Binary files differdeleted file mode 100644 index 0d3e2d1..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/PauseButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/PlayButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/PlayButton.png Binary files differdeleted file mode 100644 index 9a85633..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/PlayButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/PlaybackSlider.png b/QtDemo/qml/QtDemo/demos/cutetime/images/PlaybackSlider.png Binary files differdeleted file mode 100755 index 3716315..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/PlaybackSlider.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/RateButtonForward.png b/QtDemo/qml/QtDemo/demos/cutetime/images/RateButtonForward.png Binary files differdeleted file mode 100644 index 4b52603..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/RateButtonForward.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/RateButtonReverse.png b/QtDemo/qml/QtDemo/demos/cutetime/images/RateButtonReverse.png Binary files differdeleted file mode 100644 index 64e94ed..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/RateButtonReverse.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/SliderBackground.png b/QtDemo/qml/QtDemo/demos/cutetime/images/SliderBackground.png Binary files differdeleted file mode 100644 index b83f729..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/SliderBackground.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/SliderHandle.png b/QtDemo/qml/QtDemo/demos/cutetime/images/SliderHandle.png Binary files differdeleted file mode 100755 index 5206100..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/SliderHandle.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/SliderProgress.png b/QtDemo/qml/QtDemo/demos/cutetime/images/SliderProgress.png Binary files differdeleted file mode 100755 index e0efc87..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/SliderProgress.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/UrlButton.png b/QtDemo/qml/QtDemo/demos/cutetime/images/UrlButton.png Binary files differdeleted file mode 100644 index 876951f..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/UrlButton.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/VolumeDown.png b/QtDemo/qml/QtDemo/demos/cutetime/images/VolumeDown.png Binary files differdeleted file mode 100755 index 60c626d..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/VolumeDown.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/VolumeUp.png b/QtDemo/qml/QtDemo/demos/cutetime/images/VolumeUp.png Binary files differdeleted file mode 100755 index 886fde7..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/VolumeUp.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/folder.png b/QtDemo/qml/QtDemo/demos/cutetime/images/folder.png Binary files differdeleted file mode 100644 index e53e2ad..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/folder.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/gradient.png b/QtDemo/qml/QtDemo/demos/cutetime/images/gradient.png Binary files differdeleted file mode 100644 index 1cd7281..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/gradient.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/pattern.png b/QtDemo/qml/QtDemo/demos/cutetime/images/pattern.png Binary files differdeleted file mode 100644 index 028181e..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/pattern.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/qt-logo.png b/QtDemo/qml/QtDemo/demos/cutetime/images/qt-logo.png Binary files differdeleted file mode 100755 index 242bb28..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/qt-logo.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/titlebar.png b/QtDemo/qml/QtDemo/demos/cutetime/images/titlebar.png Binary files differdeleted file mode 100644 index 51c9008..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/titlebar.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/titlebar.sci b/QtDemo/qml/QtDemo/demos/cutetime/images/titlebar.sci deleted file mode 100755 index 0418d94..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/titlebar.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 10 -border.top: 12 -border.bottom: 12 -border.right: 10 -source: titlebar.png diff --git a/QtDemo/qml/QtDemo/demos/cutetime/images/up.png b/QtDemo/qml/QtDemo/demos/cutetime/images/up.png Binary files differdeleted file mode 100644 index b05f802..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/images/up.png +++ /dev/null diff --git a/QtDemo/qml/QtDemo/demos/cutetime/main.qml b/QtDemo/qml/QtDemo/demos/cutetime/main.qml deleted file mode 100755 index 0e2f5b3..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/main.qml +++ /dev/null @@ -1,310 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtMultimedia 5.0 - -FocusScope { - id: applicationWindow -// width: 640 -// height: 480 - focus: true - anchors.fill:parent - - MouseArea { - id: mouseActivityMonitor - anchors.fill: parent - - hoverEnabled: true - onClicked: { - if (controlBar.state === "VISIBLE" && content.videoPlayer.mediaPlayer.status === MediaPlayer.Loaded) { - controlBar.hide(); - } else { - controlBar.show(); - controlBarTimer.restart(); - } - } - -// onPressed: { -// hideToolBars(); -// } - - onDoubleClicked: { -// viewer.toggleFullscreen(); - } - } - - signal resetTimer - onResetTimer: { - controlBar.show(); - controlBarTimer.restart(); - } - - Component.onCompleted: { - init(); - } - - Content { - id: content - anchors.fill: parent - - onContentSizeChanged: { - viewer.suggestResize(contentSize); - } - } - - Timer { - id: controlBarTimer - interval: 4000 - running: false - - onTriggered: { - hideToolBars(); - } - } - - ControlBar { - id: controlBar - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: applicationWindow.bottom - mediaPlayer: content.videoPlayer.mediaPlayer - - onOpenFile: { - applicationWindow.openVideo(); - } - - onOpenURL: { - applicationWindow.openURL(); - } - - onOpenFX: { - applicationWindow.openFX(); - } - - onToggleFullScreen: { - viewer.toggleFullscreen(); - } - } - - ParameterPanel { - id: parameterPanel - opacity: controlBar.opacity - visible: effectSelectionPanel.visible && model.count !== 0 - height: 116 - width: 500 - anchors { - bottomMargin: 15 - bottom: controlBar.top - right: effectSelectionPanel.left - rightMargin: 15 - } - } - - EffectSelectionPanel { - id: effectSelectionPanel - visible: false - opacity: controlBar.opacity - anchors { - bottom: controlBar.top - right: controlBar.right -// rightMargin: 15 - bottomMargin: 15 - } - width: 250 - height: 350 - itemHeight: 80 - onEffectSourceChanged: { - content.effectSource = effectSource - parameterPanel.model = content.effect.parameters - } - } - - UrlBar { - id: urlBar - opacity: 0 - visible: opacity != 0 - anchors.fill: parent - onUrlAccepted: { - urlBar.opacity = 0; - if (text != "") - content.openVideo(text) - } - } - - Rectangle { - anchors.right: parent.right - anchors.top: parent.top - anchors.rightMargin: 32 - anchors.topMargin: 32 - width: 40 - height: 40 - radius: width / 2 - color: infoMouser.pressed ? "#BB999999" : "#88444444" - antialiasing: true - visible: content.videoPlayer.mediaPlayer.status !== MediaPlayer.NoMedia && controlBar.state === "VISIBLE" - - Text { - anchors.centerIn: parent - text: "i" - font.italic: true - font.bold: true - color: "white" - font.pixelSize: 28 - } - - MouseArea { - id: infoMouser - anchors.fill: parent - anchors.margins: -10 - onClicked: metadataView.opacity = 1 - } - } - - MetadataView { - id: metadataView - mediaPlayer: content.videoPlayer.mediaPlayer - } - - property real volumeBeforeMuted: 1.0 - property bool isFullScreen: false -// Connections { -// target: viewer -// onWindowStateChanged: applicationWindow.isFullScreen = (windowState & Qt.WindowFullScreen) -// } - -// FileBrowser { -// id: fileBrowser -// anchors.fill: parent -// onFileSelected: { -// if (file != "") -// content.openVideo(file); -// } -// } - - Keys.onPressed: { - applicationWindow.resetTimer(); - if (event.key === Qt.Key_O && event.modifiers & Qt.ControlModifier) { - openVideo(); - return; - } else if (event.key === Qt.Key_N && event.modifiers & Qt.ControlModifier) { - openURL(); - return; - } else if (event.key === Qt.Key_E && event.modifiers & Qt.ControlModifier) { - openFX(); - return; - } else if (event.key === Qt.Key_F && event.modifiers & Qt.ControlModifier) { - viewer.toggleFullscreen(); - return; - } else if (event.key === Qt.Key_Up || event.key === Qt.Key_VolumeUp) { - content.videoPlayer.mediaPlayer.volume = Math.min(1, content.videoPlayer.mediaPlayer.volume + 0.1); - return; - } else if (event.key === Qt.Key_Down || event.key === Qt.Key_VolumeDown) { - if (event.modifiers & Qt.ControlModifier) { - if (content.videoPlayer.mediaPlayer.volume) { - volumeBeforeMuted = content.videoPlayer.mediaPlayer.volume; - content.videoPlayer.mediaPlayer.volume = 0 - } else { - content.videoPlayer.mediaPlayer.volume = volumeBeforeMuted; - } - } else { - content.videoPlayer.mediaPlayer.volume = Math.max(0, content.videoPlayer.mediaPlayer.volume - 0.1); - } - return; - } else if (applicationWindow.isFullScreen && event.key === Qt.Key_Escape) { - viewer.toggleFullscreen(); - return; - } - - // What's next should be handled only if there's a loaded media - if (content.videoPlayer.mediaPlayer.status !== MediaPlayer.Loaded - && content.videoPlayer.mediaPlayer.status !== MediaPlayer.Buffered) - return; - - if (event.key === Qt.Key_Space) { - if (content.videoPlayer.mediaPlayer.playbackState === MediaPlayer.PlayingState) - content.videoPlayer.mediaPlayer.pause() - else if (content.videoPlayer.mediaPlayer.playbackState === MediaPlayer.PausedState - || content.videoPlayer.mediaPlayer.playbackState === MediaPlayer.StoppedState) - content.videoPlayer.mediaPlayer.play() - } else if (event.key === Qt.Key_Left) { - content.videoPlayer.mediaPlayer.seek(Math.max(0, content.videoPlayer.mediaPlayer.position - 30000)); - return; - } else if (event.key === Qt.Key_Right) { - content.videoPlayer.mediaPlayer.seek(Math.min(content.videoPlayer.mediaPlayer.duration, content.videoPlayer.mediaPlayer.position + 30000)); - return; - } - } - - function init() { - content.init() -// if (fileName != "") -// content.openVideo(fileName) - } - - function openVideo() { - //videoFileBrowser.show() -// var videoFile = viewer.openFileDialog(); -// if (videoFile != "") -// content.openVideo(videoFile); - fileBrowser.show() - } - - function openCamera() { - content.openCamera() - } - - function openURL() { - urlBar.opacity = urlBar.opacity === 0 ? 1 : 0 - } - - function openFX() { - effectSelectionPanel.visible = !effectSelectionPanel.visible; - } - - function close() { - } - - function hideToolBars() { - if (!controlBar.isMouseAbove && !parameterPanel.isMouseAbove && !effectSelectionPanel.isMouseAbove && content.videoPlayer.isPlaying) - controlBar.hide(); - } -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/billboard.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/billboard.fsh deleted file mode 100755 index baa9554..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/billboard.fsh +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float grid; -uniform float dividerValue; -uniform float step_x; -uniform float step_y; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - float offx = floor(uv.x / (grid * step_x)); - float offy = floor(uv.y / (grid * step_y)); - vec3 res = texture2D(source, vec2(offx * grid * step_x , offy * grid * step_y)).rgb; - vec2 prc = fract(uv / vec2(grid * step_x, grid * step_y)); - vec2 pw = pow(abs(prc - 0.5), vec2(2.0)); - float rs = pow(0.45, 2.0); - float gr = smoothstep(rs - 0.1, rs + 0.1, pw.x + pw.y); - float y = (res.r + res.g + res.b) / 3.0; - vec3 ra = res / y; - float ls = 0.3; - float lb = ceil(y / ls); - float lf = ls * lb + 0.3; - res = lf * res; - vec3 col = mix(res, vec3(0.1, 0.1, 0.1), gr); - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(col, 1.0); - else - gl_FragColor = qt_Opacity * texture2D(source, uv); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/blackandwhite.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/blackandwhite.fsh deleted file mode 100755 index 40756c4..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/blackandwhite.fsh +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float threshold; -uniform float dividerValue; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 orig = texture2D(source, uv); - vec3 col = orig.rgb; - float y = 0.3 *col.r + 0.59 * col.g + 0.11 * col.b; - y = y < threshold ? 0.0 : 1.0; - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(y, y, y, 1.0); - else - gl_FragColor = qt_Opacity * orig; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/emboss.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/emboss.fsh deleted file mode 100755 index bd13a0b..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/emboss.fsh +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -const float step_w = 0.0015625; -const float step_h = 0.0027778; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec3 t1 = texture2D(source, vec2(uv.x - step_w, uv.y - step_h)).rgb; - vec3 t2 = texture2D(source, vec2(uv.x, uv.y - step_h)).rgb; - vec3 t3 = texture2D(source, vec2(uv.x + step_w, uv.y - step_h)).rgb; - vec3 t4 = texture2D(source, vec2(uv.x - step_w, uv.y)).rgb; - vec3 t5 = texture2D(source, uv).rgb; - vec3 t6 = texture2D(source, vec2(uv.x + step_w, uv.y)).rgb; - vec3 t7 = texture2D(source, vec2(uv.x - step_w, uv.y + step_h)).rgb; - vec3 t8 = texture2D(source, vec2(uv.x, uv.y + step_h)).rgb; - vec3 t9 = texture2D(source, vec2(uv.x + step_w, uv.y + step_h)).rgb; - vec3 rr = -4.0 * t1 - 4.0 * t2 - 4.0 * t4 + 12.0 * t5; - float y = (rr.r + rr.g + rr.b) / 3.0; - vec3 col = vec3(y, y, y) + 0.3; - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(col, 1.0); - else - gl_FragColor = qt_Opacity * texture2D(source, uv); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/gaussianblur_h.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/gaussianblur_h.fsh deleted file mode 100755 index 96ae8e4..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/gaussianblur_h.fsh +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -uniform float dividerValue; -uniform float blurSize; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 c = vec4(0.0); - if (uv.x < dividerValue) { - c += texture2D(source, uv - vec2(4.0*blurSize, 0.0)) * 0.05; - c += texture2D(source, uv - vec2(3.0*blurSize, 0.0)) * 0.09; - c += texture2D(source, uv - vec2(2.0*blurSize, 0.0)) * 0.12; - c += texture2D(source, uv - vec2(1.0*blurSize, 0.0)) * 0.15; - c += texture2D(source, uv) * 0.18; - c += texture2D(source, uv + vec2(1.0*blurSize, 0.0)) * 0.15; - c += texture2D(source, uv + vec2(2.0*blurSize, 0.0)) * 0.12; - c += texture2D(source, uv + vec2(3.0*blurSize, 0.0)) * 0.09; - c += texture2D(source, uv + vec2(4.0*blurSize, 0.0)) * 0.05; - } else { - c = texture2D(source, qt_TexCoord0); - } - gl_FragColor = qt_Opacity * c; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/gaussianblur_v.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/gaussianblur_v.fsh deleted file mode 100755 index 6bc7b8b..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/gaussianblur_v.fsh +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -uniform float dividerValue; -uniform float blurSize; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 c = vec4(0.0); - if (uv.x < dividerValue) { - c += texture2D(source, uv - vec2(0.0, 4.0*blurSize)) * 0.05; - c += texture2D(source, uv - vec2(0.0, 3.0*blurSize)) * 0.09; - c += texture2D(source, uv - vec2(0.0, 2.0*blurSize)) * 0.12; - c += texture2D(source, uv - vec2(0.0, 1.0*blurSize)) * 0.15; - c += texture2D(source, uv) * 0.18; - c += texture2D(source, uv + vec2(0.0, 1.0*blurSize)) * 0.15; - c += texture2D(source, uv + vec2(0.0, 2.0*blurSize)) * 0.12; - c += texture2D(source, uv + vec2(0.0, 3.0*blurSize)) * 0.09; - c += texture2D(source, uv + vec2(0.0, 4.0*blurSize)) * 0.05; - } else { - c = texture2D(source, qt_TexCoord0); - } - // First pass we don't apply opacity - gl_FragColor = c; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/glow.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/glow.fsh deleted file mode 100755 index e0adcfd..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/glow.fsh +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -const float step_w = 0.0015625; -const float step_h = 0.0027778; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec3 t1 = texture2D(source, vec2(uv.x - step_w, uv.y - step_h)).rgb; - vec3 t2 = texture2D(source, vec2(uv.x, uv.y - step_h)).rgb; - vec3 t3 = texture2D(source, vec2(uv.x + step_w, uv.y - step_h)).rgb; - vec3 t4 = texture2D(source, vec2(uv.x - step_w, uv.y)).rgb; - vec3 t5 = texture2D(source, uv).rgb; - vec3 t6 = texture2D(source, vec2(uv.x + step_w, uv.y)).rgb; - vec3 t7 = texture2D(source, vec2(uv.x - step_w, uv.y + step_h)).rgb; - vec3 t8 = texture2D(source, vec2(uv.x, uv.y + step_h)).rgb; - vec3 t9 = texture2D(source, vec2(uv.x + step_w, uv.y + step_h)).rgb; - vec3 xx = t1 + 2.0*t2 + t3 - t7 - 2.0*t8 - t9; - vec3 yy = t1 - t3 + 2.0*t4 - 2.0*t6 + t7 - t9; - vec3 rr = sqrt(xx * xx + yy * yy); - vec3 col = rr * 2.0 * t5; - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(col, 1.0); - else - gl_FragColor = qt_Opacity * texture2D(source, uv); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/isolate.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/isolate.fsh deleted file mode 100755 index 0f25bfa..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/isolate.fsh +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float targetHue; -uniform float windowWidth; -uniform float dividerValue; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void rgb2hsl(vec3 rgb, out float h, out float s, float l) -{ - float maxval = max(rgb.r, max(rgb.g, rgb.b)); - float minval = min(rgb.r, min(rgb.g, rgb.b)); - float delta = maxval - minval; - l = (minval + maxval) / 2.0; - s = 0.0; - if (l > 0.0 && l < 1.0) - s = delta / (l < 0.5 ? 2.0 * l : 2.0 - 2.0 * l); - h = 0.0; - if (delta > 0.0) - { - if (rgb.r == maxval && rgb.g != maxval) - h += (rgb.g - rgb.b ) / delta; - if (rgb.g == maxval && rgb.b != maxval) - h += 2.0 + (rgb.b - rgb.r) / delta; - if (rgb.b == maxval && rgb.r != maxval) - h += 4.0 + (rgb.r - rgb.g) / delta; - h *= 60.0; - } -} - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec3 col = texture2D(source, uv).rgb; - float h, s, l; - rgb2hsl(col, h, s, l); - float h2 = (h > targetHue) ? h - 360.0 : h + 360.0; - float y = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; - vec3 result; - if (uv.x > dividerValue || (abs(h - targetHue) < windowWidth) || (abs(h2 - targetHue) < windowWidth)) - result = col; - else - result = vec3(y, y, y); - gl_FragColor = qt_Opacity * vec4(result, 1.0); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/magnify.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/magnify.fsh deleted file mode 100755 index 6382549..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/magnify.fsh +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://www.reddit.com/r/programming/comments/losip/shader_toy/c2upn1e - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; -uniform float radius; -uniform float diffractionIndex; -uniform float targetWidth; -uniform float targetHeight; -uniform float posX; -uniform float posY; - -void main() -{ - vec2 tc = qt_TexCoord0; - vec2 center = vec2(posX, posY); - vec2 xy = gl_FragCoord.xy - center.xy; - float r = sqrt(xy.x * xy.x + xy.y * xy.y); - if (r < radius) { - float h = diffractionIndex * 0.5 * radius; - vec2 new_xy = r < radius ? xy * (radius - h) / sqrt(radius * radius - r * r) : xy; - vec2 targetSize = vec2(targetWidth, targetHeight); - tc = (new_xy + center) / targetSize; - tc.y = 1.0 - tc.y; - } - gl_FragColor = qt_Opacity * texture2D(source, tc); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/pagecurl.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/pagecurl.fsh deleted file mode 100755 index 08e4f4c..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/pagecurl.fsh +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://rectalogic.github.com/webvfx/examples_2transition-shader-pagecurl_8html-example.html - -uniform float dividerValue; -uniform float curlExtent; -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -const float minAmount = -0.16; -const float maxAmount = 1.3; -const float PI = 3.141592653589793; -const float scale = 512.0; -const float sharpness = 3.0; -const vec4 bgColor = vec4(1.0, 1.0, 0.8, 1.0); - -float amount = curlExtent * (maxAmount - minAmount) + minAmount; -float cylinderCenter = amount; -// 360 degrees * amount -float cylinderAngle = 2.0 * PI * amount; -const float cylinderRadius = 1.0 / PI / 2.0; - -vec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation) -{ - float hitPoint = hitAngle / (2.0 * PI); - point.y = hitPoint; - return rrotation * point; -} - -vec4 antiAlias(vec4 color1, vec4 color2, float distance) -{ - distance *= scale; - if (distance < 0.0) return color2; - if (distance > 2.0) return color1; - float dd = pow(1.0 - distance / 2.0, sharpness); - return ((color2 - color1) * dd) + color1; -} - -float distanceToEdge(vec3 point) -{ - float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x); - float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y); - if (point.x < 0.0) dx = -point.x; - if (point.x > 1.0) dx = point.x - 1.0; - if (point.y < 0.0) dy = -point.y; - if (point.y > 1.0) dy = point.y - 1.0; - if ((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy); - return min(dx, dy); -} - -vec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation) -{ - float hitAngle = PI - (acos(yc / cylinderRadius) - cylinderAngle); - vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation); - if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)) - return bgColor; - if (yc > 0.0) - return texture2D(source, p); - vec4 color = texture2D(source, point.xy); - vec4 tcolor = vec4(0.0); - return antiAlias(color, tcolor, distanceToEdge(point)); -} - -vec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation) -{ - float shadow = distanceToEdge(point) * 30.0; - shadow = (1.0 - shadow) / 3.0; - if (shadow < 0.0) - shadow = 0.0; - else - shadow *= amount; - vec4 shadowColor = seeThrough(yc, p, rotation, rrotation); - shadowColor.r -= shadow; - shadowColor.g -= shadow; - shadowColor.b -= shadow; - return shadowColor; -} - -vec4 backside(float yc, vec3 point) -{ - vec4 color = texture2D(source, point.xy); - float gray = (color.r + color.b + color.g) / 15.0; - gray += (8.0 / 10.0) * (pow(1.0 - abs(yc / cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0)); - color.rgb = vec3(gray); - return color; -} - -void main(void) -{ - const float angle = 30.0 * PI / 180.0; - float c = cos(-angle); - float s = sin(-angle); - mat3 rotation = mat3( - c, s, 0, - -s, c, 0, - 0.12, 0.258, 1 - ); - c = cos(angle); - s = sin(angle); - mat3 rrotation = mat3( - c, s, 0, - -s, c, 0, - 0.15, -0.5, 1 - ); - vec3 point = rotation * vec3(qt_TexCoord0, 1.0); - float yc = point.y - cylinderCenter; - vec4 color = vec4(1.0, 0.0, 0.0, 1.0); - if (yc < -cylinderRadius) { - // See through to background - color = bgColor; - } else if (yc > cylinderRadius) { - // Flat surface - color = texture2D(source, qt_TexCoord0); - } else { - float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI; - float hitAngleMod = mod(hitAngle, 2.0 * PI); - if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0)) { - color = seeThrough(yc, qt_TexCoord0, rotation, rrotation); - } else { - point = hitPoint(hitAngle, yc, point, rrotation); - if (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0) { - color = seeThroughWithShadow(yc, qt_TexCoord0, point, rotation, rrotation); - } else { - color = backside(yc, point); - vec4 otherColor; - if (yc < 0.0) { - float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / 0.71); - shado *= pow(-yc / cylinderRadius, 3.0); - shado *= 0.5; - otherColor = vec4(0.0, 0.0, 0.0, shado); - } else { - otherColor = texture2D(source, qt_TexCoord0); - } - color = antiAlias(color, otherColor, cylinderRadius - abs(yc)); - - // This second antialiasing step causes the shader to fail to render, on - // Symbian devices (tested so far using IVE3.5). Running out of scratch - // memory? - } - } - } - gl_FragColor = qt_Opacity * color; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/pixelate.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/pixelate.fsh deleted file mode 100755 index 922d79b..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/pixelate.fsh +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://www.geeks3d.com/20101029/shader-library-pixelation-post-processing-effect-glsl/ - -uniform float dividerValue; -uniform float granularity; -uniform float targetWidth; -uniform float targetHeight; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec2 tc = qt_TexCoord0; - if (uv.x < dividerValue && granularity > 0.0) { - float dx = granularity / targetWidth; - float dy = granularity / targetHeight; - tc = vec2(dx*(floor(uv.x/dx) + 0.5), - dy*(floor(uv.y/dy) + 0.5)); - } - gl_FragColor = qt_Opacity * texture2D(source, tc); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/posterize.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/posterize.fsh deleted file mode 100755 index e5c77ce..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/posterize.fsh +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/ - -uniform float dividerValue; -uniform float gamma; -uniform float numColors; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 c = vec4(0.0); - if (uv.x < dividerValue) { - vec3 x = texture2D(source, uv).rgb; - x = pow(x, vec3(gamma, gamma, gamma)); - x = x * numColors; - x = floor(x); - x = x / numColors; - x = pow(x, vec3(1.0/gamma)); - c = vec4(x, 1.0); - } else { - c = texture2D(source, uv); - } - gl_FragColor = qt_Opacity * c; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/ripple.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/ripple.fsh deleted file mode 100755 index 6d4187c..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/ripple.fsh +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://labs.qt.nokia.com/2011/03/22/the-convenient-power-of-qml-scene-graph/ - -uniform float dividerValue; -uniform float targetWidth; -uniform float targetHeight; -uniform float time; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -const float PI = 3.1415926535; -const int ITER = 7; -const float RATE = 0.1; -uniform float amplitude; -uniform float n; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec2 tc = uv; - vec2 p = vec2(-1.0 + 2.0 * gl_FragCoord.x / targetWidth, -(-1.0 + 2.0 * gl_FragCoord.y / targetHeight)); - float diffx = 0.0; - float diffy = 0.0; - vec4 col; - if (uv.x < dividerValue) { - for (int i=0; i<ITER; ++i) { - float theta = float(i) * PI / float(ITER); - vec2 r = vec2(cos(theta) * p.x + sin(theta) * p.y, -1.0 * sin(theta) * p.x + cos(theta) * p.y); - float diff = (sin(2.0 * PI * n * (r.y + time * RATE)) + 1.0) / 2.0; - diffx += diff * sin(theta); - diffy += diff * cos(theta); - } - tc = 0.5*(vec2(1.0,1.0) + p) + amplitude * vec2(diffx, diffy); - } - gl_FragColor = qt_Opacity * texture2D(source, tc); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/selectionpanel.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/selectionpanel.fsh deleted file mode 100755 index 89d570e..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/selectionpanel.fsh +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sepia.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/sepia.fsh deleted file mode 100755 index 196c517..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sepia.fsh +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 orig = texture2D(source, uv); - vec3 col = orig.rgb; - float y = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(y + 0.15, y + 0.07, y - 0.12, 1.0); - else - gl_FragColor = qt_Opacity * orig; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sharpen.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/sharpen.fsh deleted file mode 100755 index 3907637..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sharpen.fsh +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -uniform float amount; -const float step_w = 0.0015625; -const float step_h = 0.0027778; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -vec3 sharpen(vec3 t1, vec3 t2, vec3 t3, vec3 t4, vec3 t5, vec3 t6, vec3 t7, vec3 t8, vec3 t9) -{ - return -t1 - t2 - t3 - t4 + amount * t5 - t6 - t7 - t8 - t9; -} - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec3 t1 = texture2D(source, vec2(uv.x - step_w, uv.y - step_h)).rgb; - vec3 t2 = texture2D(source, vec2(uv.x, uv.y - step_h)).rgb; - vec3 t3 = texture2D(source, vec2(uv.x + step_w, uv.y - step_h)).rgb; - vec3 t4 = texture2D(source, vec2(uv.x - step_w, uv.y)).rgb; - vec3 t5 = texture2D(source, uv).rgb; - vec3 t6 = texture2D(source, vec2(uv.x + step_w, uv.y)).rgb; - vec3 t7 = texture2D(source, vec2(uv.x - step_w, uv.y + step_h)).rgb; - vec3 t8 = texture2D(source, vec2(uv.x, uv.y + step_h)).rgb; - vec3 t9 = texture2D(source, vec2(uv.x + step_w, uv.y + step_h)).rgb; - vec3 col = sharpen(t1, t2, t3, t4, t5, t6, t7, t8, t9); - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(col, 1.0); - else - gl_FragColor = qt_Opacity * texture2D(source, uv); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/shockwave.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/shockwave.fsh deleted file mode 100755 index 64f33c8..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/shockwave.fsh +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/ - -uniform float centerX; -uniform float centerY; -uniform float dividerValue; -uniform float granularity; -uniform float time; -uniform float weight; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec2 tc = qt_TexCoord0; - vec2 center = vec2(centerX, centerY); - const vec3 shock = vec3(10.0, 1.5, 0.1); - if (uv.x < dividerValue) { - float distance = distance(uv, center); - if ((distance <= (time + shock.z)) && - (distance >= (time - shock.z))) { - float diff = (distance - time); - float powDiff = 1.0 - pow(abs(diff*shock.x), shock.y*weight); - float diffTime = diff * powDiff; - vec2 diffUV = normalize(uv - center); - tc += (diffUV * diffTime); - } - } - gl_FragColor = qt_Opacity * texture2D(source, tc); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sobeledgedetection1.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/sobeledgedetection1.fsh deleted file mode 100755 index 96732fa..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sobeledgedetection1.fsh +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on "Graphics Shaders: Theory and Practice" (http://cgeducation.org/ShadersBook/) - -uniform float dividerValue; -uniform float mixLevel; -uniform float resS; -uniform float resT; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 c = vec4(0.0); - if (uv.x < dividerValue) { - vec2 st = qt_TexCoord0.st; - vec3 irgb = texture2D(source, st).rgb; - vec2 stp0 = vec2(1.0 / resS, 0.0); - vec2 st0p = vec2(0.0 , 1.0 / resT); - vec2 stpp = vec2(1.0 / resS, 1.0 / resT); - vec2 stpm = vec2(1.0 / resS, -1.0 / resT); - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - float i00 = dot(texture2D(source, st).rgb, W); - float im1m1 = dot(texture2D(source, st-stpp).rgb, W); - float ip1p1 = dot(texture2D(source, st+stpp).rgb, W); - float im1p1 = dot(texture2D(source, st-stpm).rgb, W); - float ip1m1 = dot(texture2D(source, st+stpm).rgb, W); - float im10 = dot(texture2D(source, st-stp0).rgb, W); - float ip10 = dot(texture2D(source, st+stp0).rgb, W); - float i0m1 = dot(texture2D(source, st-st0p).rgb, W); - float i0p1 = dot(texture2D(source, st+st0p).rgb, W); - float h = -1.0*im1p1 - 2.0*i0p1 - 1.0*ip1p1 + 1.0*im1m1 + 2.0*i0m1 + 1.0*ip1m1; - float v = -1.0*im1m1 - 2.0*im10 - 1.0*im1p1 + 1.0*ip1m1 + 2.0*ip10 + 1.0*ip1p1; - float mag = 1.0 - length(vec2(h, v)); - vec3 target = vec3(mag, mag, mag); - c = vec4(target, 1.0); - } else { - c = texture2D(source, qt_TexCoord0); - } - gl_FragColor = qt_Opacity * c; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sobeledgedetection2.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/sobeledgedetection2.fsh deleted file mode 100755 index aa836ca..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/sobeledgedetection2.fsh +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://rastergrid.com/blog/downloads/frei-chen-edge-detector/ - -#version 130 -uniform sampler2D source; -uniform float dividerValue; -uniform float weight; -mat3 G[2] = mat3[]( - mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ), - mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 ) -); -uniform lowp float qt_Opacity; -in vec2 qt_TexCoord0; -out vec4 FragmentColor; -void main() { - vec2 uv = qt_TexCoord0.xy; - vec4 c = vec4(0.0); - if (uv.x < dividerValue) { - mat3 intensity; - float conv[2]; - vec3 sample; - for (int i=0; i<3; ++i) { - for (int j=0; j<3; ++j) { - sample = texelFetch(source, ivec2(gl_FragCoord) + ivec2(i-1, j-1), 0).rgb; - intensity[i][j] = length(sample) * weight; - } - } - for (int i=0; i<2; ++i) { - float dp3 = dot(G[i][0], intensity[0]) + dot(G[i][1], intensity[1]) + dot(G[i][2], intensity[2]); - conv[i] = dp3 * dp3; - } - c = vec4(0.5 * sqrt(conv[0]*conv[0] + conv[1]*conv[1])); - } else { - c = texture2D(source, qt_TexCoord0); - } - FragmentColor = qt_Opacity * c; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/tiltshift.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/tiltshift.fsh deleted file mode 100755 index becd9fe..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/tiltshift.fsh +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -const float step_w = 0.0015625; -const float step_h = 0.0027778; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -vec3 blur() -{ - vec2 uv = qt_TexCoord0.xy; - float y = uv.y < 0.4 ? uv.y : 1.0 - uv.y; - float dist = 8.0 - 20.0 * y; - vec3 acc = vec3(0.0, 0.0, 0.0); - for (float y=-2.0; y<=2.0; ++y) { - for (float x=-2.0; x<=2.0; ++x) { - acc += texture2D(source, vec2(uv.x + dist * x * step_w, uv.y + 0.5 * dist * y * step_h)).rgb; - } - } - return acc / 25.0; -} - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec3 col; - if (uv.x > dividerValue || (uv.y >= 0.4 && uv.y <= 0.6)) - col = texture2D(source, uv).rgb; - else - col = blur(); - gl_FragColor = qt_Opacity * vec4(col, 1.0); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/toon.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/toon.fsh deleted file mode 100755 index 2814dfb..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/toon.fsh +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://www.geeks3d.com/20101029/shader-library-pixelation-post-processing-effect-glsl/ - -uniform float dividerValue; -uniform float threshold; -uniform float resS; -uniform float resT; -uniform float magTol; -uniform float quantize; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec4 color = vec4(1.0, 0.0, 0.0, 1.1); - vec2 uv = qt_TexCoord0.xy; - if (uv.x < dividerValue) { - vec2 st = qt_TexCoord0.st; - vec3 rgb = texture2D(source, st).rgb; - vec2 stp0 = vec2(1.0/resS, 0.0); - vec2 st0p = vec2(0.0 , 1.0/resT); - vec2 stpp = vec2(1.0/resS, 1.0/resT); - vec2 stpm = vec2(1.0/resS, -1.0/resT); - float i00 = dot( texture2D(source, st).rgb, vec3(0.2125,0.7154,0.0721)); - float im1m1 = dot( texture2D(source, st-stpp).rgb, vec3(0.2125,0.7154,0.0721)); - float ip1p1 = dot( texture2D(source, st+stpp).rgb, vec3(0.2125,0.7154,0.0721)); - float im1p1 = dot( texture2D(source, st-stpm).rgb, vec3(0.2125,0.7154,0.0721)); - float ip1m1 = dot( texture2D(source, st+stpm).rgb, vec3(0.2125,0.7154,0.0721)); - float im10 = dot( texture2D(source, st-stp0).rgb, vec3(0.2125,0.7154,0.0721)); - float ip10 = dot( texture2D(source, st+stp0).rgb, vec3(0.2125,0.7154,0.0721)); - float i0m1 = dot( texture2D(source, st-st0p).rgb, vec3(0.2125,0.7154,0.0721)); - float i0p1 = dot( texture2D(source, st+st0p).rgb, vec3(0.2125,0.7154,0.0721)); - float h = -1.*im1p1 - 2.*i0p1 - 1.*ip1p1 + 1.*im1m1 + 2.*i0m1 + 1.*ip1m1; - float v = -1.*im1m1 - 2.*im10 - 1.*im1p1 + 1.*ip1m1 + 2.*ip10 + 1.*ip1p1; - float mag = sqrt(h*h + v*v); - if (mag > magTol) { - color = vec4(0.0, 0.0, 0.0, 1.0); - } - else { - rgb.rgb *= quantize; - rgb.rgb += vec3(0.5, 0.5, 0.5); - ivec3 irgb = ivec3(rgb.rgb); - rgb.rgb = vec3(irgb) / quantize; - color = vec4(rgb, 1.0); - } - } else { - color = texture2D(source, uv); - } - gl_FragColor = qt_Opacity * color; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/vignette.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/vignette.fsh deleted file mode 100755 index bd20c8e..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/vignette.fsh +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 orig = texture2D(source, uv); - float cr = pow(0.1, 2.0); - float pt = pow(uv.x - 0.5, 2.0) + pow(uv.y - 0.5, 2.0); - float d = pt - cr; - float cf = 1.0; - if (d > 0.0) - cf = 1.0 - 2.0 * d; - vec3 col = cf * orig.rgb; - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(col, 1.0); - else - gl_FragColor = qt_Opacity * orig; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/warhol.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/warhol.fsh deleted file mode 100755 index 6852495..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/warhol.fsh +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://kodemongki.blogspot.com/2011/06/kameraku-custom-shader-effects-example.html - -uniform float dividerValue; -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec4 orig = texture2D(source, uv); - vec3 col = orig.rgb; - float y = 0.3 *col.r + 0.59 * col.g + 0.11 * col.b; - y = y < 0.3 ? 0.0 : (y < 0.6 ? 0.5 : 1.0); - if (y == 0.5) - col = vec3(0.8, 0.0, 0.0); - else if (y == 1.0) - col = vec3(0.9, 0.9, 0.0); - else - col = vec3(0.0, 0.0, 0.0); - if (uv.x < dividerValue) - gl_FragColor = qt_Opacity * vec4(col, 1.0); - else - gl_FragColor = qt_Opacity * orig; -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/shaders/wobble.fsh b/QtDemo/qml/QtDemo/demos/cutetime/shaders/wobble.fsh deleted file mode 100755 index 1670de3..0000000 --- a/QtDemo/qml/QtDemo/demos/cutetime/shaders/wobble.fsh +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Based on http://labs.qt.nokia.com/2011/03/22/the-convenient-power-of-qml-scene-graph/ - -uniform float amplitude; -uniform float dividerValue; -uniform float frequency; -uniform float time; - -uniform sampler2D source; -uniform lowp float qt_Opacity; -varying vec2 qt_TexCoord0; - -void main() -{ - vec2 uv = qt_TexCoord0.xy; - vec2 tc = qt_TexCoord0; - if (uv.x < dividerValue) { - vec2 p = sin(time + frequency * qt_TexCoord0); - tc += amplitude * vec2(p.y, -p.x); - } - gl_FragColor = qt_Opacity * texture2D(source, tc); -} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectWobble.qml b/QtDemo/qml/QtDemo/demos/description/Content.qml index 4cccf48..15ec1e1 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectWobble.qml +++ b/QtDemo/qml/QtDemo/demos/description/Content.qml @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal @@ -40,22 +40,36 @@ ****************************************************************************/ import QtQuick 2.0 +import QtMultimedia 5.0 -Effect { - parameters: ListModel { - ListElement { - name: "amplitude" - value: 0.5 - } - } +Rectangle { + id: root + property alias videoPlayer: videoContent - // Transform slider values, and bind result to shader uniforms - property real amplitude: parameters.get(0).value * 0.05 + color: "black" - property real frequency: 20 - property real time: 0 + /*Rectangle { + id: videoContent + anchors.fill: root + color: "#262626" + function play() { print("fake play") } + function stop() { print("fake stop") } + }*/ - NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 } + ContentVideo { + id: videoContent + anchors.fill: root + visible: mediaSource == "" ? false : true + } - fragmentShaderFilename: "shaders/wobble.fsh" + function openVideo(path) { + stop(); + videoContent.mediaSource = path + } + + function stop() { + if (videoContent.mediaSource !== undefined) { + videoContent.stop(); + } + } } diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectBlackAndWhite.qml b/QtDemo/qml/QtDemo/demos/description/ContentVideo.qml index 37a3b6e..792a678 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/Effects/EffectBlackAndWhite.qml +++ b/QtDemo/qml/QtDemo/demos/description/ContentVideo.qml @@ -40,17 +40,28 @@ ****************************************************************************/ import QtQuick 2.0 +import QtMultimedia 5.0 -Effect { - parameters: ListModel { - ListElement { - name: "threshold" - value: 0.5 - } - } +VideoOutput { + id: videoOutput + source: mediaPlayer + fillMode: VideoOutput.PreserveAspectFit + property alias mediaSource: mediaPlayer.source + property alias mediaPlayer: mediaPlayer + property bool isPlaying: false - // Transform slider values, and bind result to shader uniforms - property real threshold: parameters.get(0).value + MediaPlayer { + id: mediaPlayer + autoLoad: true + autoPlay: true - fragmentShaderFilename: "shaders/blackandwhite.fsh" + onPlaybackStateChanged: { + if (playbackState === MediaPlayer.PlayingState) + videoOutput.isPlaying = true; + else + videoOutput.isPlaying = false; + } + } + function play() { mediaPlayer.play() } + function stop() { mediaPlayer.stop() } } diff --git a/QtDemo/qml/QtDemo/demos/cutetime/ControlBar.qml b/QtDemo/qml/QtDemo/demos/description/ControlBar.qml index e43f6f2..6adce50 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/ControlBar.qml +++ b/QtDemo/qml/QtDemo/demos/description/ControlBar.qml @@ -1,20 +1,18 @@ - import QtQuick 2.0 import QtMultimedia 5.0 Rectangle { id: controlBar - height: 150 + height: parent.height * 0.2 color: "#88333333" property MediaPlayer mediaPlayer: null property bool isMouseAbove: false + property int margin: parent.width * 0.01 + property double playBackHeight: height*0.48 + property double seekHeight: height*0.48 - signal openFile() - signal openCamera() signal openURL() - signal openFX() - signal toggleFullScreen() state: "VISIBLE" @@ -24,65 +22,34 @@ Rectangle { volumeControl.volume = mediaPlayer.volume; } -// MouseArea { -// anchors.fill: controlBar -// hoverEnabled: true - -// onEntered: controlBar.isMouseAbove = true; -// onExited: controlBar.isMouseAbove = false; -// } - - function statusString(stat) + function updateStatusText() { - if (stat === MediaPlayer.NoMedia) - return "No Media"; - else if (stat === MediaPlayer.Loading) - return "Loading"; - else if (stat === MediaPlayer.Loaded) - return "Loaded"; - else if (stat === MediaPlayer.Buffering) - return "Buffering"; - else if (stat === MediaPlayer.Stalled) - return "Stalled"; - else if (stat === MediaPlayer.Buffered) - return "Buffered"; - else if (stat === MediaPlayer.EndOfMedia) - return "EndOfMedia"; - else if (stat === MediaPlayer.InvalidMedia) - return "InvalidMedia"; - else if (stat === MediaPlayer.UnknownStatus) - return "UnknownStatus"; - } - -// Text { -// id: statusText -// anchors.left: parent.left -// anchors.bottom: parent.top -// anchors.bottomMargin: 12 -// font.pixelSize: 18 -// color: "white" -// text: "Status: " + statusString(mediaPlayer.status) -// } + var strText = "" + switch (mediaPlayer.status) { + case MediaPlayer.NoMedia: strText = "No Media"; break; + case MediaPlayer.Loading: strText = "Loading..."; break; + case MediaPlayer.Buffering: strText = "Buffering..."; break; + case MediaPlayer.Stalled: strText = "Stalled"; break; + case MediaPlayer.EndOfMedia: strText = "EndOfMedia"; break; + case MediaPlayer.InvalidMedia: strText = "InvalidMedia"; break; + case MediaPlayer.UnknownStatus: strText = "UnknownStatus"; break; + default: strText = ""; break; + } -// Text { -// anchors.verticalCenter: statusText.verticalCenter -// anchors.left: statusText.right -// anchors.leftMargin: 16 -// font.pixelSize: 18 -// color: "white" -// text: Math.round(mediaPlayer.bufferProgress * 100.0) + "%" -// } + statusText.text = strText; + } VolumeControl { id: volumeControl anchors.verticalCenter: playbackControl.verticalCenter anchors.left: controlBar.left - anchors.leftMargin: 15 - onVolumeChanged: mediaPlayer.volume = volume - - // Component.onCompleted: { - // volumeControl.volume = startingVolume; - // } + anchors.leftMargin: controlBar.margin + height: controlBar.playBackHeight + width: parent.width * 0.3 + onVolumeChanged: { + if (mediaPlayer !== null) + mediaPlayer.volume = volume + } Connections { target: mediaPlayer @@ -94,10 +61,14 @@ Rectangle { PlaybackControl { id: playbackControl anchors.horizontalCenter: controlBar.horizontalCenter - anchors.bottom: seekControl.top - anchors.bottomMargin: 20 + anchors.top: controlBar.top + anchors.topMargin: controlBar.margin + height: controlBar.playBackHeight onPlayButtonPressed: { + if (mediaPlayer === null) + return; + if (isPlaying) { mediaPlayer.pause(); } else { @@ -106,90 +77,67 @@ Rectangle { } onReverseButtonPressed: { + if (mediaPlayer === null) + return; + if (mediaPlayer.seekable) { - //Subtract 10 seconds + //Subtract 10 % mediaPlayer.seek(normalizeSeek(Math.round(-mediaPlayer.duration * 0.1))); } } onForwardButtonPressed: { + if (mediaPlayer === null) + return; + if (mediaPlayer.seekable) { - //Add 10 seconds + //Add 10 % mediaPlayer.seek(normalizeSeek(Math.round(mediaPlayer.duration * 0.1))); } } - onStopButtonPressed: mediaPlayer.stop(); - } - - //Toolbar Controls - Row { - id: toolbarMenuButtons - anchors.right: controlBar.right - anchors.rightMargin: 15 - anchors.verticalCenter: playbackControl.verticalCenter - spacing: 22 + onStopButtonPressed: { + if (mediaPlayer !== null) + mediaPlayer.stop(); - ImageButton { - id: fxButton - imageSource: "images/FXButton.png" - checkable: true - checked: effectSelectionPanel.visible - onClicked: { - openFX(); - } - } - ImageButton { - id: fileButton - imageSource: "images/FileButton.png" - onClicked: { - openFile(); - } - } - ImageButton { - id: urlButton - imageSource: "images/UrlButton.png" - onClicked: { - openURL(); - } + videoSelector.show(); } } -// ImageButton { -// id: fullscreenButton -// imageSource: "images/FullscreenButton.png" -// onClicked: { -// //Toggle fullscreen -// toggleFullScreen(); -// } -// checkable: true -// checked: applicationWindow.isFullScreen -// anchors.right: controlBar.right -// anchors.top: controlBar.top -// anchors.rightMargin: 15 -// anchors.topMargin: 15 -// } + Text { + id: statusText + anchors.right: parent.right + anchors.verticalCenter: playbackControl.verticalCenter + anchors.rightMargin: controlBar.margin + verticalAlignment: Text.AlignVCenter + height: controlBar.playBackHeight + font.pixelSize: playbackControl.height * 0.5 + color: "white" + } //Seek controls SeekControl { id: seekControl anchors.bottom: controlBar.bottom - anchors.bottomMargin: 10 anchors.right: controlBar.right anchors.left: controlBar.left - anchors.rightMargin: 15 - anchors.leftMargin: 15 - enabled: playbackControl.isPlaybackEnabled + height: controlBar.seekHeight + anchors.leftMargin: controlBar.margin + anchors.rightMargin: controlBar.margin - duration: mediaPlayer.duration + enabled: playbackControl.isPlaybackEnabled + duration: mediaPlayer !== null ? mediaPlayer.duration : 0 onSeekValueChanged: { - mediaPlayer.seek(newPosition); - position = mediaPlayer.position; + if (mediaPlayer !== null) { + mediaPlayer.seek(newPosition); + position = mediaPlayer.position; + } } Component.onCompleted: { - seekable = mediaPlayer.seekable; + if (mediaPlayer !== null) + seekable = mediaPlayer.seekable; } } @@ -203,7 +151,12 @@ Rectangle { playbackControl.isPlaybackEnabled = true; else playbackControl.isPlaybackEnabled = false; + updateStatusText(); + } + onErrorChanged: { + updateStatusText(); } + onPlaybackStateChanged: { if (mediaPlayer.playbackState === MediaPlayer.PlayingState) { playbackControl.isPlaying = true; @@ -215,19 +168,10 @@ Rectangle { } onSeekableChanged: { - // console.log("seekableChanged: " + mediaPlayer.seekable); seekControl.seekable = mediaPlayer.seekable; } } - function hide() { - controlBar.state = "HIDDEN"; - } - - function show() { - controlBar.state = "VISIBLE"; - } - //Usage: give the value you wish to modify position, //returns a value between 0 and duration function normalizeSeek(value) { @@ -239,6 +183,14 @@ Rectangle { return newPosition; } + function hide() { + controlBar.state = "HIDDEN"; + } + + function show() { + controlBar.state = "VISIBLE"; + } + states: [ State { name: "HIDDEN" diff --git a/QtDemo/qml/QtDemo/demos/cutetime/ImageButton.qml b/QtDemo/qml/QtDemo/demos/description/ImageButton.qml index 274efd5..19d9836 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/ImageButton.qml +++ b/QtDemo/qml/QtDemo/demos/description/ImageButton.qml @@ -4,6 +4,9 @@ import QtQuick 2.0 Item { id: root + height: parent.height + width: image.width * image.scale + property alias enabled: mouseArea.enabled property alias imageSource: image.source @@ -11,29 +14,20 @@ Item { property bool checked: false property alias hover: mouseArea.containsMouse property alias pressed: mouseArea.pressed + property double imageSize: 0.9*root.height opacity: enabled ? 1.0 : 0.3 signal clicked - width: image.width - height: image.height - Image { id: image anchors.centerIn: parent + scale: root.height / height * 0.9 visible: true opacity: pressed ? 0.6 : 1 smooth: true } -// ColorOverlay { -// id: glowEffect -// anchors.fill: image -// source: image -// color: pressed ? "#22000000" : checked ? "orange" : "white" -// visible: checked || hover || pressed -// } - MouseArea { id: mouseArea hoverEnabled: true diff --git a/QtDemo/qml/QtDemo/demos/cutetime/PlaybackControl.qml b/QtDemo/qml/QtDemo/demos/description/PlaybackControl.qml index 2dc609f..f0485fc 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/PlaybackControl.qml +++ b/QtDemo/qml/QtDemo/demos/description/PlaybackControl.qml @@ -3,8 +3,7 @@ import QtQuick 2.0 Row { id: root - spacing: 26 - height: playButton.height + spacing: controlBar.margin property bool isPlaybackEnabled: false property bool isPlaying: false @@ -20,33 +19,29 @@ Row { enabled: isPlaybackEnabled imageSource: "images/RateButtonReverse.png" anchors.verticalCenter: root.verticalCenter + onClicked: { reverseButtonPressed(); } } ImageButton { + id: stopButton + enabled: isPlaybackEnabled + imageSource: "images/StopButton.png" + anchors.verticalCenter: root.verticalCenter + onClicked: { + stopButtonPressed(); + } + } + ImageButton { id: playButton enabled: isPlaybackEnabled imageSource: !isPlaying ? "images/PlayButton.png" : "images/PauseButton.png" anchors.verticalCenter: root.verticalCenter -// anchors.right: rateForwardButton.left -// anchors.rightMargin: 10 onClicked: { playButtonPressed(); } } -// Rectangle{ -// enabled: isPlaybackEnabled -// color: "white" -// opacity: enabled ? 1 : 0.3 -// width: playButton.width -// height: width -// anchors.verticalCenter: root.verticalCenter -// MouseArea { -// anchors.fill: parent -// onClicked: stopButtonPressed(); -// } -// } ImageButton { id: rateForwardButton diff --git a/QtDemo/qml/QtDemo/demos/description/ScrollBar.qml b/QtDemo/qml/QtDemo/demos/description/ScrollBar.qml new file mode 100644 index 0000000..05b8c64 --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/ScrollBar.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 + +Item { + id: scrollBar + + // The properties that define the scrollbar's state. + // position and pageSize are in the range 0.0 - 1.0. They are relative to the + // height of the page, i.e. a pageSize of 0.5 means that you can see 50% + // of the height of the view. + property real position + property real pageSize + + // A light, semi-transparent background + Rectangle { + id: background + anchors.fill: parent + radius: width/2 - 1 + color: "transparent" + } + + Rectangle { + x: scrollBar.position * (scrollBar.width-2) + 1 + y: 1 + width: scrollBar.pageSize * (scrollBar.width-2) + height: parent.height + radius: height/2 - 1 + color: "#22aa22" + } +} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/SeekControl.qml b/QtDemo/qml/QtDemo/demos/description/SeekControl.qml index fa0842d..ff4e55a 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/SeekControl.qml +++ b/QtDemo/qml/QtDemo/demos/description/SeekControl.qml @@ -2,7 +2,6 @@ import QtQuick 2.0 Item { id: root - height: seekSlider.height property int position: 0 property int duration: 0 @@ -25,20 +24,21 @@ Item { id: elapsedText anchors.verticalCenter: seekSlider.verticalCenter anchors.left: root.left + verticalAlignment: Text.AlignVCenter + height: parent.height text: "00:00" - font.pixelSize: 20 + font.pixelSize: height * 0.4 color: "#cccccc" } Slider { id: seekSlider - anchors.leftMargin: 30 - anchors.rightMargin: 30 anchors.left: elapsedText.right anchors.right: remainingText.left anchors.verticalCenter: root.verticalCenter mutable: root.seekable enabled: root.enabled + height: parent.height minimum: 0.0 maximum: root.duration !== 0 ? root.duration : 1 @@ -53,8 +53,10 @@ Item { id: remainingText anchors.verticalCenter: seekSlider.verticalCenter anchors.right: root.right + verticalAlignment: Text.AlignVCenter + height: parent.height text: "00:00" - font.pixelSize: 20 + font.pixelSize: height * 0.4 color: "#cccccc" } diff --git a/QtDemo/qml/QtDemo/demos/cutetime/Slider.qml b/QtDemo/qml/QtDemo/demos/description/Slider.qml index 17fd8cd..f952163 100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/Slider.qml +++ b/QtDemo/qml/QtDemo/demos/description/Slider.qml @@ -3,7 +3,9 @@ import QtQuick 2.0 Item { id: slider - height: handleBack.height + anchors.leftMargin: handleBack.radius + anchors.rightMargin: handleBack.radius + // value is read/write. property real value: 0 property real maximum: 1 @@ -75,7 +77,7 @@ Item { Rectangle { id: handleBack - width: 40 + width: Math.max(10, Math.min(50, slider.height)) height: width radius: width / 2 color: "#8898c66c" @@ -86,7 +88,7 @@ Item { Rectangle { id: handle - width: 14 + width: Math.max(3,handleBack.height / 3) height: width radius: width / 2 antialiasing: true diff --git a/QtDemo/qml/QtDemo/demos/description/VideoDelegate.qml b/QtDemo/qml/QtDemo/demos/description/VideoDelegate.qml new file mode 100644 index 0000000..d904cb7 --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/VideoDelegate.qml @@ -0,0 +1,72 @@ +import QtQuick 2.0 + +Rectangle { + id: delegate + height: grid.cellHeight + width: grid.cellWidth + color: "transparent" + property int tileMargin: videoSelector.tileMargin + + signal videoSelected(string url) + + Rectangle { + anchors.left: parent.left + anchors.top: parent.top + anchors.topMargin: parent.tileMargin/2 + width: parent.width - tileMargin + height: parent.height - tileMargin + color: videoSelector.tileBackground + + MouseArea { + anchors.fill: parent + onClicked: { + grid.currentIndex = index + console.log(link) + delegate.videoSelected(link) + } + } + + states: [ + State { + name: "selected" + when: delegate.GridView.isCurrentItem + } + ] + + + Image { + id: iconImage + source: url + width: parent.width + height: parent.height + } + + Rectangle{ + width: parent.width + height: dateText.height + tileMargin + anchors.top: dateText.top + anchors.bottom: parent.bottom + color: "Black" + opacity: 0.5 + visible: iconImage.source + + } + + Text { + id: dateText + anchors.left: parent.left + anchors.leftMargin: tileMargin + anchors.bottom: parent.bottom + anchors.bottomMargin: tileMargin + anchors.right: parent.right + anchors.rightMargin: tileMargin + + color: videoSelector.textColor + text: title + width: parent.width; + wrapMode: Text.WordWrap; + font { family: videoSelector.uiFont; pointSize: videoSelector.tileFontSize } + } + } +} + diff --git a/QtDemo/qml/QtDemo/demos/description/VideoSelector.qml b/QtDemo/qml/QtDemo/demos/description/VideoSelector.qml new file mode 100644 index 0000000..5bb4e90 --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/VideoSelector.qml @@ -0,0 +1,123 @@ +import QtQuick 2.0 +import QtQuick.XmlListModel 2.0 + +Rectangle { + id: videoSelector + color: "transparent" + property int tileHeight: parseInt(grid.height / 2) + property int tileMargin: tileHeight * 0.05 + property int tileFontSize: tileHeight * 0.05 + property string tileBackground: "#262626" + property string textColor: "white" + property string uiFont: "Segoe UI" + + signal selectVideo(string url) + + state: "VISIBLE" + + onOpacityChanged: { + if (state === "HIDDEN" && opacity <= 0.05) + visible = false; + } + + XmlListModel { + id: videoModel + //source: "http://blog.qt.digia.com/feed/" + source: "http://news.yahoo.com/rss/tech" + //query: "/rss/channel/item" + // Filter out items that don't have images + query: "/rss/channel/item[exists(child::media:content)]" + namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" + XmlRole { name: "url"; query: "media:content/@url/string()" } + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "pubDate"; query: "pubDate/string()" } + XmlRole { name: "link"; query: "link/string()" } + } + + // Grid view + GridView { + id: grid + anchors.fill: parent + flow: GridView.TopToBottom + cellHeight: tileHeight + cellWidth: parseInt(tileHeight * 1.5) + cacheBuffer: cellWidth + clip: false + focus: true + model: videoModel + delegate: VideoDelegate { onVideoSelected: videoSelector.selectVideo("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4") } + + // Only show the scrollbars when the view is moving. + states: State { + when: grid.movingHorizontally + PropertyChanges { target: horizontalScrollBar; opacity: 1 } + } + + transitions: Transition { + NumberAnimation { properties: "opacity"; duration: 400 } + } + } + + ScrollBar { + id: horizontalScrollBar + width: parent.width; height: 6 + anchors.bottom: parent.bottom + anchors.left: parent.left + opacity: 0 + position: grid.visibleArea.xPosition + pageSize: grid.visibleArea.widthRatio + } + + function hide() { + videoSelector.state = "HIDDEN"; + } + + function show() { + videoSelector.visible = true; + videoSelector.state = "VISIBLE"; + } + + states: [ + State { + name: "HIDDEN" + PropertyChanges { + target: videoSelector + opacity: 0.0 + } + }, + State { + name: "VISIBLE" + PropertyChanges { + target: videoSelector + opacity: 0.95 + } + } + ] + + transitions: [ + Transition { + from: "HIDDEN" + to: "VISIBLE" + NumberAnimation { + id: showAnimation + target: videoSelector + properties: "opacity" + from: 0.0 + to: 1.0 + duration: 200 + } + }, + Transition { + from: "VISIBLE" + to: "HIDDEN" + NumberAnimation { + id: hideAnimation + target: videoSelector + properties: "opacity" + from: 0.95 + to: 0.0 + duration: 200 + } + } + ] +} diff --git a/QtDemo/qml/QtDemo/demos/cutetime/VolumeControl.qml b/QtDemo/qml/QtDemo/demos/description/VolumeControl.qml index e814b99..52b6242 100755..100644 --- a/QtDemo/qml/QtDemo/demos/cutetime/VolumeControl.qml +++ b/QtDemo/qml/QtDemo/demos/description/VolumeControl.qml @@ -3,9 +3,6 @@ import QtQuick 2.0 Item { id: root - width: 210 - height: volumeUp.height - property alias volume: volumeSlider.value //Volume Controls @@ -14,7 +11,6 @@ Item { imageSource: "images/VolumeDown.png" anchors.verticalCenter: root.verticalCenter anchors.left: root.left - scale: 1.4 onClicked: { root.volume = 0.0; } @@ -22,9 +18,8 @@ Item { Slider { id: volumeSlider anchors.left: volumeDown.right - anchors.leftMargin: 22 - anchors.rightMargin: 22 anchors.right: volumeUp.left + height: root.height maximum: 1.0 minimum: 0.0 anchors.verticalCenter: root.verticalCenter @@ -37,7 +32,6 @@ Item { anchors.verticalCenter: root.verticalCenter anchors.verticalCenterOffset: 1 anchors.right: root.right - scale: 1.4 onClicked: { root.volume = 1.0 } diff --git a/QtDemo/qml/QtDemo/demos/description/images/PauseButton.png b/QtDemo/qml/QtDemo/demos/description/images/PauseButton.png Binary files differnew file mode 100644 index 0000000..880d23a --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/PauseButton.png diff --git a/QtDemo/qml/QtDemo/demos/description/images/PlayButton.png b/QtDemo/qml/QtDemo/demos/description/images/PlayButton.png Binary files differnew file mode 100644 index 0000000..247fe32 --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/PlayButton.png diff --git a/QtDemo/qml/QtDemo/demos/description/images/RateButtonForward.png b/QtDemo/qml/QtDemo/demos/description/images/RateButtonForward.png Binary files differnew file mode 100644 index 0000000..ebfca0d --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/RateButtonForward.png diff --git a/QtDemo/qml/QtDemo/demos/description/images/RateButtonReverse.png b/QtDemo/qml/QtDemo/demos/description/images/RateButtonReverse.png Binary files differnew file mode 100644 index 0000000..1837bfd --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/RateButtonReverse.png diff --git a/QtDemo/qml/QtDemo/demos/description/images/StopButton.png b/QtDemo/qml/QtDemo/demos/description/images/StopButton.png Binary files differnew file mode 100644 index 0000000..76bcbc8 --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/StopButton.png diff --git a/QtDemo/qml/QtDemo/demos/description/images/VolumeDown.png b/QtDemo/qml/QtDemo/demos/description/images/VolumeDown.png Binary files differnew file mode 100644 index 0000000..255ce2c --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/VolumeDown.png diff --git a/QtDemo/qml/QtDemo/demos/description/images/VolumeUp.png b/QtDemo/qml/QtDemo/demos/description/images/VolumeUp.png Binary files differnew file mode 100644 index 0000000..7cc153a --- /dev/null +++ b/QtDemo/qml/QtDemo/demos/description/images/VolumeUp.png diff --git a/QtDemo/qml/QtDemo/demos/description/main.qml b/QtDemo/qml/QtDemo/demos/description/main.qml index d6d95cd..6463409 100644 --- a/QtDemo/qml/QtDemo/demos/description/main.qml +++ b/QtDemo/qml/QtDemo/demos/description/main.qml @@ -1,17 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + import QtQuick 2.0 +import QtMultimedia 5.0 Rectangle { - id: root - anchors.fill: parent - color: "#262626" - - Text { - id: text - anchors.centerIn: parent - width: parent.width - height: parent.height - wrapMode: Text.WordWrap - text: "This is under construction.\n\n Maybe we can show Qt description here?" - color: "white" + id: applicationWindow + focus: true + color: "black" + anchors.fill:parent + + MouseArea { + id: mouseActivityMonitor + anchors.fill: parent + + hoverEnabled: true + onClicked: { + if (controlBar.state === "VISIBLE") { + controlBar.hide(); + } else { + controlBar.show(); + controlBarTimer.restart(); + } + } + } + + signal resetTimer + onResetTimer: { + controlBar.show(); + controlBarTimer.restart(); + } + + Content { + id: content + anchors.fill: parent + } + + VideoSelector { + id: videoSelector + anchors.fill: parent + anchors.margins: applicationWindow.width * 0.02 + visible: true + onSelectVideo: { + videoSelector.hide() + content.openVideo(url) + content.videoPlayer.play() + } + onVisibleChanged: { + if (visible) + controlBar.hide() + else + controlBar.show() + } + } + + Timer { + id: controlBarTimer + interval: 4000 + running: false + + onTriggered: hideToolBars(); } + + ControlBar { + id: controlBar + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: applicationWindow.bottom + mediaPlayer: content.videoPlayer.mediaPlayer + } + + Component.onCompleted: { + controlBar.hide() + } + + property real volumeBeforeMuted: 1.0 + + Keys.onPressed: { + applicationWindow.resetTimer(); + if (event.key === Qt.Key_Up || event.key === Qt.Key_VolumeUp) { + content.videoPlayer.mediaPlayer.volume = Math.min(1, content.videoPlayer.mediaPlayer.volume + 0.1); + return; + } else if (event.key === Qt.Key_Down || event.key === Qt.Key_VolumeDown) { + if (event.modifiers & Qt.ControlModifier) { + if (content.videoPlayer.mediaPlayer.volume) { + volumeBeforeMuted = content.videoPlayer.mediaPlayer.volume; + content.videoPlayer.mediaPlayer.volume = 0 + } else { + content.videoPlayer.mediaPlayer.volume = volumeBeforeMuted; + } + } else { + content.videoPlayer.mediaPlayer.volume = Math.max(0, content.videoPlayer.mediaPlayer.volume - 0.1); + } + return; + } + + // What's next should be handled only if there's a loaded media + if (content.videoPlayer.mediaPlayer.status !== MediaPlayer.Loaded + && content.videoPlayer.mediaPlayer.status !== MediaPlayer.Buffered) + return; + + if (event.key === Qt.Key_Space) { + if (content.videoPlayer.mediaPlayer.playbackState === MediaPlayer.PlayingState) + content.videoPlayer.mediaPlayer.pause() + else if (content.videoPlayer.mediaPlayer.playbackState === MediaPlayer.PausedState + || content.videoPlayer.mediaPlayer.playbackState === MediaPlayer.StoppedState) + content.videoPlayer.mediaPlayer.play() + } else if (event.key === Qt.Key_Left) { + content.videoPlayer.mediaPlayer.seek(Math.max(0, content.videoPlayer.mediaPlayer.position - 30000)); + return; + } else if (event.key === Qt.Key_Right) { + content.videoPlayer.mediaPlayer.seek(Math.min(content.videoPlayer.mediaPlayer.duration, content.videoPlayer.mediaPlayer.position + 30000)); + return; + } + } + + function hideToolBars() { + if (!controlBar.isMouseAbove && content.videoPlayer.isPlaying) + controlBar.hide(); + } + } |