QMLVideo Example visual update
Task-number: QTBUG-36287 Change-Id: I797a995c2ccd6f6fec40fbf50f93e297ae15a9b1 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -1,35 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="10px"
|
|
||||||
height="46px"
|
|
||||||
version="1.1">
|
|
||||||
<g>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="MyGradient1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
||||||
<stop offset="0%" stop-color="lightcyan" />
|
|
||||||
<stop offset="100%" stop-color="dodgerblue" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<rect
|
|
||||||
stroke="white"
|
|
||||||
fill="url(#MyGradient1)"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
stroke-width="2"
|
|
||||||
width="8"
|
|
||||||
height="44"
|
|
||||||
x="1"
|
|
||||||
y="1"
|
|
||||||
rx="4"
|
|
||||||
ry="4"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,35 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="10px"
|
|
||||||
height="46px"
|
|
||||||
version="1.1">
|
|
||||||
<g>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="MyGradient1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
||||||
<stop offset="0%" stop-color="skyblue" />
|
|
||||||
<stop offset="100%" stop-color="darkblue" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<rect
|
|
||||||
stroke="white"
|
|
||||||
fill="url(#MyGradient1)"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
stroke-width="2"
|
|
||||||
width="8"
|
|
||||||
height="44"
|
|
||||||
x="1"
|
|
||||||
y="1"
|
|
||||||
rx="4"
|
|
||||||
ry="4"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,5 +0,0 @@
|
|||||||
border.left: 10
|
|
||||||
border.top: 12
|
|
||||||
border.bottom: 12
|
|
||||||
border.right: 10
|
|
||||||
source: titlebar.png
|
|
||||||
|
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 1.2 KiB |
@@ -123,13 +123,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
|
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
|
||||||
const QUrl videoPath =
|
const QUrl videoPath =
|
||||||
QUrl::fromLocalFile(moviesLocation.isEmpty() ?
|
QUrl::fromLocalFile(moviesLocation.isEmpty() ?
|
||||||
app.applicationDirPath() :
|
app.applicationDirPath() :
|
||||||
moviesLocation.front());
|
moviesLocation.front());
|
||||||
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
||||||
|
|
||||||
QMetaObject::invokeMethod(rootObject, "init");
|
QMetaObject::invokeMethod(rootObject, "init");
|
||||||
|
|
||||||
|
viewer.setMinimumSize(QSize(640, 360));
|
||||||
viewer.show();
|
viewer.show();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
|||||||
@@ -33,30 +33,31 @@
|
|||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
color: textColor
|
|
||||||
radius: 0.25 * height
|
|
||||||
|
|
||||||
property string text
|
property string text
|
||||||
property color bgColor: "white"
|
property color bgColor: "#757575"
|
||||||
property color bgColorSelected: "red"
|
property color bgColorSelected: "#bdbdbd"
|
||||||
property color textColor: "black"
|
property color textColor: "white"
|
||||||
|
property color textColorSelected: "black"
|
||||||
property alias enabled: mouseArea.enabled
|
property alias enabled: mouseArea.enabled
|
||||||
|
property alias radius: bgr.radius
|
||||||
|
|
||||||
signal clicked
|
signal clicked
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors { fill: parent; margins: 1 }
|
id: bgr
|
||||||
|
anchors.fill: parent
|
||||||
color: mouseArea.pressed ? bgColorSelected : bgColor
|
color: mouseArea.pressed ? bgColorSelected : bgColor
|
||||||
radius: 0.25 * height
|
radius: height / 15
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: text
|
id: text
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: root.text
|
text: root.text
|
||||||
font.pixelSize: 0.5 * parent.height
|
font.pixelSize: 0.4 * parent.height
|
||||||
color: mouseArea.pressed ? bgColor : textColor
|
color: mouseArea.pressed ? textColorSelected : textColor
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ Rectangle {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
opacity: 0.0
|
opacity: 0.0
|
||||||
property alias enabled: mouseArea.enabled
|
property alias enabled: mouseArea.enabled
|
||||||
|
property int dialogWidth: 300
|
||||||
|
property int dialogHeight: 200
|
||||||
state: enabled ? "on" : "baseState"
|
state: enabled ? "on" : "baseState"
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
@@ -70,9 +72,9 @@ Rectangle {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 300
|
width: dialogWidth
|
||||||
height: 200
|
height: dialogHeight
|
||||||
radius: 10
|
radius: 5
|
||||||
color: "white"
|
color: "white"
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ Rectangle {
|
|||||||
|
|
||||||
property string folder
|
property string folder
|
||||||
|
|
||||||
|
property int itemHeight: Math.min(parent.width, parent.height) / 15
|
||||||
|
property int buttonHeight: Math.min(parent.width, parent.height) / 12
|
||||||
|
|
||||||
signal fileSelected(string file)
|
signal fileSelected(string file)
|
||||||
|
|
||||||
function selectFile(file) {
|
function selectFile(file) {
|
||||||
@@ -66,12 +69,12 @@ Rectangle {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
color: "white"
|
color: "black"
|
||||||
property bool showFocusHighlight: false
|
property bool showFocusHighlight: false
|
||||||
property variant folders: folders1
|
property variant folders: folders1
|
||||||
property variant view: view1
|
property variant view: view1
|
||||||
property alias folder: folders1.folder
|
property alias folder: folders1.folder
|
||||||
property color textColor: "black"
|
property color textColor: "white"
|
||||||
|
|
||||||
FolderListModel {
|
FolderListModel {
|
||||||
id: folders1
|
id: folders1
|
||||||
@@ -103,34 +106,39 @@ Rectangle {
|
|||||||
fileBrowser.selectFile(path)
|
fileBrowser.selectFile(path)
|
||||||
}
|
}
|
||||||
width: root.width
|
width: root.width
|
||||||
height: 52
|
height: folderImage.height
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: highlight; visible: false
|
id: highlight
|
||||||
|
visible: false
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: palette.highlight
|
anchors.leftMargin: 5
|
||||||
gradient: Gradient {
|
anchors.rightMargin: 5
|
||||||
GradientStop { id: t1; position: 0.0; color: palette.highlight }
|
color: "#212121"
|
||||||
GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 48; height: 48
|
id: folderImage
|
||||||
|
width: itemHeight
|
||||||
|
height: itemHeight
|
||||||
Image {
|
Image {
|
||||||
|
id: folderPicture
|
||||||
source: "qrc:/folder.png"
|
source: "qrc:/folder.png"
|
||||||
anchors.centerIn: parent
|
width: itemHeight * 0.9
|
||||||
|
height: itemHeight * 0.9
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.margins: 5
|
||||||
visible: folders.isFolder(index)
|
visible: folders.isFolder(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: nameText
|
id: nameText
|
||||||
anchors.fill: parent; verticalAlignment: Text.AlignVCenter
|
anchors.fill: parent;
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
text: fileName
|
text: fileName
|
||||||
anchors.leftMargin: 54
|
anchors.leftMargin: itemHeight + 10
|
||||||
font.pixelSize: 32
|
|
||||||
color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor
|
color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
@@ -142,7 +150,7 @@ Rectangle {
|
|||||||
root.showFocusHighlight = false;
|
root.showFocusHighlight = false;
|
||||||
wrapper.ListView.view.currentIndex = index;
|
wrapper.ListView.view.currentIndex = index;
|
||||||
}
|
}
|
||||||
onClicked: { if (folders == wrapper.ListView.view.model) launch() }
|
onClicked: { if (folders === wrapper.ListView.view.model) launch() }
|
||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
@@ -160,17 +168,12 @@ Rectangle {
|
|||||||
id: view1
|
id: view1
|
||||||
anchors.top: titleBar.bottom
|
anchors.top: titleBar.bottom
|
||||||
anchors.bottom: cancelButton.top
|
anchors.bottom: cancelButton.top
|
||||||
x: 0
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
model: folders1
|
model: folders1
|
||||||
delegate: folderDelegate
|
delegate: folderDelegate
|
||||||
highlight: Rectangle {
|
highlight: Rectangle {
|
||||||
color: palette.highlight
|
color: "#212121"
|
||||||
visible: root.showFocusHighlight && view1.count != 0
|
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
|
width: view1.currentItem == null ? 0 : view1.currentItem.width
|
||||||
}
|
}
|
||||||
highlightMoveVelocity: 1000
|
highlightMoveVelocity: 1000
|
||||||
@@ -215,12 +218,8 @@ Rectangle {
|
|||||||
model: folders2
|
model: folders2
|
||||||
delegate: folderDelegate
|
delegate: folderDelegate
|
||||||
highlight: Rectangle {
|
highlight: Rectangle {
|
||||||
color: palette.highlight
|
color: "#212121"
|
||||||
visible: root.showFocusHighlight && view2.count != 0
|
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
|
width: view1.currentItem == null ? 0 : view1.currentItem.width
|
||||||
}
|
}
|
||||||
highlightMoveVelocity: 1000
|
highlightMoveVelocity: 1000
|
||||||
@@ -254,19 +253,29 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: cancelButton
|
width: parent.width
|
||||||
width: 100
|
height: buttonHeight + 10
|
||||||
height: titleBar.height - 7
|
anchors.bottom: parent.bottom
|
||||||
color: "black"
|
color: "black"
|
||||||
anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: cancelButton
|
||||||
|
width: parent.width
|
||||||
|
height: buttonHeight
|
||||||
|
color: "#212121"
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.margins: 5
|
||||||
|
radius: buttonHeight / 15
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors { fill: parent; margins: 4 }
|
anchors.fill: parent
|
||||||
text: "Cancel"
|
text: "Cancel"
|
||||||
color: "white"
|
color: "white"
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font.pixelSize: 20
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -277,55 +286,66 @@ Rectangle {
|
|||||||
|
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
root.keyPressed(event.key);
|
root.keyPressed(event.key);
|
||||||
if (event.key == Qt.Key_Return || event.key == Qt.Key_Select || event.key == Qt.Key_Right) {
|
if (event.key === Qt.Key_Return || event.key === Qt.Key_Select || event.key === Qt.Key_Right) {
|
||||||
view.currentItem.launch();
|
view.currentItem.launch();
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
} else if (event.key == Qt.Key_Left) {
|
} else if (event.key === Qt.Key_Left) {
|
||||||
up();
|
up();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BorderImage {
|
|
||||||
source: "qrc:/titlebar.sci";
|
Rectangle {
|
||||||
width: parent.width;
|
|
||||||
height: 52
|
|
||||||
y: -7
|
|
||||||
id: titleBar
|
id: titleBar
|
||||||
|
width: parent.width
|
||||||
|
height: buttonHeight + 10
|
||||||
|
anchors.top: parent.top
|
||||||
|
color: "black"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: upButton
|
width: parent.width;
|
||||||
width: 48
|
height: buttonHeight
|
||||||
height: titleBar.height - 7
|
color: "#212121"
|
||||||
color: "transparent"
|
anchors.margins: 5
|
||||||
Image { anchors.centerIn: parent; source: "qrc:/up.png" }
|
anchors.top: parent.top
|
||||||
MouseArea { id: upRegion; anchors.centerIn: parent
|
anchors.left: parent.left
|
||||||
width: 56
|
anchors.right: parent.right
|
||||||
height: 56
|
radius: buttonHeight / 15
|
||||||
onClicked: up()
|
|
||||||
}
|
Rectangle {
|
||||||
states: [
|
id: upButton
|
||||||
State {
|
width: buttonHeight
|
||||||
name: "pressed"
|
height: buttonHeight
|
||||||
when: upRegion.pressed
|
color: "transparent"
|
||||||
PropertyChanges { target: upButton; color: palette.highlight }
|
Image {
|
||||||
|
width: itemHeight
|
||||||
|
height: itemHeight
|
||||||
|
anchors.centerIn: parent
|
||||||
|
source: "qrc:/up.png"
|
||||||
}
|
}
|
||||||
]
|
MouseArea { id: upRegion; anchors.centerIn: parent
|
||||||
}
|
width: buttonHeight
|
||||||
|
height: buttonHeight
|
||||||
|
onClicked: up()
|
||||||
|
}
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "pressed"
|
||||||
|
when: upRegion.pressed
|
||||||
|
PropertyChanges { target: upButton; color: palette.highlight }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Text {
|
||||||
color: "gray"
|
anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
|
||||||
x: 48
|
anchors.leftMargin: 5; anchors.rightMargin: 5
|
||||||
width: 1
|
text: folders.folder
|
||||||
height: 44
|
color: "white"
|
||||||
}
|
elide: Text.ElideLeft;
|
||||||
|
horizontalAlignment: Text.AlignLeft;
|
||||||
Text {
|
verticalAlignment: Text.AlignVCenter
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,14 +386,14 @@ Rectangle {
|
|||||||
|
|
||||||
function keyPressed(key) {
|
function keyPressed(key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case Qt.Key_Up:
|
case Qt.Key_Up:
|
||||||
case Qt.Key_Down:
|
case Qt.Key_Down:
|
||||||
case Qt.Key_Left:
|
case Qt.Key_Left:
|
||||||
case Qt.Key_Right:
|
case Qt.Key_Right:
|
||||||
root.showFocusHighlight = true;
|
root.showFocusHighlight = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// do nothing
|
// do nothing
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ Rectangle {
|
|||||||
property alias buttonHeight: closeButton.height
|
property alias buttonHeight: closeButton.height
|
||||||
property string source1
|
property string source1
|
||||||
property string source2
|
property string source2
|
||||||
property int contentWidth: 250
|
property int contentWidth: parent.width / 2
|
||||||
property real volume: 0.25
|
property real volume: 0.25
|
||||||
property int margins: 10
|
property int margins: 5
|
||||||
property QtObject content
|
property QtObject content
|
||||||
|
|
||||||
signal close
|
signal close
|
||||||
@@ -54,9 +54,12 @@ Rectangle {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
margins: root.margins
|
margins: root.margins
|
||||||
}
|
}
|
||||||
width: 50
|
width: Math.max(parent.width, parent.height) / 12
|
||||||
height: 30
|
height: Math.min(parent.width, parent.height) / 12
|
||||||
z: 2.0
|
z: 2.0
|
||||||
|
bgColor: "#212121"
|
||||||
|
bgColorSelected: "#757575"
|
||||||
|
textColorSelected: "white"
|
||||||
text: "Back"
|
text: "Back"
|
||||||
onClicked: root.close()
|
onClicked: root.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,7 @@ Scene {
|
|||||||
}
|
}
|
||||||
text: content.started ? "Tap the screen to stop content"
|
text: content.started ? "Tap the screen to stop content"
|
||||||
: "Tap the screen to start content"
|
: "Tap the screen to start content"
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
font.pixelSize: 20
|
|
||||||
z: 2.0
|
z: 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,8 +86,7 @@ Scene {
|
|||||||
margins: 20
|
margins: 20
|
||||||
}
|
}
|
||||||
text: "Tap on the content to toggle full-screen mode"
|
text: "Tap on the content to toggle full-screen mode"
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
font.pixelSize: 20
|
|
||||||
z: 2.0
|
z: 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,8 +91,7 @@ Scene {
|
|||||||
margins: 20
|
margins: 20
|
||||||
}
|
}
|
||||||
text: "Tap on the content to toggle full-screen mode"
|
text: "Tap on the content to toggle full-screen mode"
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
font.pixelSize: 20
|
|
||||||
z: 2.0
|
z: 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ Scene {
|
|||||||
margins: 20
|
margins: 20
|
||||||
}
|
}
|
||||||
text: content() ? content().started ? "Tap to stop" : "Tap to start" : ""
|
text: content() ? content().started ? "Tap to stop" : "Tap to start" : ""
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
font.pixelSize: 20
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Scene {
|
|||||||
y: 0.5 * parent.height
|
y: 0.5 * parent.height
|
||||||
width: content.width
|
width: content.width
|
||||||
height: content.height
|
height: content.height
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
|
|
||||||
SequentialAnimation on x {
|
SequentialAnimation on x {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Scene {
|
|||||||
bottom: rotateNegativeButton.top
|
bottom: rotateNegativeButton.top
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 90
|
width: Math.max(parent.width, parent.height) / 10
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
text: "Rotate +" + delta
|
text: "Rotate +" + delta
|
||||||
onClicked: content.rotation = content.rotation + delta
|
onClicked: content.rotation = content.rotation + delta
|
||||||
@@ -69,7 +69,7 @@ Scene {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 90
|
width: Math.max(parent.width, parent.height) / 10
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
text: "Rotate -" + delta
|
text: "Rotate -" + delta
|
||||||
onClicked: content.rotation = content.rotation - delta
|
onClicked: content.rotation = content.rotation - delta
|
||||||
@@ -82,7 +82,7 @@ Scene {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 30
|
width: Math.max(parent.width, parent.height) / 25
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
enabled: false
|
enabled: false
|
||||||
text: content.rotation % 360
|
text: content.rotation % 360
|
||||||
|
|||||||
@@ -39,44 +39,64 @@ Rectangle {
|
|||||||
property string sceneSource: ""
|
property string sceneSource: ""
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: list
|
id: videolist
|
||||||
ListElement { name: "multi"; source: "SceneMulti.qml" }
|
ListElement { name: "Multi"; source: "SceneMulti.qml" }
|
||||||
ListElement { name: "video"; source: "VideoBasic.qml" }
|
ListElement { name: "Video"; source: "VideoBasic.qml" }
|
||||||
ListElement { name: "video-drag"; source: "VideoDrag.qml" }
|
ListElement { name: "Drag"; source: "VideoDrag.qml" }
|
||||||
ListElement { name: "video-fillmode"; source: "VideoFillMode.qml" }
|
ListElement { name: "Fillmode"; source: "VideoFillMode.qml" }
|
||||||
ListElement { name: "video-fullscreen"; source: "VideoFullScreen.qml" }
|
ListElement { name: "Fullscreen"; source: "VideoFullScreen.qml" }
|
||||||
ListElement { name: "video-fullscreen-inverted"; source: "VideoFullScreenInverted.qml" }
|
ListElement { name: "Fullscreen-inverted"; source: "VideoFullScreenInverted.qml" }
|
||||||
ListElement { name: "video-metadata"; source: "VideoMetadata.qml" }
|
ListElement { name: "Metadata"; source: "VideoMetadata.qml" }
|
||||||
ListElement { name: "video-move"; source: "VideoMove.qml" }
|
ListElement { name: "Move"; source: "VideoMove.qml" }
|
||||||
ListElement { name: "video-overlay"; source: "VideoOverlay.qml" }
|
ListElement { name: "Overlay"; source: "VideoOverlay.qml" }
|
||||||
ListElement { name: "video-playbackrate"; source: "VideoPlaybackRate.qml" }
|
ListElement { name: "Playback Rate"; source: "VideoPlaybackRate.qml" }
|
||||||
ListElement { name: "video-resize"; source: "VideoResize.qml" }
|
ListElement { name: "Resize"; source: "VideoResize.qml" }
|
||||||
ListElement { name: "video-rotate"; source: "VideoRotate.qml" }
|
ListElement { name: "Rotate"; source: "VideoRotate.qml" }
|
||||||
ListElement { name: "video-spin"; source: "VideoSpin.qml" }
|
ListElement { name: "Spin"; source: "VideoSpin.qml" }
|
||||||
ListElement { name: "video-seek"; source: "VideoSeek.qml" }
|
ListElement { name: "Seek"; source: "VideoSeek.qml" }
|
||||||
ListElement { name: "camera"; source: "CameraBasic.qml" }
|
}
|
||||||
ListElement { name: "camera-drag"; source: "CameraDrag.qml" }
|
|
||||||
ListElement { name: "camera-fullscreen"; source: "CameraFullScreen.qml" }
|
ListModel {
|
||||||
ListElement { name: "camera-fullscreen-inverted"; source: "CameraFullScreenInverted.qml" }
|
id: cameralist
|
||||||
ListElement { name: "camera-move"; source: "CameraMove.qml" }
|
ListElement { name: "Camera"; source: "CameraBasic.qml" }
|
||||||
ListElement { name: "camera-overlay"; source: "CameraOverlay.qml" }
|
ListElement { name: "Drag"; source: "CameraDrag.qml" }
|
||||||
ListElement { name: "camera-resize"; source: "CameraResize.qml" }
|
ListElement { name: "Fullscreen"; source: "CameraFullScreen.qml" }
|
||||||
ListElement { name: "camera-rotate"; source: "CameraRotate.qml" }
|
ListElement { name: "Fullscreen-inverted"; source: "CameraFullScreenInverted.qml" }
|
||||||
ListElement { name: "camera-spin"; source: "CameraSpin.qml" }
|
ListElement { name: "Move"; source: "CameraMove.qml" }
|
||||||
|
ListElement { name: "Overlay"; source: "CameraOverlay.qml" }
|
||||||
|
ListElement { name: "Resize"; source: "CameraResize.qml" }
|
||||||
|
ListElement { name: "Rotate"; source: "CameraRotate.qml" }
|
||||||
|
ListElement { name: "Spin"; source: "CameraSpin.qml" }
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: delegate
|
id: leftDelegate
|
||||||
Item {
|
Item {
|
||||||
id: delegateItem
|
width: root.width / 2
|
||||||
width: root.width
|
height: 0.8 * itemHeight
|
||||||
height: itemHeight
|
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: selectorItem
|
anchors.fill: parent
|
||||||
anchors.centerIn: parent
|
anchors.margins: 5
|
||||||
width: 0.9 * parent.width
|
anchors.rightMargin: 2.5
|
||||||
height: 0.8 * itemHeight
|
anchors.bottomMargin: 0
|
||||||
|
text: name
|
||||||
|
onClicked: root.sceneSource = source
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: rightDelegate
|
||||||
|
Item {
|
||||||
|
width: root.width / 2
|
||||||
|
height: 0.8 * itemHeight
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 5
|
||||||
|
anchors.leftMargin: 2.5
|
||||||
|
anchors.bottomMargin: 0
|
||||||
text: name
|
text: name
|
||||||
onClicked: root.sceneSource = source
|
onClicked: root.sceneSource = source
|
||||||
}
|
}
|
||||||
@@ -85,20 +105,29 @@ Rectangle {
|
|||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
contentHeight: (itemHeight * list.count) + layout.anchors.topMargin + layout.spacing
|
contentHeight: (itemHeight * videolist.count) + 10
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Column {
|
Row {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
topMargin: 10
|
topMargin: 5
|
||||||
|
bottomMargin: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Column {
|
||||||
model: list
|
Repeater {
|
||||||
delegate: delegate
|
model: videolist
|
||||||
|
delegate: leftDelegate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
Repeater {
|
||||||
|
model: cameralist
|
||||||
|
delegate: rightDelegate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import QtQuick 2.0
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: seekControl
|
id: seekControl
|
||||||
height: 46
|
height: Math.min(parent.width, parent.height) / 20
|
||||||
property int duration: 0
|
property int duration: 0
|
||||||
property int playPosition: 0
|
property int playPosition: 0
|
||||||
property int seekPosition: 0
|
property int seekPosition: 0
|
||||||
@@ -45,8 +45,9 @@ Item {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "black"
|
color: "white"
|
||||||
opacity: 0.3
|
opacity: 0.3
|
||||||
|
radius: parent.height / 15
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -60,7 +61,6 @@ Item {
|
|||||||
Text {
|
Text {
|
||||||
width: 90
|
width: 90
|
||||||
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 10 }
|
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 10 }
|
||||||
font { family: "Nokia Sans S60"; pixelSize: 24 }
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
color: "white"
|
color: "white"
|
||||||
@@ -71,7 +71,6 @@ Item {
|
|||||||
Text {
|
Text {
|
||||||
width: 90
|
width: 90
|
||||||
anchors { right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10 }
|
anchors { right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10 }
|
||||||
font { family: "Nokia Sans S60"; pixelSize: 24 }
|
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
color: "white"
|
color: "white"
|
||||||
@@ -79,35 +78,36 @@ Item {
|
|||||||
text: formatTime(duration)
|
text: formatTime(duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Rectangle {
|
||||||
id: progressHandle
|
id: progressHandle
|
||||||
height: 46
|
height: parent.height
|
||||||
width: 10
|
width: parent.height / 2
|
||||||
source: mouseArea.pressed ? "qrc:/images/progress_handle_pressed.svg" : "qrc:/images/progress_handle.svg"
|
color: "white"
|
||||||
|
opacity: 0.5
|
||||||
anchors.verticalCenter: progressBar.verticalCenter
|
anchors.verticalCenter: progressBar.verticalCenter
|
||||||
x: seekControl.duration == 0 ? 0 : seekControl.playPosition / seekControl.duration * 630
|
x: seekControl.duration == 0 ? 0 : seekControl.playPosition / seekControl.duration * background.width
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
|
anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
|
||||||
height: 46+16
|
height: parent.height
|
||||||
width: height
|
width: parent.height * 2
|
||||||
enabled: seekControl.enabled
|
enabled: seekControl.enabled
|
||||||
drag {
|
drag {
|
||||||
target: progressHandle
|
target: progressHandle
|
||||||
axis: Drag.XAxis
|
axis: Drag.XAxis
|
||||||
minimumX: 0
|
minimumX: 0
|
||||||
maximumX: 631
|
maximumX: background.width
|
||||||
}
|
}
|
||||||
onPressed: {
|
onPressed: {
|
||||||
seekControl.seeking = true;
|
seekControl.seeking = true;
|
||||||
}
|
}
|
||||||
onCanceled: {
|
onCanceled: {
|
||||||
seekControl.seekPosition = progressHandle.x * seekControl.duration / 630
|
seekControl.seekPosition = progressHandle.x * seekControl.duration / background.width
|
||||||
seekControl.seeking = false
|
seekControl.seeking = false
|
||||||
}
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
seekControl.seekPosition = progressHandle.x * seekControl.duration / 630
|
seekControl.seekPosition = progressHandle.x * seekControl.duration / background.width
|
||||||
seekControl.seeking = false
|
seekControl.seeking = false
|
||||||
mouse.accepted = true
|
mouse.accepted = true
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ Item {
|
|||||||
interval: 300
|
interval: 300
|
||||||
running: seekControl.seeking
|
running: seekControl.seeking
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
seekControl.seekPosition = progressHandle.x*seekControl.duration/630
|
seekControl.seekPosition = progressHandle.x*seekControl.duration / background.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,16 +54,16 @@ Scene {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 150
|
width: Math.max(parent.width, parent.height) / 5
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
text: "PreserveAspectFit"
|
text: "PreserveAspectFit"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!content.dummy) {
|
if (!content.dummy) {
|
||||||
var video = content.contentItem()
|
var video = content.contentItem()
|
||||||
if (video.fillMode == VideoOutput.Stretch) {
|
if (video.fillMode === VideoOutput.Stretch) {
|
||||||
video.fillMode = VideoOutput.PreserveAspectFit
|
video.fillMode = VideoOutput.PreserveAspectFit
|
||||||
text = "PreserveAspectFit"
|
text = "PreserveAspectFit"
|
||||||
} else if (video.fillMode == VideoOutput.PreserveAspectFit) {
|
} else if (video.fillMode === VideoOutput.PreserveAspectFit) {
|
||||||
video.fillMode = VideoOutput.PreserveAspectCrop
|
video.fillMode = VideoOutput.PreserveAspectCrop
|
||||||
text = "PreserveAspectCrop"
|
text = "PreserveAspectCrop"
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -56,55 +56,55 @@ Scene {
|
|||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Title:" + content.contentItem().metaData.title
|
text: "Title:" + content.contentItem().metaData.title
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Size:" + content.contentItem().metaData.size
|
text: "Size:" + content.contentItem().metaData.size
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Resolution:" + content.contentItem().metaData.resolution
|
text: "Resolution:" + content.contentItem().metaData.resolution
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Media type:" + content.contentItem().metaData.mediaType
|
text: "Media type:" + content.contentItem().metaData.mediaType
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Video codec:" + content.contentItem().metaData.videoCodec
|
text: "Video codec:" + content.contentItem().metaData.videoCodec
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Video bit rate:" + content.contentItem().metaData.videoBitRate
|
text: "Video bit rate:" + content.contentItem().metaData.videoBitRate
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Video frame rate:" +content.contentItem().metaData.videoFrameRate
|
text: "Video frame rate:" +content.contentItem().metaData.videoFrameRate
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Audio codec:" + content.contentItem().metaData.audioCodec
|
text: "Audio codec:" + content.contentItem().metaData.audioCodec
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Audio bit rate:" + content.contentItem().metaData.audioBitRate
|
text: "Audio bit rate:" + content.contentItem().metaData.audioBitRate
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Date:" + content.contentItem().metaData.date
|
text: "Date:" + content.contentItem().metaData.date
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Description:" + content.contentItem().metaData.description
|
text: "Description:" + content.contentItem().metaData.description
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Copyright:" + content.contentItem().metaData.copyright
|
text: "Copyright:" + content.contentItem().metaData.copyright
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
color: "yellow"
|
color: "#e0e0e0"
|
||||||
text: "Seekable:" + content.contentItem().metaData.seekable
|
text: "Seekable:" + content.contentItem().metaData.seekable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ Scene {
|
|||||||
bottom: decreaseButton.top
|
bottom: decreaseButton.top
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 90
|
width: Math.max(parent.width, parent.height) / 10
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
text: "Increase"
|
text: "Increase"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var video = content.contentItem()
|
var video = content.contentItem()
|
||||||
video.playbackRate = video.playbackRate + delta
|
video.playbackRate += delta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,12 +72,12 @@ Scene {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 90
|
width: Math.max(parent.width, parent.height) / 10
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
text: "Decrease"
|
text: "Decrease"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var video = content.contentItem()
|
var video = content.contentItem()
|
||||||
video.playbackRate = video.playbackRate - delta
|
video.playbackRate -= delta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ Scene {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
margins: parent.margins
|
margins: parent.margins
|
||||||
}
|
}
|
||||||
width: 50
|
width: Math.max(parent.width, parent.height) / 25
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
enabled: false
|
enabled: false
|
||||||
text: Math.round(10 * content.contentItem().playbackRate) / 10
|
text: Math.round(10 * content.contentItem().playbackRate) / 10
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import QtQuick 2.0
|
|||||||
Scene {
|
Scene {
|
||||||
id: root
|
id: root
|
||||||
property string contentType: "video"
|
property string contentType: "video"
|
||||||
|
contentWidth: parent.width
|
||||||
|
|
||||||
Content {
|
Content {
|
||||||
id: content
|
id: content
|
||||||
@@ -51,13 +52,12 @@ Scene {
|
|||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
leftMargin: 100
|
margins: 10
|
||||||
rightMargin: 140
|
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
duration: content.contentItem() ? content.contentItem().duration : 0
|
duration: content.contentItem() ? content.contentItem().duration : 0
|
||||||
playPosition: content.contentItem() ? content.contentItem().position : 0
|
playPosition: content.contentItem() ? content.contentItem().position : 0
|
||||||
onSeekPositionChanged: { content.contentItem().seek(seekPosition); }
|
onSeekPositionChanged: content.contentItem().seek(seekPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: root.content = content
|
Component.onCompleted: root.content = content
|
||||||
|
|||||||
@@ -35,22 +35,21 @@ import QtQuick 2.0
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
width: 640
|
anchors.fill: parent
|
||||||
height: 360
|
|
||||||
color: "black"
|
color: "black"
|
||||||
|
|
||||||
property string source1
|
property string source1
|
||||||
property string source2
|
property string source2
|
||||||
property color bgColor: "#002244"
|
property color bgColor: "black"
|
||||||
property real volume: 0.25
|
property real volume: 0.25
|
||||||
property bool perfMonitorsLogging: false
|
property bool perfMonitorsLogging: false
|
||||||
property bool perfMonitorsVisible: false
|
property bool perfMonitorsVisible: false
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
property int itemHeight: 40
|
property int itemHeight: root.height > root.width ? root.width / 10 : root.height / 10
|
||||||
property int buttonHeight: 0.8 * itemHeight
|
property int buttonHeight: 0.8 * itemHeight
|
||||||
property int margins: 10
|
property int margins: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
@@ -92,6 +91,9 @@ Rectangle {
|
|||||||
right: exitButton.left
|
right: exitButton.left
|
||||||
margins: d.margins
|
margins: d.margins
|
||||||
}
|
}
|
||||||
|
bgColor: "#212121"
|
||||||
|
bgColorSelected: "#757575"
|
||||||
|
textColorSelected: "white"
|
||||||
height: d.buttonHeight
|
height: d.buttonHeight
|
||||||
text: (root.source1 == "") ? "Select file 1" : root.source1
|
text: (root.source1 == "") ? "Select file 1" : root.source1
|
||||||
onClicked: fileBrowser1.show()
|
onClicked: fileBrowser1.show()
|
||||||
@@ -105,6 +107,9 @@ Rectangle {
|
|||||||
right: exitButton.left
|
right: exitButton.left
|
||||||
margins: d.margins
|
margins: d.margins
|
||||||
}
|
}
|
||||||
|
bgColor: "#212121"
|
||||||
|
bgColorSelected: "#757575"
|
||||||
|
textColorSelected: "white"
|
||||||
height: d.buttonHeight
|
height: d.buttonHeight
|
||||||
text: (root.source2 == "") ? "Select file 2" : root.source2
|
text: (root.source2 == "") ? "Select file 2" : root.source2
|
||||||
onClicked: fileBrowser2.show()
|
onClicked: fileBrowser2.show()
|
||||||
@@ -117,24 +122,57 @@ Rectangle {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
margins: d.margins
|
margins: d.margins
|
||||||
}
|
}
|
||||||
width: 50
|
bgColor: "#212121"
|
||||||
|
bgColorSelected: "#757575"
|
||||||
|
textColorSelected: "white"
|
||||||
|
width: parent.width / 10
|
||||||
height: d.buttonHeight
|
height: d.buttonHeight
|
||||||
text: "Exit"
|
text: "Exit"
|
||||||
onClicked: Qt.quit()
|
onClicked: Qt.quit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: modes
|
||||||
|
anchors.top: openFile2Button.bottom
|
||||||
|
anchors.margins: 0
|
||||||
|
anchors.topMargin: 5
|
||||||
|
Button {
|
||||||
|
width: root.width / 2
|
||||||
|
height: 0.8 * d.itemHeight
|
||||||
|
bgColor: "#212121"
|
||||||
|
radius: 0
|
||||||
|
text: "Video Modes"
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
width: root.width / 2
|
||||||
|
height: 0.8 * d.itemHeight
|
||||||
|
bgColor: "#212121"
|
||||||
|
radius: 0
|
||||||
|
text: "Camera Modes"
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: divider
|
||||||
|
height: 1
|
||||||
|
width: parent.width
|
||||||
|
color: "black"
|
||||||
|
anchors.top: modes.bottom
|
||||||
|
}
|
||||||
|
|
||||||
SceneSelectionPanel {
|
SceneSelectionPanel {
|
||||||
id: sceneSelectionPanel
|
id: sceneSelectionPanel
|
||||||
itemHeight: d.itemHeight
|
itemHeight: d.itemHeight
|
||||||
color: "#004444"
|
color: "#212121"
|
||||||
anchors {
|
anchors {
|
||||||
top: openFile2Button.bottom
|
top: divider.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
margins: d.margins
|
|
||||||
}
|
}
|
||||||
radius: 10
|
radius: 0
|
||||||
onSceneSourceChanged: {
|
onSceneSourceChanged: {
|
||||||
sceneLoader.source = sceneSource
|
sceneLoader.source = sceneSource
|
||||||
var scene = null
|
var scene = null
|
||||||
@@ -205,7 +243,9 @@ Rectangle {
|
|||||||
|
|
||||||
ErrorDialog {
|
ErrorDialog {
|
||||||
id: errorDialog
|
id: errorDialog
|
||||||
anchors.fill: parent
|
anchors.fill: root
|
||||||
|
dialogWidth: d.itemHeight * 5
|
||||||
|
dialogHeight: d.itemHeight * 3
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file alias="leaves.jpg">images/leaves.jpg</file>
|
<file alias="leaves.jpg">images/leaves.jpg</file>
|
||||||
<file alias="close.png">images/close.png</file>
|
|
||||||
<file alias="folder.png">images/folder.png</file>
|
<file alias="folder.png">images/folder.png</file>
|
||||||
<file alias="titlebar.png">images/titlebar.png</file>
|
|
||||||
<file alias="titlebar.sci">images/titlebar.sci</file>
|
|
||||||
<file alias="up.png">images/up.png</file>
|
<file alias="up.png">images/up.png</file>
|
||||||
<file alias="progress_handle.svg">images/progress_handle.svg</file>
|
|
||||||
<file alias="progress_handle_pressed.svg">images/progress_handle_pressed.svg</file>
|
|
||||||
<file>qml/qmlvideo/Button.qml</file>
|
<file>qml/qmlvideo/Button.qml</file>
|
||||||
<file>qml/qmlvideo/CameraBasic.qml</file>
|
<file>qml/qmlvideo/CameraBasic.qml</file>
|
||||||
<file>qml/qmlvideo/CameraDrag.qml</file>
|
<file>qml/qmlvideo/CameraDrag.qml</file>
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2014 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:LGPL21$
|
|
||||||
** 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 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** 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.
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtMultimedia 5.0
|
|
||||||
|
|
||||||
VideoOutput {
|
|
||||||
source: camera
|
|
||||||
|
|
||||||
Camera {
|
|
||||||
id: camera
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
<file>images/qt-logo.png</file>
|
<file>images/qt-logo.png</file>
|
||||||
<file>qml/qmlvideofx/Button.qml</file>
|
<file>qml/qmlvideofx/Button.qml</file>
|
||||||
<file>qml/qmlvideofx/Content.qml</file>
|
<file>qml/qmlvideofx/Content.qml</file>
|
||||||
<file>qml/qmlvideofx/ContentCamera.qml</file>
|
|
||||||
<file>qml/qmlvideofx/ContentImage.qml</file>
|
<file>qml/qmlvideofx/ContentImage.qml</file>
|
||||||
<file>qml/qmlvideofx/ContentVideo.qml</file>
|
<file>qml/qmlvideofx/ContentVideo.qml</file>
|
||||||
<file>qml/qmlvideofx/Divider.qml</file>
|
<file>qml/qmlvideofx/Divider.qml</file>
|
||||||
|
|||||||