1 /*****************************************************************************
2 * Copyright (C) 2019 VLC authors and VideoLAN
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * ( at your option ) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
17 *****************************************************************************/
20 import QtQuick.Layouts 1.3
21 import QtQuick.Controls 2.4
22 import org.videolan.vlc 0.1
24 import "qrc:///utils/" as Utils
25 import "qrc:///style/"
27 import "qrc:///player/" as Player
28 import "qrc:///about/" as AB
29 import "qrc:///dialogs/" as DG
30 import "qrc:///playlist/" as PL
31 import QtQuick.Window 2.11
38 id: playlistWindowLoader
39 active: !rootWindow.playlistDocked && rootWindow.playlistVisible
40 sourceComponent: Window {
42 title: qsTr("Playlist")
43 color: VLCStyle.colors.bg
44 onClosing: rootWindow.playlistVisible = false
53 PlaylistControllerModel {
54 id: mainPlaylistController
55 playlistPtr: mainctx.playlist
70 console.log("onActionCancel")
71 history.previous(History.Go)
76 readonly property var pageModel: [
77 { name: "about", component: aboutComp },
78 { name: "mc", url: "qrc:///medialibrary/MainDisplay.qml" },
79 { name: "playlist", url: "qrc:///playlist/PlaylistMainView.qml" },
80 { name: "player", component: audioplayerComp },
83 function loadCurrentHistoryView() {
84 var current = history.current
85 if ( !current || !current.view ) {
86 console.warn("unable to load requested view, undefined")
89 stackView.loadView(root.pageModel, current.view, current.viewProperties)
94 onCurrentChanged: loadCurrentHistoryView()
97 Component.onCompleted: {
98 //set the initial view
100 history.push(["mc", "video"], History.Go)
102 history.push(["playlist"], History.Go)
108 onEntered: console.log("drop Enter")
109 onExited: console.log("drop exit")
113 for (var i = 0; i < drop.urls.length; i++){
114 list.push(drop.urls[i])
116 mainPlaylistController.append(list, true)
128 onPlayingStateChanged: {
129 if (player.playingState === PlayerController.PLAYING_STATE_STOPPED
130 && history.current.view === "player") {
131 history.previous(History.Go)
137 target: player.videoTracks
139 if (player.videoTracks.rowCount() > 0
140 && player.playingState === PlayerController.PLAYING_STATE_PLAYING
141 && history.current.view !== "player") {
142 history.push(["player"], History.Go)
153 stackView.focus = true