From 0446271eb6ce5f2f24662031ce55fcf6ee500ba4 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Mon, 19 Oct 2015 13:48:23 +0200 Subject: Initial commit of Pelagicore's Neptune-UI with squashed history. Change-Id: I36747394458e3528f38ed9c078334c260f22d53b Reviewed-by: Lars Knoll --- apps/NotAvailableYet.qml | 48 ++++++ apps/com.pelagicore.browser/Browser.qml | 47 ++++++ apps/com.pelagicore.browser/icon.png | Bin 0 -> 2303 bytes apps/com.pelagicore.browser/info.yaml | 14 ++ apps/com.pelagicore.movies/MovieCoverDelegate.qml | 86 ++++++++++ apps/com.pelagicore.movies/MoviePlayer.qml | 165 ++++++++++++++++++++ apps/com.pelagicore.movies/MovieProvider.qml | 73 +++++++++ apps/com.pelagicore.movies/MovieTracks.qml | 140 +++++++++++++++++ apps/com.pelagicore.movies/Movies.qml | 61 ++++++++ apps/com.pelagicore.movies/icon.png | Bin 0 -> 1519 bytes apps/com.pelagicore.movies/info.yaml | 14 ++ apps/com.pelagicore.movies/qmldir | 1 + apps/com.pelagicore.music/AlbumScreen.qml | 95 ++++++++++++ apps/com.pelagicore.music/ClusterWidget.qml | 108 +++++++++++++ apps/com.pelagicore.music/CoverItem.qml | 81 ++++++++++ apps/com.pelagicore.music/CurrentTrackScreen.qml | 181 ++++++++++++++++++++++ apps/com.pelagicore.music/Music.qml | 74 +++++++++ apps/com.pelagicore.music/MusicProvider.qml | 88 +++++++++++ apps/com.pelagicore.music/PlaylistContainer.qml | 144 +++++++++++++++++ apps/com.pelagicore.music/icon.png | Bin 0 -> 1913 bytes apps/com.pelagicore.music/info.yaml | 14 ++ apps/com.pelagicore.music/qmldir | 1 + 22 files changed, 1435 insertions(+) create mode 100644 apps/NotAvailableYet.qml create mode 100644 apps/com.pelagicore.browser/Browser.qml create mode 100644 apps/com.pelagicore.browser/icon.png create mode 100644 apps/com.pelagicore.browser/info.yaml create mode 100644 apps/com.pelagicore.movies/MovieCoverDelegate.qml create mode 100644 apps/com.pelagicore.movies/MoviePlayer.qml create mode 100644 apps/com.pelagicore.movies/MovieProvider.qml create mode 100644 apps/com.pelagicore.movies/MovieTracks.qml create mode 100644 apps/com.pelagicore.movies/Movies.qml create mode 100644 apps/com.pelagicore.movies/icon.png create mode 100644 apps/com.pelagicore.movies/info.yaml create mode 100644 apps/com.pelagicore.movies/qmldir create mode 100644 apps/com.pelagicore.music/AlbumScreen.qml create mode 100644 apps/com.pelagicore.music/ClusterWidget.qml create mode 100644 apps/com.pelagicore.music/CoverItem.qml create mode 100644 apps/com.pelagicore.music/CurrentTrackScreen.qml create mode 100644 apps/com.pelagicore.music/Music.qml create mode 100644 apps/com.pelagicore.music/MusicProvider.qml create mode 100644 apps/com.pelagicore.music/PlaylistContainer.qml create mode 100644 apps/com.pelagicore.music/icon.png create mode 100644 apps/com.pelagicore.music/info.yaml create mode 100644 apps/com.pelagicore.music/qmldir (limited to 'apps') diff --git a/apps/NotAvailableYet.qml b/apps/NotAvailableYet.qml new file mode 100644 index 0000000..c3e8349 --- /dev/null +++ b/apps/NotAvailableYet.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + +AppUIScreen { + id: root + + hspan: 24 + vspan: 24 + + title: 'Not available' + + Label { + width: parent.width + anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: Qt.AlignHCenter + text: "The application is not available yet" + font.pixelSize: Style.fontSizeXL + } +} diff --git a/apps/com.pelagicore.browser/Browser.qml b/apps/com.pelagicore.browser/Browser.qml new file mode 100644 index 0000000..2e93642 --- /dev/null +++ b/apps/com.pelagicore.browser/Browser.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + + +AppUIScreen { + id: root + + UIScreen { + WebBrowser { + id: browser + anchors.fill: parent + anchors.leftMargin: Style.cellHeight * 4 + url: "http://pelagicore.com" + } + + onBackScreen: root.back() + } +} diff --git a/apps/com.pelagicore.browser/icon.png b/apps/com.pelagicore.browser/icon.png new file mode 100644 index 0000000..a4cf9a0 Binary files /dev/null and b/apps/com.pelagicore.browser/icon.png differ diff --git a/apps/com.pelagicore.browser/info.yaml b/apps/com.pelagicore.browser/info.yaml new file mode 100644 index 0000000..271c91d --- /dev/null +++ b/apps/com.pelagicore.browser/info.yaml @@ -0,0 +1,14 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'com.pelagicore.browser' +icon: 'icon.png' +code: 'Browser.qml' +runtime: 'qml' +name: + en: 'Browser' + de: 'Schmoekerer' + +categories: [ 'app' ] + +built-in: yes diff --git a/apps/com.pelagicore.movies/MovieCoverDelegate.qml b/apps/com.pelagicore.movies/MovieCoverDelegate.qml new file mode 100644 index 0000000..f682854 --- /dev/null +++ b/apps/com.pelagicore.movies/MovieCoverDelegate.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtGraphicalEffects 1.0 +import utils 1.0 +import controls 1.0 + +UIElement { + id: root + hspan: 4 + vspan: 7 + signal clicked() + property alias source: image.source + property alias title: title.text + property bool selected + + Rectangle { + anchors.fill: parent + anchors.topMargin: -Style.paddingS + color: Style.colorGrey + border.color: Qt.lighter(color, 1.2) + opacity: root.selected?0.2:0.0 + Behavior on opacity { NumberAnimation {} } + } + ColumnLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 0 + Item { + anchors.horizontalCenter: parent.horizontalCenter + width: height*0.70 + height: Style.vspan(6) + Rectangle { + anchors.fill: parent + color: Style.colorWhite + border.color: Qt.darker(color, 1.2) + } + Image { + id: image + anchors.fill: parent + anchors.margins: Style.paddingS + fillMode: Image.PreserveAspectCrop + asynchronous: true + smooth: true + } + } + Label { + id: title + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + font.weight: Font.Light + font.pixelSize: Style.fontSizeXS + vspan: 1 + elide: Text.ElideRight + } + } + MouseArea { + anchors.fill: parent + onClicked: root.clicked() + } +} diff --git a/apps/com.pelagicore.movies/MoviePlayer.qml b/apps/com.pelagicore.movies/MoviePlayer.qml new file mode 100644 index 0000000..1504c63 --- /dev/null +++ b/apps/com.pelagicore.movies/MoviePlayer.qml @@ -0,0 +1,165 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 +import QtMultimedia 5.0 +import QtGraphicalEffects 1.0 + +import controls 1.0 +import utils 1.0 +import "." + +UIScreen { + id: root + hspan: 24 + vspan: 24 + + title: 'Movies' + + property bool active: false + property bool hideControls: false + + property var track: MovieProvider.currentEntry + + + Video { + id: video + anchors.fill: parent + source: MovieProvider.sourcePath(root.track.source) + autoPlay: true + + property bool running: playbackState === MediaPlayer.PlayingState + + function togglePlay() { + if (running) { + pause() + } else { + play() + } + } + } + + Rectangle { + anchors.fill: toolBar + anchors.margins: -Style.paddingL + color: '#000' + opacity: toolBar.opacity * 0.85 + radius: 8 + } + ColumnLayout { + id: toolBar + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: Style.vspan(4) + spacing: 0 + opacity: root.hideControls?0.0:1.0 + Behavior on opacity { + NumberAnimation { duration: 1000 } + } + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: Style.hspan(2) + Tool { + name: 'prev' + onClicked: MovieService.previous() + } + Tool { + name: video.running?'pause':'play' + onClicked: video.togglePlay() + } + Tool { + name: 'next' + onClicked: MovieProvider.next() + } + } + Slider { + anchors.horizontalCenter: parent.horizontalCenter + value: video.position + minimum: 0.00 + maximum: video.duration + vspan: 1 + function valueToString() { + return Math.floor(value/60000) + ':' + Math.floor((value/1000)%60) + } + onActiveValueChanged: { + video.seek(activeValue) + } + } + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 0 + Symbol { + hspan: 1 + vspan: 2 + size: Style.symbolSizeXS + name: 'speaker' + } + VolumeSlider { + hspan: 8 + vspan: 2 + anchors.horizontalCenter: parent.horizontalCenter + value: video.volume + onValueChanged: { + video.volume = value + } + } + Label { + hspan: 1 + vspan: 2 + text: Math.floor(video.volume*100) + } + } + + } + + MouseArea { + id: clickOverlay + anchors.fill: parent + onClicked: { + root.hideControls = false + enabled = false + hideTimer.start() + } + } + + Timer { + id: hideTimer + interval: 5000 + running: video.running + onTriggered: { + root.hideControls = true + clickOverlay.enabled = true + } + } + + Component.onDestruction: { + // required to avoid crashing qmllive + video.source = '' + } +} diff --git a/apps/com.pelagicore.movies/MovieProvider.qml b/apps/com.pelagicore.movies/MovieProvider.qml new file mode 100644 index 0000000..98065ed --- /dev/null +++ b/apps/com.pelagicore.movies/MovieProvider.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +pragma Singleton +import QtQuick 2.1 +import com.pelagicore.datasource 1.0 +import service.movie 1.0 + +SqlQueryDataSource { + id: root + database: "media" + + property int currentIndex: 0 + property var currentEntry: get(currentIndex); + property url currentSource: storageLocation + '/media/movies/' + currentEntry.source + property url currentCover: storageLocation + '/media/movies/' + currentEntry.cover + + function selectRandom() { + root.currentIndex = -1 + query = 'select * from movies order by random()' + root.currentIndex = 0 + } + + function coverPath(cover) { + return Qt.resolvedUrl(storageLocation + '/media/movies/' + cover) + } + + function sourcePath(source) { + return Qt.resolvedUrl(storageLocation + '/media/movies/' + source) + } + + function next() { + print('$movies.nextTrack()') + root.currentIndex++ + } + + function previous() { + print('$movies.previousTrack()') + root.currentIndex-- + } + + Component.onCompleted: { + MovieService.movieProvider = root + MovieService.trackCount = Qt.binding(function() { return root.count}) + MovieService.currentTrack = Qt.binding(function() { return root.get(root.currentIndex)}) + MovieService.currentIndex = Qt.binding(function() { return root.currentIndex}) + print("Movie provider completed") + } +} diff --git a/apps/com.pelagicore.movies/MovieTracks.qml b/apps/com.pelagicore.movies/MovieTracks.qml new file mode 100644 index 0000000..4d4e31a --- /dev/null +++ b/apps/com.pelagicore.movies/MovieTracks.qml @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 +import QtMultimedia 5.0 +import QtGraphicalEffects 1.0 + +import controls 1.0 +import utils 1.0 +import "." + +UIScreen { + id: root + hspan: 24 + vspan: 24 + + title: 'Movies' + + signal playMovie() + + property var track: MovieProvider.currentEntry + + + ColumnLayout { + anchors.centerIn: parent + spacing: 0 + UIElement { + hspan: 24 + vspan: 10 + RowLayout { + anchors.fill: parent + spacing: 0 + Spacer { + hspan: 8 + vspan: 8 + } + Item { + width: Style.hspan(4) + height: Style.vspan(10) + Rectangle { + anchors.fill: parent + color: Style.colorWhite + border.color: Qt.darker(color, 1.2) + } + Image { + id: image + anchors.fill: parent + source: MovieProvider.coverPath(root.track.cover) + fillMode: Image.PreserveAspectCrop + sourceSize.width: image.width + sourceSize.height: image.height + asynchronous: true + + } + } + ColumnLayout { + spacing: 0 + Label { + hspan: 10 + text: root.track.title + } + Label { + hspan: 10 + text: root.track.genre + } + Label { + hspan: 10 + text: Qt.formatDate(root.track.year, 'MMMM yyyy') + } + Label { + hspan: 10 + Layout.fillHeight: true + text: root.track.desc; wrapMode: Text.WrapAtWordBoundaryOrAnywhere + font.pixelSize: Style.fontSizeS + elide: Text.ElideRight + verticalAlignment: Text.AlignTop + } + Button { + text: 'PLAY NOW' + Layout.alignment: Qt.AlignRight + onClicked: root.playMovie() + } + } + } + } + + Spacer { + vspan: 1 + } + + ListView { + id: view + anchors.horizontalCenter: parent.horizontalCenter + orientation: Qt.Horizontal + width: Style.hspan(22) + height: Style.vspan(8) + currentIndex: MovieProvider.currentIndex + highlightMoveDuration: 150 + delegate: MovieCoverDelegate { + hspan: 4 + source: MovieProvider.coverPath(model.cover) + title: model.title + onClicked: MovieProvider.currentIndex = index + selected: ListView.isCurrentItem + } + } + } + + Component.onCompleted: { + MovieProvider.selectRandom() + view.model = MovieProvider.model + print("Movie Tracks completed") + } +} diff --git a/apps/com.pelagicore.movies/Movies.qml b/apps/com.pelagicore.movies/Movies.qml new file mode 100644 index 0000000..1682470 --- /dev/null +++ b/apps/com.pelagicore.movies/Movies.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtQuick.Controls 1.0 +import utils 1.0 +import controls 1.0 + +AppUIScreen { + id: root + StackView { + id: stack + anchors.fill: parent + initialItem: movieTracks + + Component { + id: movieTracks + MovieTracks { + onBackScreen: { + root.back() + } + onPlayMovie: { + stack.push(moviePlayer) + } + } + } + + Component { + id: moviePlayer + MoviePlayer { + onBackScreen: { + stack.pop() + } + } + } + } +} diff --git a/apps/com.pelagicore.movies/icon.png b/apps/com.pelagicore.movies/icon.png new file mode 100644 index 0000000..c05412b Binary files /dev/null and b/apps/com.pelagicore.movies/icon.png differ diff --git a/apps/com.pelagicore.movies/info.yaml b/apps/com.pelagicore.movies/info.yaml new file mode 100644 index 0000000..d82665b --- /dev/null +++ b/apps/com.pelagicore.movies/info.yaml @@ -0,0 +1,14 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'com.pelagicore.movies' +icon: 'icon.png' +code: 'Movies.qml' +runtime: 'qml' +name: + en: 'Movies' + de: 'Filme' + +categories: [ 'app' ] + +built-in: yes diff --git a/apps/com.pelagicore.movies/qmldir b/apps/com.pelagicore.movies/qmldir new file mode 100644 index 0000000..781e828 --- /dev/null +++ b/apps/com.pelagicore.movies/qmldir @@ -0,0 +1 @@ +singleton MovieProvider 1.0 MovieProvider.qml diff --git a/apps/com.pelagicore.music/AlbumScreen.qml b/apps/com.pelagicore.music/AlbumScreen.qml new file mode 100644 index 0000000..ea74ce4 --- /dev/null +++ b/apps/com.pelagicore.music/AlbumScreen.qml @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import "." + +UIScreen { + id: root + hspan: 24 + vspan: 24 + + + PathView { + id: view + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: parent.right + height: Style.vspan(12) + model: MusicProvider.model + pathItemCount: 5 + currentIndex: MusicProvider.currentIndex + path: Path { + startX: -Style.hspan(3) + startY: view.height/2 + PathLine { + x: view.width+Style.hspan(3) + y: view.height/2 + } + } + snapMode: PathView.SnapToItem + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + + delegate: CoverItem { + source: MusicProvider.coverPath(model.cover) + title: model.title + subTitle: model.artist + onClicked: { + MusicProvider.currentIndex = index + root.backScreen() + } + } + } + + Image { + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + source: Style.gfx('shadow_left') + } + + Image { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + source: Style.gfx('shadow_right') + } + + Tool { + hspan: 2 + vspan: 2 + anchors.left: parent.left + anchors.top: parent.top + anchors.margins: Style.padding + name: 'back' + onClicked: root.backScreen() + } + +} diff --git a/apps/com.pelagicore.music/ClusterWidget.qml b/apps/com.pelagicore.music/ClusterWidget.qml new file mode 100644 index 0000000..d1a2cee --- /dev/null +++ b/apps/com.pelagicore.music/ClusterWidget.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import utils 1.0 +import controls 1.0 +import "." + +Item { + width: 800 + height: parent.height + + ListView { + id: playListView + width: 400 + height: parent.height + anchors.centerIn: parent + clip: true + model: MusicProvider.model + currentIndex: MusicProvider.currentIndex + highlight: Rectangle { + color: Style.colorWhite; opacity: 0.25 + border.color: Qt.lighter(color, 1.2) + } + highlightMoveDuration: 75 + delegate: UIElement { + hspan: 4 + vspan: 2 + RowLayout { + anchors.fill: parent + spacing: 0 + Item { + Layout.fillHeight: true + width: Style.hspan(1) + Item { + anchors.fill: parent + anchors.margins: Style.padding + Rectangle { + anchors.fill: parent + anchors.leftMargin: -6 + anchors.rightMargin: -6 + anchors.topMargin: -2 + anchors.bottomMargin: -2 + color: Style.colorWhite + } + + Image { + anchors.centerIn: parent + height: parent.height + width: parent.height + source: MusicProvider.coverPath(model.cover) + fillMode: Image.PreserveAspectCrop + asynchronous: true + } + } + } + ColumnLayout { + spacing: 0 + Label { + text: model.title + font.pixelSize: Style.fontSizeXS + opacity: 0.5 + elide: Text.ElideRight + Layout.fillWidth: true + } + Label { + text: model.artist + font.pixelSize: Style.fontSizeS + Layout.fillWidth: true + elide: Text.ElideRight + } + } + } + MouseArea { + anchors.fill: parent + onClicked: { + MusicProvider.currentIndex = index + } + } + } + } +} + diff --git a/apps/com.pelagicore.music/CoverItem.qml b/apps/com.pelagicore.music/CoverItem.qml new file mode 100644 index 0000000..e8de3da --- /dev/null +++ b/apps/com.pelagicore.music/CoverItem.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtGraphicalEffects 1.0 +import utils 1.0 +import controls 1.0 + +UIElement { + id: root + hspan: 6 + vspan: 12 + signal clicked() + property alias source: image.source + property alias title: title.text + property alias subTitle: subTitle.text + + ColumnLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 0 + Item { + anchors.horizontalCenter: parent.horizontalCenter + width: Style.hspan(5) + height: width + Rectangle { + anchors.fill: parent + color: Style.colorWhite + border.color: Qt.darker(color, 1.2) + } + Image { + id: image + anchors.fill: parent + anchors.margins: Style.paddingXS + fillMode: Image.PreserveAspectCrop + asynchronous: true + } + } + Label { + id: title + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + font.weight: Font.Light + opacity: 0.5 + } + Label { + id: subTitle + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + font.pixelSize: Style.fontSizeS + } + } + MouseArea { + anchors.fill: parent + onClicked: root.clicked() + } +} diff --git a/apps/com.pelagicore.music/CurrentTrackScreen.qml b/apps/com.pelagicore.music/CurrentTrackScreen.qml new file mode 100644 index 0000000..f43ba04 --- /dev/null +++ b/apps/com.pelagicore.music/CurrentTrackScreen.qml @@ -0,0 +1,181 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import service.music 1.0 +import "." + +UIScreen { + id: root + hspan: 24 + vspan: 24 + + title: 'Music' + + property var track: MusicProvider.currentEntry + + signal showAlbums() + + ColumnLayout { + width: Style.hspan(14) + height: Style.vspan(20) + anchors.centerIn: parent + spacing: 0 + Spacer {} + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 0 + Tool { + hspan: 2 + name: 'prev' + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: Style.vspan(-1) + onClicked: { + if (pathView.currentViewIndex === 0) + pathView.currentViewIndex = MusicProvider.count - 1 + else + pathView.currentViewIndex -- + } + } + + SwipeView { + id: pathView + itemWidth: Style.cellWidth * 6 + + width: Style.cellWidth * 6 + height: Style.cellHeight * 12 + + items: MusicProvider.model + + currentViewIndex: MusicProvider.currentIndex + + onCurrentViewIndexChanged: MusicProvider.currentIndex = pathView.currentViewIndex + + delegate: CoverItem { + z: PathView.z + scale: PathView.scale + source: MusicProvider.coverPath(model.cover) + title: model.title + subTitle: model.artist + onClicked: { + root.showAlbums() + } + } + + } + + Tool { + hspan: 2 + name: 'next' + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: Style.vspan(-1) + onClicked: { + if (pathView.currentViewIndex === MusicProvider.count - 1) + pathView.currentViewIndex = 0 + else + pathView.currentViewIndex ++ + } + } + } + Slider { + anchors.horizontalCenter: parent.horizontalCenter + hspan: 10 + value: MusicService.position + minimum: 0.00 + maximum: MusicService.duration + vspan: 1 + function valueToString() { + return Math.floor(value/60000) + ':' + Math.floor((value/1000)%60) + } + onActiveValueChanged: { + MusicService.seek(activeValue) + } + } + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 0 + Tool { + hspan: 2 + name: 'shuffle' + onClicked: toggle() + size: Style.symbolSizeXS + } + Spacer { hspan: 2 } + Tool { + hspan: 2 + name: MusicService.playing?'pause':'play' + onClicked: MusicService.togglePlay() + } + Spacer { hspan: 2 } + Tool { + hspan: 2 + name: 'loop' + onClicked: toggle() + size: Style.symbolSizeXS + } + } + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 0 + Symbol { + vspan: 2 + hspan: 1 + size: Style.symbolSizeXS + name: 'speaker' + } + VolumeSlider { + hspan: 8 + vspan: 2 + anchors.horizontalCenter: parent.horizontalCenter + value: MusicService.volume + onValueChanged: { + MusicService.volume = value + } + } + Label { + hspan: 1 + vspan: 2 + text: Math.floor(MusicService.volume*100) + } + } + Spacer { + Layout.fillWidth: true + Layout.fillHeight: true + } + } + + PlaylistContainer { + onClicked: pathView.currentViewIndex = index + } + + Component.onCompleted: MusicProvider.selectRandomTracks() + +} diff --git a/apps/com.pelagicore.music/Music.qml b/apps/com.pelagicore.music/Music.qml new file mode 100644 index 0000000..1335fce --- /dev/null +++ b/apps/com.pelagicore.music/Music.qml @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 +import "." + +AppUIScreen { + id: root + + onClusterKeyPressed: { + if (key === Qt.Key_Down) { + MusicProvider.currentIndex-- + } + else if (key === Qt.Key_Up) { + MusicProvider.currentIndex++ + } + } + + cluster: ClusterWidget {} + + AppStackView { + id: stack + anchors.fill: parent + initialItem: currentTrack + Component { + id: currentTrack + CurrentTrackScreen { + onBackScreen: { + root.back() + } + onShowAlbums: { + stack.push(albums) + } + } + } + + Component { + id: albums + AlbumScreen { + onBackScreen: { + stack.pop() + } + + } + } + } +} diff --git a/apps/com.pelagicore.music/MusicProvider.qml b/apps/com.pelagicore.music/MusicProvider.qml new file mode 100644 index 0000000..cdd8fa5 --- /dev/null +++ b/apps/com.pelagicore.music/MusicProvider.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +pragma Singleton +import QtQuick 2.1 +import com.pelagicore.datasource 1.0 +import service.music 1.0 + +SqlQueryDataSource { + id: root + + database: "media" + query: 'select * from music' + property int currentIndex: 0 + property var currentEntry: get(currentIndex); + property url currentSource: storageLocation + '/media/music/' + currentEntry.source + property url currentCover: storageLocation + '/media/music/' + currentEntry.cover + + function queryAllAlbums() { + return 'select distinct album, cover, artist from music' + } + + function queryAlbum(artist, album) { + return 'select * from music' + } + + function selectRandomTracks() { + currentIndex = -1 + root.query = 'select * from music order by random()' + currentIndex = 0 + } + + + function coverPath(cover) { + return Qt.resolvedUrl(storageLocation + '/media/music/' + cover) + } + + function sourcePath(source) { + return Qt.resolvedUrl(storageLocation + '/media/music/' + source) + } + + function next() { + print('MusicService.nextTrack()') + if (root.currentIndex < root.count - 1) + currentIndex++ + } + + function previous() { + print('MusicService.previousTrack()') + if (currentIndex > 0) + currentIndex-- + } + + Component.onCompleted: { + MusicService.musicProvider = root + MusicService.currentIndex = Qt.binding(function() { return root.currentIndex}) + MusicService.currentTrack = Qt.binding(function() { return root.currentEntry}) + MusicService.trackCount = Qt.binding(function() { return root.count}) + MusicService.coverPath = Qt.binding(function() { return root.currentCover}) + MusicService.url = Qt.binding(function() { return root.currentSource}) + print("MusicProvider completed") + + } +} diff --git a/apps/com.pelagicore.music/PlaylistContainer.qml b/apps/com.pelagicore.music/PlaylistContainer.qml new file mode 100644 index 0000000..6d4967c --- /dev/null +++ b/apps/com.pelagicore.music/PlaylistContainer.qml @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import utils 1.0 +import controls 1.0 +import "." + +RowLayout { + id: playListContainer + + signal clicked(int index) + + spacing: 5 + anchors.right: parent.right + anchors.top: parent.top + anchors.topMargin: Style.vspan(1) + height: Style.vspan(16) + width: Style.hspan(5) + anchors.rightMargin: expanded ? Style.hspan(0) : -Style.hspan(4) + Behavior on anchors.rightMargin { + NumberAnimation { easing.type: Easing.InCirc; duration: 250 } + } + + property bool expanded: false + + function toggleExpand() { + expanded = !expanded + } + + Tool { + name: 'music' + Layout.alignment: Qt.AlignTop + onClicked: { + playListContainer.toggleExpand() + } + } + Timer { + id: closer + interval: 3000 + onTriggered: { + playListContainer.expanded = false + } + } + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + color: '#000' + anchors.margins: -Style.padding + ListView { + id: playListView + anchors.fill: parent + clip: true + model: MusicProvider.model + currentIndex: MusicProvider.currentIndex + highlight: Rectangle { + color: Style.colorWhite; opacity: 0.25 + border.color: Qt.lighter(color, 1.2) + } + highlightMoveDuration: 75 + delegate: UIElement { + hspan: 5 + vspan: 2 + RowLayout { + anchors.fill: parent + spacing: 0 + Item { + Layout.fillHeight: true + width: Style.hspan(1) + Item { + anchors.fill: parent + anchors.margins: Style.padding + Rectangle { + anchors.fill: parent + anchors.leftMargin: -6 + anchors.rightMargin: -6 + anchors.topMargin: -2 + anchors.bottomMargin: -2 + color: Style.colorWhite + } + + Image { + anchors.centerIn: parent + height: parent.height + width: parent.height + source: MusicProvider.coverPath(model.cover) + fillMode: Image.PreserveAspectCrop + asynchronous: true + } + } + } + ColumnLayout { + spacing: 0 + Label { + text: model.title + font.pixelSize: Style.fontSizeXS + opacity: 0.5 + elide: Text.ElideRight + Layout.fillWidth: true + } + Label { + text: model.artist + font.pixelSize: Style.fontSizeS + Layout.fillWidth: true + elide: Text.ElideRight + } + } + } + MouseArea { + anchors.fill: parent + onClicked: { + playListContainer.clicked(index) + closer.restart() + } + } + } + } + } +} diff --git a/apps/com.pelagicore.music/icon.png b/apps/com.pelagicore.music/icon.png new file mode 100644 index 0000000..77bd3df Binary files /dev/null and b/apps/com.pelagicore.music/icon.png differ diff --git a/apps/com.pelagicore.music/info.yaml b/apps/com.pelagicore.music/info.yaml new file mode 100644 index 0000000..9f7ca22 --- /dev/null +++ b/apps/com.pelagicore.music/info.yaml @@ -0,0 +1,14 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'com.pelagicore.music' +icon: 'icon.png' +code: 'Music.qml' +runtime: 'qml' +name: + en: 'Music' + de: 'Musik' + +categories: [ 'media' ] + +built-in: yes diff --git a/apps/com.pelagicore.music/qmldir b/apps/com.pelagicore.music/qmldir new file mode 100644 index 0000000..8214887 --- /dev/null +++ b/apps/com.pelagicore.music/qmldir @@ -0,0 +1 @@ +singleton MusicProvider 1.0 MusicProvider.qml -- cgit v1.2.3