From a58ed805e6c74393b2f55e35419b54e47cb21dd6 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Tue, 18 Sep 2012 01:17:06 +0300 Subject: [PATCH] Added indicators and settings page for video. --- qml/VideoColorFilterPage.qml | 108 ++++++++++++++++++++++++++++++++++ qml/VideoPage.qml | 71 ++++++++++++++++++++-- qml/VideoSettingsPage.qml | 75 +++++++++++++++++++++++ qml/VideoWhiteBalancePage.qml | 98 ++++++++++++++++++++++++++++++ 4 files changed, 348 insertions(+), 4 deletions(-) create mode 100644 qml/VideoColorFilterPage.qml create mode 100644 qml/VideoSettingsPage.qml create mode 100644 qml/VideoWhiteBalancePage.qml diff --git a/qml/VideoColorFilterPage.qml b/qml/VideoColorFilterPage.qml new file mode 100644 index 0000000..c9db70d --- /dev/null +++ b/qml/VideoColorFilterPage.qml @@ -0,0 +1,108 @@ +// -*- qml -*- +import QtQuick 1.1 +import com.nokia.meego 1.1 +import QtCamera 1.0 +import CameraPlus 1.0 +import "data.js" as Data + +CameraPage { + id: page + + controlsVisible: false + policyMode: CameraResources.Video + needsPipeline: true + + Rectangle { + color: "black" + width: parent.width + height: row.height + title.height + 30 + anchors.bottom: toolBar.top + opacity: 0.5 + + SectionHeader { + id: title + anchors.top: parent.top + anchors.topMargin: 10 + text: qsTr("Color filter"); + } + + Row { + id: row + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 20 + anchors.rightMargin: 20 + anchors.top: title.bottom + anchors.topMargin: 10 + + IconButton { + width: parent.width / 6 + normalIcon: "image://theme/" + Data.cfIcon(value); + checkedIcon: "image://theme/" + Data.cfSelectedIcon(value); + value: ColorTone.Normal + savedValue: settings.videoColorFilter + onClicked: settings.videoColorFilter = value; + text: Data.cfName(value); + } + + IconButton { + width: parent.width / 6 + normalIcon: "image://theme/" + Data.cfIcon(value); + checkedIcon: "image://theme/" + Data.cfSelectedIcon(value); + value: ColorTone.GrayScale + savedValue: settings.videoColorFilter + onClicked: settings.videoColorFilter = value; + text: Data.cfName(value); + } + + IconButton { + width: parent.width / 6 + normalIcon: "image://theme/" + Data.cfIcon(value); + checkedIcon: "image://theme/" + Data.cfSelectedIcon(value); + value: ColorTone.Sepia + savedValue: settings.videoColorFilter + onClicked: settings.videoColorFilter = value; + text: Data.cfName(value); + } + + IconButton { + width: parent.width / 6 + normalIcon: "image://theme/" + Data.cfIcon(value); + checkedIcon: "image://theme/" + Data.cfSelectedIcon(value); + value: ColorTone.Vivid + savedValue: settings.videoColorFilter + onClicked: settings.videoColorFilter = value; + text: Data.cfName(value); + } + + IconButton { + width: parent.width / 6 + normalIcon: "image://theme/" + Data.cfIcon(value); + checkedIcon: "image://theme/" + Data.cfSelectedIcon(value); + value: ColorTone.Negative + savedValue: settings.videoColorFilter + onClicked: settings.videoColorFilter = value; + text: Data.cfName(value); + } + + IconButton { + width: parent.width / 6 + normalIcon: "image://theme/" + Data.cfIcon(value); + checkedIcon: "image://theme/" + Data.cfSelectedIcon(value); + value: ColorTone.Solarize + savedValue: settings.videoColorFilter + onClicked: settings.videoColorFilter = value; + text: Data.cfName(value); + } + } + } + + ToolBar { + id: toolBar + anchors.bottom: parent.bottom + tools: ToolBarLayout { + id: layout + ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); } + } + } +} diff --git a/qml/VideoPage.qml b/qml/VideoPage.qml index 39adf2e..aec2954 100644 --- a/qml/VideoPage.qml +++ b/qml/VideoPage.qml @@ -3,13 +3,18 @@ import QtQuick 1.1 import com.nokia.meego 1.1 import QtCamera 1.0 import CameraPlus 1.0 +import "data.js" as Data +// TODO: video recording indicators. +// TODO: stop recording when battery low +// TODO: stop recording when disk is low CameraPage { id: page policyMode: CameraResources.Video - controlsVisible: recording.visible && cam.running && !standbyWidget.visible + controlsVisible: videoControlsVisible && !videoMode.recording + property bool videoControlsVisible: recording.visible && cam.running && !standbyWidget.visible orientationLock: PageOrientation.LockLandscape @@ -91,7 +96,7 @@ CameraPage { VideoTorchButton { id: torch - visible: controlsVisible + visible: videoControlsVisible anchors.top: parent.top anchors.left: parent.left anchors.topMargin: 20 @@ -101,7 +106,7 @@ CameraPage { VideoSceneButton { id: scene - visible: controlsVisible && !videoMode.recording + visible: controlsVisible anchors.top: torch.bottom anchors.left: parent.left anchors.topMargin: 10 @@ -110,13 +115,71 @@ CameraPage { EvCompButton { id: evComp - visible: controlsVisible + visible: videoControlsVisible anchors.top: scene.bottom anchors.left: parent.left anchors.topMargin: 10 anchors.leftMargin: 20 } + MouseArea { + id: indicators + anchors.bottom: parent.bottom + anchors.bottomMargin: 20 + anchors.left: parent.left + anchors.leftMargin: 20 + width: 48 + height: col.height + onClicked: openFile("VideoSettingsPage.qml"); + visible: controlsVisible + + BorderImage { + id: image + anchors.fill: parent + smooth: true + source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background" + } + + Column { + id: col + width: parent.width + spacing: 5 + + Indicator { + id: resolutionIndicator + // TODO: + } + + Indicator { + id: wbIndicator + source: "image://theme/" + Data.wbIcon(settings.videoWhiteBalance) + "-screen" + visible: settings.videoWhiteBalance != WhiteBalance.Auto + } + + Indicator { + id: cfIndicator + source: "image://theme/" + Data.cfIcon(settings.videoColorFilter) + "-screen" + visible: settings.videoColorFilter != ColorTone.Normal + } + + Indicator { + id: gpsIndicator + visible: settings.useGps + source: "image://theme/icon-m-camera-location" + + PropertyAnimation on opacity { + easing.type: Easing.OutSine + loops: Animation.Infinite + from: 0.2 + to: 1.0 + duration: 1000 + running: settings.useGps && !positionSource.position.longitudeValid + alwaysRunToEnd: true + } + } + } + } + Button { id: cameraRoll anchors.top: parent.top diff --git a/qml/VideoSettingsPage.qml b/qml/VideoSettingsPage.qml new file mode 100644 index 0000000..89e1b0c --- /dev/null +++ b/qml/VideoSettingsPage.qml @@ -0,0 +1,75 @@ +// -*- qml -*- +import QtQuick 1.1 +import com.nokia.meego 1.1 +import QtCamera 1.0 +import CameraPlus 1.0 + +import "data.js" as Data + +CameraPage { + id: page + controlsVisible: false + policyMode: CameraResources.Video + needsPipeline: false + + Rectangle { + color: "black" + anchors.fill: parent + } + + Flickable { + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: toolBar.top + anchors.margins: 10 + contentHeight: col.height + + Column { + id: col + + width: parent.width + spacing: 10 + + Label { + // TODO: + text: qsTr("Video settings"); + } + + Row { + width: parent.width + + ListItem { + id: wb + width: parent.width / 2 + title: qsTr("White balance"); + subtitle: Data.wbName(settings.videoWhiteBalance); + iconId: Data.wbSelectedIcon(settings.videoWhiteBalance); + onClicked: openFile("VideoWhiteBalancePage.qml"); + } + + ListItem { + id: cf + width: parent.width / 2 + title: qsTr("Color filter"); + subtitle: Data.cfName(settings.videoColorFilter); + iconId: Data.cfSelectedIcon(settings.videoColorFilter); + onClicked: openFile("VideoColorFilterPage.qml"); + } + } + + CameraSettings { + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + + ToolBar { + id: toolBar + anchors.bottom: parent.bottom + tools: ToolBarLayout { + id: layout + ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); } + } + } +} diff --git a/qml/VideoWhiteBalancePage.qml b/qml/VideoWhiteBalancePage.qml new file mode 100644 index 0000000..b665ad6 --- /dev/null +++ b/qml/VideoWhiteBalancePage.qml @@ -0,0 +1,98 @@ +// -*- qml -*- +import QtQuick 1.1 +import com.nokia.meego 1.1 +import QtCamera 1.0 +import CameraPlus 1.0 +import "data.js" as Data + +CameraPage { + id: page + + controlsVisible: false + policyMode: CameraResources.Video + needsPipeline: true + + Rectangle { + color: "black" + width: parent.width + height: row.height + title.height + 30 + anchors.bottom: toolBar.top + opacity: 0.5 + + SectionHeader { + id: title + anchors.top: parent.top + anchors.topMargin: 10 + text: qsTr("White balance"); + } + + Row { + id: row + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 20 + anchors.rightMargin: 20 + anchors.top: title.bottom + anchors.topMargin: 10 + + IconButton { + width: parent.width / 5 + normalIcon: "image://theme/" + Data.wbIcon(value); + checkedIcon: "image://theme/" + Data.wbSelectedIcon(value); + value: WhiteBalance.Auto + savedValue: settings.videoWhiteBalance + onClicked: settings.videoWhiteBalance = value; + text: Data.wbName(value); + } + + IconButton { + width: parent.width / 5 + normalIcon: "image://theme/" + Data.wbIcon(value); + checkedIcon: "image://theme/" + Data.wbSelectedIcon(value); + value: WhiteBalance.Sunset + savedValue: settings.videoWhiteBalance + onClicked: settings.videoWhiteBalance = value; + text: Data.wbName(value); + } + + IconButton { + width: parent.width / 5 + normalIcon: "image://theme/" + Data.wbIcon(value); + checkedIcon: "image://theme/" + Data.wbSelectedIcon(value); + value: WhiteBalance.Cloudy + savedValue: settings.videoWhiteBalance + onClicked: settings.videoWhiteBalance = value; + text: Data.wbName(value); + } + + IconButton { + width: parent.width / 5 + normalIcon: "image://theme/" + Data.wbIcon(value); + checkedIcon: "image://theme/" + Data.wbSelectedIcon(value); + value: WhiteBalance.Flourescent + savedValue: settings.videoWhiteBalance + onClicked: settings.videoWhiteBalance = value; + text: Data.wbName(value); + } + + IconButton { + width: parent.width / 5 + normalIcon: "image://theme/" + Data.wbIcon(value); + checkedIcon: "image://theme/" + Data.wbSelectedIcon(value); + value: WhiteBalance.Tungsten + savedValue: settings.videoWhiteBalance + onClicked: settings.videoWhiteBalance = value; + text: Data.wbName(value); + } + } + } + + ToolBar { + id: toolBar + anchors.bottom: parent.bottom + tools: ToolBarLayout { + id: layout + ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); } + } + } +} -- 2.25.1