diff --git a/demos/qml/audioplayer/audioplayer.qml b/demos/qml/audioplayer/audioplayer.qml deleted file mode 100644 index 9c40c127..00000000 --- a/demos/qml/audioplayer/audioplayer.qml +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2011 Harald Sitter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -import Qt 4.7 -import Phonon 1.0 - -Rectangle { - width: 64 - height: 64 - color: "black" - - Image { - id: icon - anchors.centerIn: parent - width: 32; - height: 32; - source: "media-playback-start.png" - - Media { - id: mediaElement - source: "sound.wav" - - onPlayingChanged: { - if (!playing) { - stop() - icon.source = "media-playback-start.png" - } else { - icon.source = "media-playback-stop.png" - } - } - - AudioOutput { - id: audioOutput - volume: -10 - } - } - - MouseArea { - anchors.fill: parent - onPressed: { - if (mediaElement.playing) - mediaElement.stop() - else - mediaElement.play() - } - } - } -} diff --git a/demos/qml/audioplayer/media-playback-start.png b/demos/qml/audioplayer/media-playback-start.png deleted file mode 100644 index 71906857..00000000 Binary files a/demos/qml/audioplayer/media-playback-start.png and /dev/null differ diff --git a/demos/qml/audioplayer/media-playback-stop.png b/demos/qml/audioplayer/media-playback-stop.png deleted file mode 100644 index 650874f6..00000000 Binary files a/demos/qml/audioplayer/media-playback-stop.png and /dev/null differ diff --git a/demos/qml/videoplayer/VideoBrowser.qml b/demos/qml/videoplayer/VideoBrowser.qml deleted file mode 100644 index 08307b89..00000000 --- a/demos/qml/videoplayer/VideoBrowser.qml +++ /dev/null @@ -1,225 +0,0 @@ -/* - Copyright (C) 2011 Harald Sitter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -import QtQuick 1.0 -import Qt.labs.folderlistmodel 1.0 -import Phonon 1.0 - -Rectangle { - id: browser - - anchors.fill: parent - color: palette.window - - SystemPalette { id: palette } - - - FolderListModel { - id: foldermodel - folder: "/home/me/Videos" - } - - Component { - id: filedelegate - - Item { - id: fileDelegateItem - height: 52 - width: browser.width - - function exec() { - if (foldermodel.isFolder(index)) - foldermodel.folder = filePath; - else - master.play(filePath); - } - - 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) } - } - } - - Row { - spacing: 5 - - Image { - width: 48; height: 48; - source: (foldermodel.isFolder(index)) ? "folder-grey.png" : "" - } - - Media { - id: media - source: (shouldPreview()) ? filePath : "" - visible: shouldPreview() - - function shouldPreview() { - if (foldermodel.isFolder(index)) - return false; - var path = filePath + '' // Apparently filePath is no String. - var suffix = path.substring(path.lastIndexOf(".")+1) - if (suffix === "avi" || - suffix === "mkv" || - suffix === "mp4" || - suffix === "webm" || - suffix === "ogv" || - suffix === "wmv" || - suffix === "mov") - return true; - return false; - } - - onSourceChanged: { - if (source != "") - play() - } - - onStateChanged: { - if (!shouldPreview()) - return; -// if (paused) -// play() - if (stopped) - play() - } - - onVisibleChanged: { - if (!shouldPreview()) - return; - if (!visible) - pause() - else - play() - } - - Video { - width: 48; height: 48 - } - } - - Text { - id: nameText - - text: fileName - font.pixelSize: 32 - color: palette.windowText - elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter - } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: exec() - } - states: [ - State { - name: "pressed" - when: mouseArea.pressed - PropertyChanges { target: highlight; visible: true } - PropertyChanges { target: nameText; color: palette.highlightedText } - } - ] - } - } - - ListView { - id: view - - anchors.top: titleBar.bottom - anchors.bottom: parent.bottom - width: parent.width - cacheBuffer: 520 - - model: foldermodel - delegate: filedelegate - } - - - BorderImage { - id: titleBar - - property int heightOffset: 7 - - source: "titlebar.sci"; - width: parent.width; - anchors.top: parent.top - height: 52 - - Item { - width: parent.width - height: parent.height - parent.heightOffset - - Rectangle { - id: upButton - - width: 48 - height: parent.height - color: "transparent" - - Image { anchors.centerIn: parent; source: "go-up.png" } - - MouseArea { - id: upArea; - anchors.fill: parent - onClicked: { - if (foldermodel.parentFolder != "") - foldermodel.folder = foldermodel.parentFolder - } - } - - states: [ - State { - name: "pressed" - when: upArea.pressed - PropertyChanges { target: upButton; color: palette.highlight } - } - ] - } - - // visual separator - Rectangle { - id: titleSeperator - color: "gray" - width: 1 - height: parent.height - anchors.left: upButton.right - } - - Text { - anchors { - left: titleSeperator.right; right: parent.right; - leftMargin: 4; rightMargin: 4 - verticalCenter: parent.verticalCenter - } - text: foldermodel.folder - color: "white" - elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter - font.pixelSize: 32 - } - } - } - -} diff --git a/demos/qml/videoplayer/VideoPlayer.qml b/demos/qml/videoplayer/VideoPlayer.qml deleted file mode 100644 index 8e422f70..00000000 --- a/demos/qml/videoplayer/VideoPlayer.qml +++ /dev/null @@ -1,384 +0,0 @@ -/* - Copyright (C) 2011 Harald Sitter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -import Qt 4.7 -import QtDesktop 0.1 -import Phonon 1.0 - -Rectangle { - id: player - - property bool wasVisibleOnce: false - - function play(path) { - focus = true - media.source = path - media.play() - } - - function stop() { - media.stop() - } - - width: 800 - height: 480 - color: "black" - focus: true - - Timer { - function reset() { - restart() - video.cursorVisible = true - controls.showControls = true - } - - function undo() { - stop() - video.cursorVisible = true - controls.showControls = true - } - - id: movementTimer - running: true - interval: 2000 - onTriggered:{ - video.cursorVisible = false - controls.showControls = false - } - } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - onMousePositionChanged: movementTimer.reset() - onEntered: movementTimer.start() - onExited: movementTimer.undo() - } - - Keys.onPressed: { - if (event.key == Qt.Key_Space) - media.togglePlay() - } - - onVisibleChanged: { - if (wasVisibleOnce && !visible) - video.fullScreen = false - if (!wasVisibleOnce && visible) - wasVisibleOnce = true - } - - Media { - id: media - - property string timeString: parseTime(time) - property string remainingTimeString: "-" + parseTime(totalTime - time) - property string totalTimeString: parseTime(totalTime) - - function togglePlay() { - (media.playing) ? media.pause() : media.play() - } - - function padIntString(number) { - var str = '' + number; - if (str.length < 2) - str = '0' + str; - return str; - } - - function parseTime(ms) { - // Do not display hour unless there is anything to show. - // Always show minutes and seconds though. - // Rationale: plenty of videos are <1h but >1m - var showHour = true - if (totalTime < 3600000) - showHour = false - - var s = Math.floor(ms / 1000) - var m = Math.floor( s / 60) - if (showHour) - var h = Math.floor(m / 60) - - var time = ''; - time = padIntString(s % 60) - time = padIntString(m % 60) + ':' + time - if (showHour) - // Do not pad hour as it looks ugly, also hour can exceed 24 anyway. - time = h + ':' + time - return time - } - - AudioOutput { - id: audio - } - - Video { - id: video - width: player.width - height: player.height - opacity: 0 - - ContextMenu { - id: videoContext - MenuItem { text: "Bling"; enabled: false } - MenuItem { - text: "Meta Data" - onSelected: player.state = 'metaDataDisplay' - } - } - - MouseArea { - anchors.fill: parent - onDoubleClicked: video.fullScreen = !video.fullScreen - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.RightButton - onPressed: videoContext.showPopup(mouseX, mouseY) - } - - states: [ - State { - name: "playing" - // Must not change state on pause. - when: media.playing || media.paused - PropertyChanges { target: video; opacity: 1 } - } - ] - - transitions: Transition { - from: "" - to: "playing" - reversible: true - SequentialAnimation { - PropertyAnimation { - target: video; - properties: "opacity" - easing.type: Easing.InOutExpo; - duration: 2000 - } - } - } - } - } - - Image { - id: controls - - property bool showControls: true - - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - source: "controls-background.png" - opacity: 0.788235294118 - - Image { - anchors { top: parent.top; topMargin: 15; left: parent.left; leftMargin: 15 } - source: "fullscreen-button.png" - - MouseArea { - anchors.fill: parent - onClicked: video.fullScreen = !video.fullScreen - } - } - - Row { - anchors { top: parent.top; topMargin: 15; horizontalCenter: controls.horizontalCenter } - spacing: 30 - - Image { source: "backward-button.png" } - - Image { - id: playPause - - source: "play-button.png" - - MouseArea { - anchors.fill: parent - onClicked: media.togglePlay() - } - - states: [ - State { - when: !media.playing - name: "paused" - PropertyChanges { target: playPause; source: "play-button.png" } - }, - State { - when: media.playing - name: "playing" - PropertyChanges { target: playPause; source: "pause-button.png" } - } - ] - } - - Image { source: "forward-button.png" } - } - - Slider { - id: volumeSlider - - width: 136 - height: 19 - anchors { top: parent.top; topMargin: 20; right: parent.right; rightMargin: 20 } - updateValueWhileDragging: true - groove: Image { source: "volume-bar.png" } - handle: Image { source: "volume-slider.png" } - - value: Math.round(100 * audio.volume) - minimumValue: 0 - maximumValue: 100 - - Binding { - when: volumeSlider.pressed - target: audio - property: "volume" - value: volumeSlider.value * 0.01 - } - - Binding { - when: !volumeSlider.pressed - target: parent - property: "value" - value: Math.round(100 * audio.volume) - } - - WheelArea { - anchors.fill: parent - verticalMinimumValue: parent.minimumValue - verticalMaximumValue: parent.maximumValue - property double step: (parent.maximumValue - parent.minimumValue)/100 - - onVerticalWheelMoved: audio.volume += ((verticalDelta/4*step) * 0.01) - } - } - - Slider { - id: progressSlider - - enabled: media.seekable - width: 749 - height: 19 - anchors { bottom: timeIndicator.top; bottomMargin: 5; horizontalCenter: parent.horizontalCenter } - updateValueWhileDragging: true - groove: Image { source: "progress-bar.png" } - handle: Image { source: "volume-slider.png" } - - value: media.time - minimumValue: 0 - maximumValue: media.totalTime - - Binding { - when: progressSlider.pressed - target: media - property: "time" - value: progressSlider.value - } - - Binding { - when: !progressSlider.pressed - target: parent - property: "value" - value: media.time - } - - WheelArea { - anchors.fill: parent - verticalMinimumValue: parent.minimumValue - verticalMaximumValue: parent.maximumValue - property double step: (parent.maximumValue - parent.minimumValue)/100 - - onVerticalWheelMoved: media.time += (verticalDelta/4*step) - } - } - - Item { - id: timeIndicator - - anchors { - left: progressSlider.left; leftMargin: 5 - right: progressSlider.right; rightMargin: 5 - bottom: parent.bottom; bottomMargin: 20 - } - - Text { - anchors.left: parent.left - text: media.timeString - color: "white" - font.bold: true - } - - Text { - anchors.right: parent.right - text: media.remainingTimeString - color: "white" - font.bold: true - } - } - - states: State { - name: "hide"; when: controls.showControls == false - PropertyChanges { target: controls; opacity: 0 } - } - - transitions: Transition { - from: "" - to: "hide" - reversible: true - SequentialAnimation { - PropertyAnimation { - target: controls; - properties: "opacity" - easing.type: Easing.InOutExpo; - duration: 500 - } - } - } - } - - Rectangle { - id: metaData - x: 300 - y: 140 - width: 200 - height: 200 - color: "#ffffff" - visible: false - - Column { - anchors.fill: parent - spacing: 16 - - Text { text: "Artist: " + media.metaData.artist; font.pixelSize: 12 } - Text { text: "Title: " + media.metaData.title; font.pixelSize: 12 } - Text { text: "Album: " + media.metaData.album; font.pixelSize: 12 } - } - - Button { - text: "Roger!" - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - onClicked: player.state = '' - } - } - - states: State { name: "metaDataDisplay"; PropertyChanges { target: metaData; visible: true } } -} diff --git a/demos/qml/videoplayer/VideoPlayer.qmlproject b/demos/qml/videoplayer/VideoPlayer.qmlproject deleted file mode 100644 index 807782be..00000000 --- a/demos/qml/videoplayer/VideoPlayer.qmlproject +++ /dev/null @@ -1,20 +0,0 @@ -/* File generated by Qt Creator, version 2.2.81 */ - -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ "../exampleplugin" ] -} diff --git a/demos/qml/videoplayer/backward-button.png b/demos/qml/videoplayer/backward-button.png deleted file mode 100644 index 783c91d5..00000000 Binary files a/demos/qml/videoplayer/backward-button.png and /dev/null differ diff --git a/demos/qml/videoplayer/controls-background.png b/demos/qml/videoplayer/controls-background.png deleted file mode 100644 index f6dfab5a..00000000 Binary files a/demos/qml/videoplayer/controls-background.png and /dev/null differ diff --git a/demos/qml/videoplayer/folder-grey.png b/demos/qml/videoplayer/folder-grey.png deleted file mode 100644 index 8c0722ca..00000000 Binary files a/demos/qml/videoplayer/folder-grey.png and /dev/null differ diff --git a/demos/qml/videoplayer/forward-button.png b/demos/qml/videoplayer/forward-button.png deleted file mode 100644 index 0d89102a..00000000 Binary files a/demos/qml/videoplayer/forward-button.png and /dev/null differ diff --git a/demos/qml/videoplayer/fullscreen-button.png b/demos/qml/videoplayer/fullscreen-button.png deleted file mode 100644 index c12abb32..00000000 Binary files a/demos/qml/videoplayer/fullscreen-button.png and /dev/null differ diff --git a/demos/qml/videoplayer/go-up.png b/demos/qml/videoplayer/go-up.png deleted file mode 100644 index 86d1f71a..00000000 Binary files a/demos/qml/videoplayer/go-up.png and /dev/null differ diff --git a/demos/qml/videoplayer/main.qml b/demos/qml/videoplayer/main.qml deleted file mode 100644 index 40bf6127..00000000 --- a/demos/qml/videoplayer/main.qml +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2011 Harald Sitter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -import QtQuick 1.0 - -Rectangle { - id: master - width: 800 - height: 480 - - state: "Browsing" - - function play(path) { - player.play(path) - master.state = "Playing" - } - - VideoBrowser { - id : browser - anchors.fill: parent - } - - VideoPlayer { - id: player - anchors.fill: parent - - MouseArea { - id: mousecontrol - anchors.fill: parent - acceptedButtons: Qt.MiddleButton - onPressed: { - if (mouse.button == Qt.MiddleButton) { - mouse.accepted = true - player.stop() - master.state = "Browsing" - } else - mouse.accepted = false - } - } - } - - states: [ - State { - name: "Browsing" - PropertyChanges { target: browser; visible: true } - PropertyChanges { target: player; visible: false } - }, - State { - name: "Playing" - PropertyChanges { target: browser; visible: false; opacity: 0 } - PropertyChanges { target: player; visible: true } - } - ] -} diff --git a/demos/qml/videoplayer/meegovideoplayer.qml b/demos/qml/videoplayer/meegovideoplayer.qml deleted file mode 100644 index 718a77e1..00000000 --- a/demos/qml/videoplayer/meegovideoplayer.qml +++ /dev/null @@ -1,98 +0,0 @@ -/* - Copyright (C) 2011 Harald Sitter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -import QtQuick 1.0 -import Phonon 1.0 -import com.nokia.meego 1.0 - -PageStackWindow { - id: player - - showStatusBar: false - platformStyle: platformStyle.cornersVisible = false - initialPage: mainPage - - Page { - id: mainPage - - Media { - id: media - anchors.top: parent.top - source: "video.ogv" - - onStateChanged: { - if (playing) - playPause.state = "playing" - else - playPause.state = "paused" - } - - onTotalTimeChanged: { progressSlider.maximumValue = totalTime } - onTimeChanged: { progressSlider.value = time } - - AudioOutput { - id: audio - // onVolumeChanged: { volumeSlider.value = volume * 100.0 } - } - - Video { - id: video - width: mainPage.width - height: mainPage.height - } - } - - tools: ToolBarLayout { - id: layout - ToolIcon { - id: playPause - iconSource: "play-button.png" - onClicked: { - if (playPause.state == 'playing') { - media.stop() - playPause.state = 'paused' - } else { - media.play() - playPause.state = 'playing' - } - } - states: [ - State { - name: "paused" - PropertyChanges { target: playPause; iconSource: "play-button.png" } - }, - State { - name: "playing" - PropertyChanges { target: playPause; iconSource: "pause-button.png" } - } - ] - } - Slider { - id: progressSlider - width: parent.width - playPause.width; - onPressedChanged: { - if (pressed) return - media.time = value - } - } - } - } -} diff --git a/demos/qml/videoplayer/pause-button.png b/demos/qml/videoplayer/pause-button.png deleted file mode 100644 index 357a446c..00000000 Binary files a/demos/qml/videoplayer/pause-button.png and /dev/null differ diff --git a/demos/qml/videoplayer/play-button.png b/demos/qml/videoplayer/play-button.png deleted file mode 100644 index 778175e7..00000000 Binary files a/demos/qml/videoplayer/play-button.png and /dev/null differ diff --git a/demos/qml/videoplayer/progress-bar.png b/demos/qml/videoplayer/progress-bar.png deleted file mode 100644 index 0d87f515..00000000 Binary files a/demos/qml/videoplayer/progress-bar.png and /dev/null differ diff --git a/demos/qml/videoplayer/titlebar.sci b/demos/qml/videoplayer/titlebar.sci deleted file mode 100644 index d297aa48..00000000 --- a/demos/qml/videoplayer/titlebar.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 10 -border.top: 12 -border.bottom: 12 -border.right: 10 -source: titlebar2.png diff --git a/demos/qml/videoplayer/titlebar2.png b/demos/qml/videoplayer/titlebar2.png deleted file mode 100644 index 625120b1..00000000 Binary files a/demos/qml/videoplayer/titlebar2.png and /dev/null differ diff --git a/demos/qml/videoplayer/volume-bar.png b/demos/qml/videoplayer/volume-bar.png deleted file mode 100644 index 880214f6..00000000 Binary files a/demos/qml/videoplayer/volume-bar.png and /dev/null differ diff --git a/demos/qml/videoplayer/volume-slider.png b/demos/qml/videoplayer/volume-slider.png deleted file mode 100644 index 409d2419..00000000 Binary files a/demos/qml/videoplayer/volume-slider.png and /dev/null differ