centralize and fixup example sources install targets
This follows suit with aeb036e in qtbase. Change-Id: Ie8580d0a1f38ab9858b0e44c9f99bdc552a1752a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
committed by
The Qt Project
parent
90c8ba233b
commit
6b4994c265
80
examples/multimedia/video/qmlvideo/qml/qmlvideo/Button.qml
Normal file
80
examples/multimedia/video/qmlvideo/qml/qmlvideo/Button.qml
Normal file
@@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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: textColor
|
||||
radius: 0.25 * height
|
||||
|
||||
property string text
|
||||
property color bgColor: "white"
|
||||
property color bgColorSelected: "red"
|
||||
property color textColor: "black"
|
||||
property alias enabled: mouseArea.enabled
|
||||
|
||||
signal clicked
|
||||
|
||||
Rectangle {
|
||||
anchors { fill: parent; margins: 1 }
|
||||
color: mouseArea.pressed ? bgColorSelected : bgColor
|
||||
radius: 0.25 * height
|
||||
|
||||
Text {
|
||||
id: text
|
||||
anchors.centerIn: parent
|
||||
text: root.text
|
||||
font.pixelSize: 0.5 * parent.height
|
||||
color: mouseArea.pressed ? bgColor : textColor
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
root.clicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneBasic {
|
||||
contentType: "camera"
|
||||
started: true
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneDrag {
|
||||
contentType: "camera"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
// Item which is loaded by CameraItem if QtMultimediaKit is not available
|
||||
Rectangle {
|
||||
id: root
|
||||
color: "grey"
|
||||
height: width
|
||||
|
||||
signal fatalError
|
||||
signal sizeChanged
|
||||
signal framePainted
|
||||
|
||||
Text {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
color: "white"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "Failed to create Camera item\n\nCheck that QtMultimediaKit is installed"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
onWidthChanged: height = width
|
||||
onHeightChanged: root.sizeChanged()
|
||||
|
||||
function start() { }
|
||||
function stop() { }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneFullScreen {
|
||||
contentType: "camera"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneFullScreenInverted {
|
||||
contentType: "camera"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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: root
|
||||
height: width
|
||||
source: camera
|
||||
|
||||
signal fatalError
|
||||
signal sizeChanged
|
||||
|
||||
onHeightChanged: root.sizeChanged()
|
||||
|
||||
Camera {
|
||||
id: camera
|
||||
|
||||
onError: {
|
||||
if (Camera.NoError != error) {
|
||||
console.log("[qmlvideo] CameraItem.onError error " + error + " errorString " + errorString)
|
||||
root.fatalError()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function start() { camera.start() }
|
||||
function stop() { camera.stop() }
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneMove {
|
||||
contentType: "camera"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneOverlay {
|
||||
contentType: "camera"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneResize {
|
||||
contentType: "camera"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneRotate {
|
||||
contentType: "camera"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneSpin {
|
||||
contentType: "camera"
|
||||
}
|
||||
164
examples/multimedia/video/qmlvideo/qml/qmlvideo/Content.qml
Normal file
164
examples/multimedia/video/qmlvideo/qml/qmlvideo/Content.qml
Normal file
@@ -0,0 +1,164 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
border.color: "white"
|
||||
border.width: showBorder ? 1 : 0
|
||||
color: "transparent"
|
||||
property string contentType // "camera" or "video"
|
||||
property string source
|
||||
property real volume
|
||||
property bool dummy: false
|
||||
property bool autoStart: true
|
||||
property bool started: false
|
||||
property bool showFrameRate: false
|
||||
property bool showBorder: false
|
||||
|
||||
signal initialized
|
||||
signal error
|
||||
signal videoFramePainted
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
}
|
||||
|
||||
Connections {
|
||||
id: framePaintedConnection
|
||||
onFramePainted: {
|
||||
if (frameRateLoader.item)
|
||||
frameRateLoader.item.notify()
|
||||
root.videoFramePainted()
|
||||
}
|
||||
ignoreUnknownSignals: true
|
||||
}
|
||||
|
||||
Connections {
|
||||
id: errorConnection
|
||||
onFatalError: {
|
||||
console.log("[qmlvideo] Content.onFatalError")
|
||||
stop()
|
||||
root.error()
|
||||
}
|
||||
ignoreUnknownSignals: true
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: frameRateLoader
|
||||
source: root.showFrameRate ? "../frequencymonitor/FrequencyItem.qml" : ""
|
||||
onLoaded: {
|
||||
item.parent = root
|
||||
item.anchors.top = root.top
|
||||
item.anchors.right = root.right
|
||||
item.anchors.margins = 10
|
||||
}
|
||||
}
|
||||
|
||||
onWidthChanged: {
|
||||
if (contentItem())
|
||||
contentItem().width = width
|
||||
}
|
||||
|
||||
onHeightChanged: {
|
||||
if (contentItem())
|
||||
contentItem().height = height
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
console.log("[qmlvideo] Content.initialize: contentType " + contentType)
|
||||
if ("video" == contentType) {
|
||||
console.log("[qmlvideo] Content.initialize: loading VideoItem.qml")
|
||||
contentLoader.source = "VideoItem.qml"
|
||||
if (Loader.Error == contentLoader.status) {
|
||||
console.log("[qmlvideo] Content.initialize: loading VideoDummy.qml")
|
||||
contentLoader.source = "VideoDummy.qml"
|
||||
dummy = true
|
||||
}
|
||||
contentLoader.item.volume = volume
|
||||
} else if ("camera" == contentType) {
|
||||
console.log("[qmlvideo] Content.initialize: loading CameraItem.qml")
|
||||
contentLoader.source = "CameraItem.qml"
|
||||
if (Loader.Error == contentLoader.status) {
|
||||
console.log("[qmlvideo] Content.initialize: loading CameraDummy.qml")
|
||||
contentLoader.source = "CameraDummy.qml"
|
||||
dummy = true
|
||||
}
|
||||
} else {
|
||||
console.log("[qmlvideo] Content.initialize: error: invalid contentType")
|
||||
}
|
||||
if (contentLoader.item) {
|
||||
contentLoader.item.sizeChanged.connect(updateRootSize)
|
||||
contentLoader.item.parent = root
|
||||
contentLoader.item.width = root.width
|
||||
framePaintedConnection.target = contentLoader.item
|
||||
errorConnection.target = contentLoader.item
|
||||
if (root.autoStart)
|
||||
root.start()
|
||||
}
|
||||
console.log("[qmlvideo] Content.initialize: complete")
|
||||
root.initialized()
|
||||
}
|
||||
|
||||
function start() {
|
||||
console.log("[qmlvideo] Content.start")
|
||||
if (contentLoader.item) {
|
||||
if (root.contentType == "video")
|
||||
contentLoader.item.mediaSource = root.source
|
||||
contentLoader.item.start()
|
||||
root.started = true
|
||||
}
|
||||
}
|
||||
|
||||
function stop() {
|
||||
console.log("[qmlvideo] Content.stop")
|
||||
if (contentLoader.item) {
|
||||
contentLoader.item.stop()
|
||||
if (root.contentType == "video")
|
||||
contentLoader.item.mediaSource = ""
|
||||
root.started = false
|
||||
}
|
||||
}
|
||||
|
||||
function contentItem() { return contentLoader.item }
|
||||
function updateRootSize() { root.height = contentItem().height }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 QtSystemInfo 5.0
|
||||
|
||||
Item {
|
||||
ScreenSaver {
|
||||
screenSaverInhibited: true
|
||||
}
|
||||
}
|
||||
107
examples/multimedia/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
Normal file
107
examples/multimedia/video/qmlvideo/qml/qmlvideo/ErrorDialog.qml
Normal file
@@ -0,0 +1,107 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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: "transparent"
|
||||
opacity: 0.0
|
||||
property alias enabled: mouseArea.enabled
|
||||
state: enabled ? "on" : "baseState"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "on"
|
||||
PropertyChanges {
|
||||
target: root
|
||||
opacity: 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "*"
|
||||
to: "*"
|
||||
NumberAnimation {
|
||||
properties: "opacity"
|
||||
easing.type: Easing.OutQuart
|
||||
duration: 500
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
opacity: 0.75
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: 300
|
||||
height: 200
|
||||
radius: 10
|
||||
color: "white"
|
||||
|
||||
Text {
|
||||
id: text
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: "black"
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
onClicked: root.enabled = false
|
||||
}
|
||||
|
||||
function show(msg) {
|
||||
text.text = "<b>Error</b><br><br>" + msg
|
||||
root.enabled = true
|
||||
}
|
||||
}
|
||||
383
examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
Normal file
383
examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
Normal file
@@ -0,0 +1,383 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
signal fileSelected(string file)
|
||||
|
||||
function selectFile(file) {
|
||||
if (file != "")
|
||||
folder = loader.item.folders.folder
|
||||
loader.sourceComponent = undefined
|
||||
fileBrowser.fileSelected(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
|
||||
color: "white"
|
||||
property bool showFocusHighlight: false
|
||||
property variant folders: folders1
|
||||
property variant view: view1
|
||||
property alias folder: folders1.folder
|
||||
property color textColor: "black"
|
||||
|
||||
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: 52
|
||||
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: 48; height: 48
|
||||
Image {
|
||||
source: "qrc:/images/folder.png"
|
||||
anchors.centerIn: parent
|
||||
visible: folders.isFolder(index)
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: nameText
|
||||
anchors.fill: parent; verticalAlignment: Text.AlignVCenter
|
||||
text: fileName
|
||||
anchors.leftMargin: 54
|
||||
font.pixelSize: 32
|
||||
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 }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: cancelButton
|
||||
width: 100
|
||||
height: titleBar.height - 7
|
||||
color: "black"
|
||||
anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
|
||||
|
||||
Text {
|
||||
anchors { fill: parent; margins: 4 }
|
||||
text: "Cancel"
|
||||
color: "white"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: 20
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: fileBrowser.selectFile("")
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: view1
|
||||
anchors.top: titleBar.bottom
|
||||
anchors.bottom: cancelButton.top
|
||||
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.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();
|
||||
}
|
||||
}
|
||||
|
||||
BorderImage {
|
||||
source: "qrc:/images/titlebar.sci";
|
||||
width: parent.width;
|
||||
height: 52
|
||||
y: -7
|
||||
id: titleBar
|
||||
|
||||
Rectangle {
|
||||
id: upButton
|
||||
width: 48
|
||||
height: titleBar.height - 7
|
||||
color: "transparent"
|
||||
Image { anchors.centerIn: parent; source: "qrc:/images/up.png" }
|
||||
MouseArea { id: upRegion; anchors.centerIn: parent
|
||||
width: 56
|
||||
height: 56
|
||||
onClicked: if (folders.parentFolder != "") up()
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: upRegion.pressed
|
||||
PropertyChanges { target: upButton; color: palette.highlight }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: "gray"
|
||||
x: 48
|
||||
width: 1
|
||||
height: 44
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
|
||||
anchors.leftMargin: 4; anchors.rightMargin: 4
|
||||
text: folders.folder
|
||||
color: "white"
|
||||
elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: 32
|
||||
}
|
||||
}
|
||||
|
||||
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 = 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
71
examples/multimedia/video/qmlvideo/qml/qmlvideo/Scene.qml
Normal file
71
examples/multimedia/video/qmlvideo/qml/qmlvideo/Scene.qml
Normal file
@@ -0,0 +1,71 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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: "black"
|
||||
property alias buttonHeight: closeButton.height
|
||||
property string source1
|
||||
property string source2
|
||||
property int contentWidth: 250
|
||||
property real volume: 0.25
|
||||
property int margins: 10
|
||||
property QtObject content
|
||||
|
||||
signal close
|
||||
signal videoFramePainted
|
||||
|
||||
Button {
|
||||
id: closeButton
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
margins: root.margins
|
||||
}
|
||||
width: 50
|
||||
height: 30
|
||||
z: 2.0
|
||||
text: "Back"
|
||||
onClicked: root.close()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property string contentType
|
||||
property bool autoStart: false
|
||||
property bool started: false
|
||||
|
||||
Content {
|
||||
id: content
|
||||
autoStart: parent.autoStart
|
||||
started: parent.started
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: parent.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
text: content.started ? "Tap the screen to stop content"
|
||||
: "Tap the screen to start content"
|
||||
color: "yellow"
|
||||
font.pixelSize: 20
|
||||
z: 2.0
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
console.log("[qmlvideo] SceneBasic.onClicked, started = " + content.started)
|
||||
if (content.started)
|
||||
content.stop()
|
||||
else
|
||||
content.start()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property int margin: 20
|
||||
property string contentType
|
||||
|
||||
Image {
|
||||
id: background
|
||||
source: "qrc:/images/leaves.jpg"
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: root.contentWidth
|
||||
contentType: root.contentType
|
||||
source: root.source1
|
||||
volume: root.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
drag.target: background
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
state: "left"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "fullScreen"
|
||||
PropertyChanges { target: content; width: content.parent.width }
|
||||
PropertyChanges { target: content; height: content.parent.height }
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
ParallelAnimation {
|
||||
PropertyAnimation {
|
||||
property: "width"
|
||||
easing.type: Easing.Linear
|
||||
duration: 250
|
||||
}
|
||||
PropertyAnimation {
|
||||
property: "height"
|
||||
easing.type: Easing.Linear
|
||||
duration: 250
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: content.state = (content.state == "fullScreen") ? "baseState" : "fullScreen"
|
||||
}
|
||||
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
text: "Tap on the content to toggle full-screen mode"
|
||||
color: "yellow"
|
||||
font.pixelSize: 20
|
||||
z: 2.0
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
state: "left"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "nonFullScreen"
|
||||
PropertyChanges { target: content; width: content.parent.contentWidth }
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
ParallelAnimation {
|
||||
PropertyAnimation {
|
||||
property: "width"
|
||||
easing.type: Easing.Linear
|
||||
duration: 250
|
||||
}
|
||||
PropertyAnimation {
|
||||
property: "height"
|
||||
easing.type: Easing.Linear
|
||||
duration: 250
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: content.state = (content.state == "nonFullScreen") ? "baseState" : "nonFullScreen"
|
||||
}
|
||||
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
|
||||
onInitialized: {
|
||||
width = parent.width
|
||||
height = parent.height
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
text: "Tap on the content to toggle full-screen mode"
|
||||
color: "yellow"
|
||||
font.pixelSize: 20
|
||||
z: 2.0
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property int margin: 20
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.contentWidth
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
|
||||
SequentialAnimation on x {
|
||||
id: animation
|
||||
loops: Animation.Infinite
|
||||
property int from: margin
|
||||
property int to: 100
|
||||
property int duration: 1500
|
||||
running: false
|
||||
PropertyAnimation {
|
||||
from: animation.from
|
||||
to: animation.to
|
||||
duration: animation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
PropertyAnimation {
|
||||
from: animation.to
|
||||
to: animation.from
|
||||
duration: animation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
onWidthChanged: {
|
||||
animation.to = root.width - content.width - margin
|
||||
animation.start()
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
204
examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMulti.qml
Normal file
204
examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneMulti.qml
Normal file
@@ -0,0 +1,204 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
|
||||
property real itemWidth: (width / 3) - 40
|
||||
property real itemTopMargin: 50
|
||||
|
||||
QtObject {
|
||||
id: contentProxy
|
||||
function initialize() {
|
||||
video1.initialize()
|
||||
video2.initialize()
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: startStopComponent
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
color: "transparent"
|
||||
|
||||
function content() {
|
||||
return root.parent
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
text: content() ? content().started ? "Tap to stop" : "Tap to start" : ""
|
||||
color: "yellow"
|
||||
font.pixelSize: 20
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (content().started)
|
||||
content().stop()
|
||||
else
|
||||
content().start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Content {
|
||||
id: video1
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: 10
|
||||
top: parent.top
|
||||
topMargin: root.itemTopMargin
|
||||
}
|
||||
autoStart: false
|
||||
contentType: "video"
|
||||
showBorder: true
|
||||
showFrameRate: started
|
||||
source: parent.source1
|
||||
width: itemWidth
|
||||
volume: parent.volume
|
||||
|
||||
Loader {
|
||||
id: video1StartStopLoader
|
||||
onLoaded: {
|
||||
item.parent = video1
|
||||
item.anchors.fill = video1
|
||||
}
|
||||
}
|
||||
|
||||
onInitialized: video1StartStopLoader.sourceComponent = startStopComponent
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: cameraHolder
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
topMargin: root.itemTopMargin
|
||||
}
|
||||
border.width: 1
|
||||
border.color: "white"
|
||||
color: "transparent"
|
||||
width: itemWidth
|
||||
height: width
|
||||
property bool started: false
|
||||
|
||||
Loader {
|
||||
id: cameraLoader
|
||||
onLoaded: {
|
||||
item.parent = cameraHolder
|
||||
item.centerIn = cameraHolder
|
||||
item.contentType = "camera"
|
||||
item.showFrameRate = true
|
||||
item.width = itemWidth
|
||||
item.z = 1.0
|
||||
cameraErrorConnection.target = item
|
||||
item.initialize()
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: cameraStartStopLoader
|
||||
sourceComponent: startStopComponent
|
||||
onLoaded: {
|
||||
item.parent = cameraHolder
|
||||
item.anchors.fill = cameraHolder
|
||||
item.z = 2.0
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
id: cameraErrorConnection
|
||||
onError: {
|
||||
console.log("[qmlvideo] SceneMulti.camera.onError")
|
||||
cameraHolder.stop()
|
||||
}
|
||||
}
|
||||
|
||||
function start() {
|
||||
cameraLoader.source = "Content.qml"
|
||||
cameraHolder.started = true
|
||||
}
|
||||
|
||||
function stop() {
|
||||
cameraLoader.source = ""
|
||||
cameraHolder.started = false
|
||||
}
|
||||
}
|
||||
|
||||
Content {
|
||||
id: video2
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: 10
|
||||
top: parent.top
|
||||
topMargin: root.itemTopMargin
|
||||
}
|
||||
autoStart: false
|
||||
contentType: "video"
|
||||
showBorder: true
|
||||
showFrameRate: started
|
||||
source: parent.source2
|
||||
width: itemWidth
|
||||
volume: parent.volume
|
||||
|
||||
Loader {
|
||||
id: video2StartStopLoader
|
||||
onLoaded: {
|
||||
item.parent = video2
|
||||
item.anchors.fill = video2
|
||||
}
|
||||
}
|
||||
|
||||
onInitialized: video2StartStopLoader.sourceComponent = startStopComponent
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = contentProxy
|
||||
}
|
||||
121
examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
Normal file
121
examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneOverlay.qml
Normal file
@@ -0,0 +1,121 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property int margin: 20
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: overlay
|
||||
y: 0.5 * parent.height
|
||||
width: content.width
|
||||
height: content.height
|
||||
color: "yellow"
|
||||
opacity: 0.5
|
||||
|
||||
SequentialAnimation on x {
|
||||
id: xAnimation
|
||||
loops: Animation.Infinite
|
||||
property int from: margin
|
||||
property int to: 100
|
||||
property int duration: 1500
|
||||
running: false
|
||||
PropertyAnimation {
|
||||
from: xAnimation.from
|
||||
to: xAnimation.to
|
||||
duration: xAnimation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
PropertyAnimation {
|
||||
from: xAnimation.to
|
||||
to: xAnimation.from
|
||||
duration: xAnimation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
|
||||
SequentialAnimation on y {
|
||||
id: yAnimation
|
||||
loops: Animation.Infinite
|
||||
property int from: margin
|
||||
property int to: 180
|
||||
property int duration: 1500
|
||||
running: false
|
||||
PropertyAnimation {
|
||||
from: yAnimation.from
|
||||
to: yAnimation.to
|
||||
duration: yAnimation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
PropertyAnimation {
|
||||
from: yAnimation.to
|
||||
to: yAnimation.from
|
||||
duration: yAnimation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onWidthChanged: {
|
||||
xAnimation.to = root.width - content.width - margin
|
||||
xAnimation.start()
|
||||
}
|
||||
|
||||
onHeightChanged: {
|
||||
//yAnimation.to = root.height - content.height - margin
|
||||
yAnimation.start()
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
|
||||
SequentialAnimation on scale {
|
||||
id: animation
|
||||
loops: Animation.Infinite
|
||||
property int duration: 1500
|
||||
running: true
|
||||
PropertyAnimation {
|
||||
from: 1.5
|
||||
to: 0.5
|
||||
duration: animation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
PropertyAnimation {
|
||||
from: 0.5
|
||||
to: 1.5
|
||||
duration: animation.duration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
100
examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
Normal file
100
examples/multimedia/video/qmlvideo/qml/qmlvideo/SceneRotate.qml
Normal file
@@ -0,0 +1,100 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property int margin: 20
|
||||
property int delta: 30
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Button {
|
||||
id: rotatePositiveButton
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: rotateNegativeButton.top
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 90
|
||||
height: root.buttonHeight
|
||||
text: "Rotate +" + delta
|
||||
onClicked: content.rotation = content.rotation + delta
|
||||
}
|
||||
|
||||
Button {
|
||||
id: rotateNegativeButton
|
||||
anchors {
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 90
|
||||
height: root.buttonHeight
|
||||
text: "Rotate -" + delta
|
||||
onClicked: content.rotation = content.rotation - delta
|
||||
}
|
||||
|
||||
Button {
|
||||
id: rotateValueButton
|
||||
anchors {
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 30
|
||||
height: root.buttonHeight
|
||||
enabled: false
|
||||
text: content.rotation % 360
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
property int itemHeight: 25
|
||||
property string sceneSource: ""
|
||||
|
||||
ListModel {
|
||||
id: list
|
||||
ListElement { name: "multi"; source: "SceneMulti.qml" }
|
||||
ListElement { name: "video"; source: "VideoBasic.qml" }
|
||||
ListElement { name: "video-drag"; source: "VideoDrag.qml" }
|
||||
ListElement { name: "video-fillmode"; source: "VideoFillMode.qml" }
|
||||
ListElement { name: "video-fullscreen"; source: "VideoFullScreen.qml" }
|
||||
ListElement { name: "video-fullscreen-inverted"; source: "VideoFullScreenInverted.qml" }
|
||||
ListElement { name: "video-metadata"; source: "VideoMetadata.qml" }
|
||||
ListElement { name: "video-move"; source: "VideoMove.qml" }
|
||||
ListElement { name: "video-overlay"; source: "VideoOverlay.qml" }
|
||||
ListElement { name: "video-playbackrate"; source: "VideoPlaybackRate.qml" }
|
||||
ListElement { name: "video-resize"; source: "VideoResize.qml" }
|
||||
ListElement { name: "video-rotate"; source: "VideoRotate.qml" }
|
||||
ListElement { name: "video-spin"; source: "VideoSpin.qml" }
|
||||
ListElement { name: "video-seek"; source: "VideoSeek.qml" }
|
||||
ListElement { name: "camera"; source: "CameraBasic.qml" }
|
||||
ListElement { name: "camera-drag"; source: "CameraDrag.qml" }
|
||||
ListElement { name: "camera-fullscreen"; source: "CameraFullScreen.qml" }
|
||||
ListElement { name: "camera-fullscreen-inverted"; source: "CameraFullScreenInverted.qml" }
|
||||
ListElement { name: "camera-move"; source: "CameraMove.qml" }
|
||||
ListElement { name: "camera-overlay"; source: "CameraOverlay.qml" }
|
||||
ListElement { name: "camera-resize"; source: "CameraResize.qml" }
|
||||
ListElement { name: "camera-rotate"; source: "CameraRotate.qml" }
|
||||
ListElement { name: "camera-spin"; source: "CameraSpin.qml" }
|
||||
}
|
||||
|
||||
Component {
|
||||
id: delegate
|
||||
Item {
|
||||
id: delegateItem
|
||||
width: root.width
|
||||
height: itemHeight
|
||||
|
||||
Button {
|
||||
id: selectorItem
|
||||
anchors.centerIn: parent
|
||||
width: 0.9 * parent.width
|
||||
height: 0.8 * itemHeight
|
||||
text: name
|
||||
onClicked: root.sceneSource = source
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: (itemHeight * list.count) + layout.anchors.topMargin + layout.spacing
|
||||
clip: true
|
||||
|
||||
Column {
|
||||
id: layout
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
topMargin: 10
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: list
|
||||
delegate: delegate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property int margin: 20
|
||||
property string contentType
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: root.contentType
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
|
||||
PropertyAnimation on rotation {
|
||||
id: animation
|
||||
loops: Animation.Infinite
|
||||
running: true
|
||||
from: 0
|
||||
to: 360
|
||||
duration: 3000
|
||||
easing.type: Easing.Linear
|
||||
}
|
||||
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
143
examples/multimedia/video/qmlvideo/qml/qmlvideo/SeekControl.qml
Normal file
143
examples/multimedia/video/qmlvideo/qml/qmlvideo/SeekControl.qml
Normal file
@@ -0,0 +1,143 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Item {
|
||||
id: seekControl
|
||||
height: 46
|
||||
property int duration: 0
|
||||
property int playPosition: 0
|
||||
property int seekPosition: 0
|
||||
property bool enabled: true
|
||||
property bool seeking: false
|
||||
|
||||
Rectangle {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
opacity: 0.3
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: progressBar
|
||||
anchors { left: parent.left; top: parent.top; bottom: parent.bottom }
|
||||
width: seekControl.duration == 0 ? 0 : background.width * seekControl.playPosition / seekControl.duration
|
||||
color: "black"
|
||||
opacity: 0.7
|
||||
}
|
||||
|
||||
Text {
|
||||
width: 90
|
||||
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 10 }
|
||||
font { family: "Nokia Sans S60"; pixelSize: 24 }
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: "white"
|
||||
smooth: true
|
||||
text: formatTime(playPosition)
|
||||
}
|
||||
|
||||
Text {
|
||||
width: 90
|
||||
anchors { right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10 }
|
||||
font { family: "Nokia Sans S60"; pixelSize: 24 }
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: "white"
|
||||
smooth: true
|
||||
text: formatTime(duration)
|
||||
}
|
||||
|
||||
Image {
|
||||
id: progressHandle
|
||||
height: 46
|
||||
width: 10
|
||||
source: mouseArea.pressed ? "qrc:/images/progress_handle_pressed.svg" : "qrc:/images/progress_handle.svg"
|
||||
anchors.verticalCenter: progressBar.verticalCenter
|
||||
x: seekControl.duration == 0 ? 0 : seekControl.playPosition / seekControl.duration * 630
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
|
||||
height: 46+16
|
||||
width: height
|
||||
enabled: seekControl.enabled
|
||||
drag {
|
||||
target: progressHandle
|
||||
axis: Drag.XAxis
|
||||
minimumX: 0
|
||||
maximumX: 631
|
||||
}
|
||||
onPressed: {
|
||||
seekControl.seeking = true;
|
||||
}
|
||||
onCanceled: {
|
||||
seekControl.seekPosition = progressHandle.x * seekControl.duration / 630
|
||||
seekControl.seeking = false
|
||||
}
|
||||
onReleased: {
|
||||
seekControl.seekPosition = progressHandle.x * seekControl.duration / 630
|
||||
seekControl.seeking = false
|
||||
mouse.accepted = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer { // Update position also while user is dragging the progress handle
|
||||
id: seekTimer
|
||||
repeat: true
|
||||
interval: 300
|
||||
running: seekControl.seeking
|
||||
onTriggered: {
|
||||
seekControl.seekPosition = progressHandle.x*seekControl.duration/630
|
||||
}
|
||||
}
|
||||
|
||||
function formatTime(timeInMs) {
|
||||
if (!timeInMs || timeInMs <= 0) return "0:00"
|
||||
var seconds = timeInMs / 1000;
|
||||
var minutes = Math.floor(seconds / 60)
|
||||
seconds = Math.floor(seconds % 60)
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
return minutes + ":" + seconds
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneBasic {
|
||||
contentType: "video"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneDrag {
|
||||
contentType: "video"
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
// Item which is loaded by VideoItem if QtMultimediaKit is not available
|
||||
Rectangle {
|
||||
id: root
|
||||
color: "grey"
|
||||
height: width
|
||||
property int duration: 0
|
||||
property int position: 0
|
||||
property string source
|
||||
property real volume: 1.0
|
||||
property real playbackRate: 1.0
|
||||
|
||||
signal fatalError
|
||||
signal sizeChanged
|
||||
signal framePainted
|
||||
|
||||
Text {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
color: "white"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "Failed to create Video item\n\nCheck that QtMultimediaKit is installed"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
onWidthChanged: height = width
|
||||
onHeightChanged: root.sizeChanged()
|
||||
|
||||
function start() { }
|
||||
function stop() { }
|
||||
function seek() { }
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: "video"
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Button {
|
||||
id: button
|
||||
anchors {
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 150
|
||||
height: root.buttonHeight
|
||||
text: "PreserveAspectFit"
|
||||
onClicked: {
|
||||
if (!content.dummy) {
|
||||
var video = content.contentItem()
|
||||
if (video.fillMode == VideoOutput.Stretch) {
|
||||
video.fillMode = VideoOutput.PreserveAspectFit
|
||||
text = "PreserveAspectFit"
|
||||
} else if (video.fillMode == VideoOutput.PreserveAspectFit) {
|
||||
video.fillMode = VideoOutput.PreserveAspectCrop
|
||||
text = "PreserveAspectCrop"
|
||||
} else {
|
||||
video.fillMode = VideoOutput.Stretch
|
||||
text = "Stretch"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneFullScreen {
|
||||
contentType: "video"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneFullScreenInverted {
|
||||
contentType: "video"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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: root
|
||||
height: width
|
||||
source: mediaPlayer
|
||||
|
||||
property alias duration: mediaPlayer.duration
|
||||
property alias mediaSource: mediaPlayer.source
|
||||
property alias metaData: mediaPlayer.metaData
|
||||
property alias playbackRate: mediaPlayer.playbackRate
|
||||
property alias position: mediaPlayer.position
|
||||
property alias volume: mediaPlayer.volume
|
||||
|
||||
signal sizeChanged
|
||||
signal fatalError
|
||||
|
||||
onHeightChanged: root.sizeChanged()
|
||||
|
||||
MediaPlayer {
|
||||
id: mediaPlayer
|
||||
autoLoad: false
|
||||
|
||||
onError: {
|
||||
if (MediaPlayer.NoError != error) {
|
||||
console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
|
||||
root.fatalError()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function start() { mediaPlayer.play() }
|
||||
function stop() { mediaPlayer.stop() }
|
||||
function seek(position) { mediaPlayer.seek(position); }
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property string contentType: "video"
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: "video"
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onInitialized: {
|
||||
if (!dummy)
|
||||
metadata.createObject(root)
|
||||
}
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Component {
|
||||
id: metadata
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Title:" + content.contentItem().metaData.title
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Size:" + content.contentItem().metaData.size
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Resolution:" + content.contentItem().metaData.resolution
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Media type:" + content.contentItem().metaData.mediaType
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Video codec:" + content.contentItem().metaData.videoCodec
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Video bit rate:" + content.contentItem().metaData.videoBitRate
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Video frame rate:" +content.contentItem().metaData.videoFrameRate
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Audio codec:" + content.contentItem().metaData.audioCodec
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Audio bit rate:" + content.contentItem().metaData.audioBitRate
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Date:" + content.contentItem().metaData.date
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Description:" + content.contentItem().metaData.description
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Copyright:" + content.contentItem().metaData.copyright
|
||||
}
|
||||
Text {
|
||||
color: "yellow"
|
||||
text: "Seekable:" + content.contentItem().metaData.seekable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneMove {
|
||||
contentType: "video"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneOverlay {
|
||||
contentType: "video"
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property int margin: 20
|
||||
property real delta: 0.1
|
||||
property string contentType: "video"
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: "video"
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
Button {
|
||||
id: increaseButton
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: decreaseButton.top
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 90
|
||||
height: root.buttonHeight
|
||||
text: "Increase"
|
||||
onClicked: {
|
||||
var video = content.contentItem()
|
||||
video.playbackRate = video.playbackRate + delta
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: decreaseButton
|
||||
anchors {
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 90
|
||||
height: root.buttonHeight
|
||||
text: "Decrease"
|
||||
onClicked: {
|
||||
var video = content.contentItem()
|
||||
video.playbackRate = video.playbackRate - delta
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: valueButton
|
||||
anchors {
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: parent.margins
|
||||
}
|
||||
width: 50
|
||||
height: root.buttonHeight
|
||||
enabled: false
|
||||
text: Math.round(10 * content.contentItem().playbackRate) / 10
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneResize {
|
||||
contentType: "video"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneRotate {
|
||||
contentType: "video"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
Scene {
|
||||
id: root
|
||||
property string contentType: "video"
|
||||
|
||||
Content {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
width: parent.contentWidth
|
||||
contentType: "video"
|
||||
source: parent.source1
|
||||
volume: parent.volume
|
||||
onVideoFramePainted: root.videoFramePainted()
|
||||
}
|
||||
|
||||
SeekControl {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: 100
|
||||
rightMargin: 140
|
||||
bottom: parent.bottom
|
||||
}
|
||||
duration: content.contentItem() ? content.contentItem().duration : 0
|
||||
playPosition: content.contentItem() ? content.contentItem().position : 0
|
||||
onSeekPositionChanged: { content.contentItem().seek(seekPosition); }
|
||||
}
|
||||
|
||||
Component.onCompleted: root.content = content
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
|
||||
SceneSpin {
|
||||
contentType: "video"
|
||||
}
|
||||
244
examples/multimedia/video/qmlvideo/qml/qmlvideo/main.qml
Normal file
244
examples/multimedia/video/qmlvideo/qml/qmlvideo/main.qml
Normal file
@@ -0,0 +1,244 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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
|
||||
width: 640
|
||||
height: 360
|
||||
color: "black"
|
||||
|
||||
property string source1
|
||||
property string source2
|
||||
property color bgColor: "#002244"
|
||||
property real volume: 0.25
|
||||
property bool perfMonitorsLogging: false
|
||||
property bool perfMonitorsVisible: false
|
||||
|
||||
QtObject {
|
||||
id: d
|
||||
property int itemHeight: 40
|
||||
property int buttonHeight: 0.8 * itemHeight
|
||||
property int margins: 10
|
||||
}
|
||||
|
||||
// Create ScreenSaver element via Loader, so this app will still run if the
|
||||
// SystemInfo module is not available
|
||||
Loader {
|
||||
source: "DisableScreenSaver.qml"
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: performanceLoader
|
||||
|
||||
Connections {
|
||||
target: inner
|
||||
onVisibleChanged:
|
||||
if (performanceLoader.item)
|
||||
performanceLoader.item.enabled = !inner.visible
|
||||
ignoreUnknownSignals: true
|
||||
}
|
||||
|
||||
function init() {
|
||||
console.log("[qmlvideo] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
|
||||
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
|
||||
source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
|
||||
}
|
||||
|
||||
onLoaded: {
|
||||
item.parent = root
|
||||
item.anchors.fill = root
|
||||
item.logging = root.perfMonitorsLogging
|
||||
item.displayed = root.perfMonitorsVisible
|
||||
item.enabled = false
|
||||
item.init()
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: inner
|
||||
anchors.fill: parent
|
||||
color: root.bgColor
|
||||
|
||||
Button {
|
||||
id: openFile1Button
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: exitButton.left
|
||||
margins: d.margins
|
||||
}
|
||||
height: d.buttonHeight
|
||||
text: (root.source1 == "") ? "Select file 1" : root.source1
|
||||
onClicked: fileBrowser1.show()
|
||||
}
|
||||
|
||||
Button {
|
||||
id: openFile2Button
|
||||
anchors {
|
||||
top: openFile1Button.bottom
|
||||
left: parent.left
|
||||
right: exitButton.left
|
||||
margins: d.margins
|
||||
}
|
||||
height: d.buttonHeight
|
||||
text: (root.source2 == "") ? "Select file 2" : root.source2
|
||||
onClicked: fileBrowser2.show()
|
||||
}
|
||||
|
||||
Button {
|
||||
id: exitButton
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
margins: d.margins
|
||||
}
|
||||
width: 50
|
||||
height: d.buttonHeight
|
||||
text: "Exit"
|
||||
onClicked: Qt.quit()
|
||||
}
|
||||
|
||||
SceneSelectionPanel {
|
||||
id: sceneSelectionPanel
|
||||
itemHeight: d.itemHeight
|
||||
color: "#004444"
|
||||
anchors {
|
||||
top: openFile2Button.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: d.margins
|
||||
}
|
||||
radius: 10
|
||||
onSceneSourceChanged: {
|
||||
console.log("[qmlvideo] main.onSceneSourceChanged source " + sceneSource)
|
||||
sceneLoader.source = sceneSource
|
||||
var scene = null
|
||||
var innerVisible = true
|
||||
if (sceneSource == "") {
|
||||
if (performanceLoader.item)
|
||||
performanceLoader.item.videoActive = false
|
||||
} else {
|
||||
scene = sceneLoader.item
|
||||
if (scene) {
|
||||
if (scene.contentType === "video" && source1 === "") {
|
||||
errorDialog.show("You must first select a video file")
|
||||
sceneSource = ""
|
||||
} else {
|
||||
scene.parent = root
|
||||
scene.color = root.bgColor
|
||||
scene.buttonHeight = d.buttonHeight
|
||||
scene.source1 = source1
|
||||
scene.source2 = source2
|
||||
scene.volume = volume
|
||||
scene.anchors.fill = root
|
||||
scene.close.connect(closeScene)
|
||||
scene.content.initialize()
|
||||
innerVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
videoFramePaintedConnection.target = scene
|
||||
inner.visible = innerVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: sceneLoader
|
||||
}
|
||||
|
||||
Connections {
|
||||
id: videoFramePaintedConnection
|
||||
onVideoFramePainted: {
|
||||
if (performanceLoader.item)
|
||||
performanceLoader.item.videoFramePainted()
|
||||
}
|
||||
ignoreUnknownSignals: true
|
||||
}
|
||||
|
||||
FileBrowser {
|
||||
id: fileBrowser1
|
||||
anchors.fill: root
|
||||
onFolderChanged: fileBrowser2.folder = folder
|
||||
Component.onCompleted: fileSelected.connect(root.openFile1)
|
||||
}
|
||||
|
||||
FileBrowser {
|
||||
id: fileBrowser2
|
||||
anchors.fill: root
|
||||
onFolderChanged: fileBrowser1.folder = folder
|
||||
Component.onCompleted: fileSelected.connect(root.openFile2)
|
||||
}
|
||||
|
||||
function openFile1(path) {
|
||||
root.source1 = path
|
||||
}
|
||||
|
||||
function openFile2(path) {
|
||||
root.source2 = path
|
||||
}
|
||||
|
||||
ErrorDialog {
|
||||
id: errorDialog
|
||||
anchors.fill: parent
|
||||
enabled: false
|
||||
}
|
||||
|
||||
// Called from main() once root properties have been set
|
||||
function init() {
|
||||
performanceLoader.init()
|
||||
fileBrowser1.folder = videoPath
|
||||
fileBrowser2.folder = videoPath
|
||||
}
|
||||
|
||||
function qmlFramePainted() {
|
||||
if (performanceLoader.item)
|
||||
performanceLoader.item.qmlFramePainted()
|
||||
}
|
||||
|
||||
function closeScene() {
|
||||
console.log("[qmlvideo] main.closeScene")
|
||||
sceneSelectionPanel.sceneSource = ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user