Merge remote-tracking branch 'origin/5.3' into dev
Conflicts: .qmake.conf Change-Id: Iecd8d7b94e52a8981526b12cffa40e99870ba62f
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
\example audiodevices
|
\example audiodevices
|
||||||
\title Audio Devices Example
|
\title Audio Devices Example
|
||||||
\ingroup multimedia_examples
|
\ingroup multimedia_examples
|
||||||
\brief The Audio Devices example shows the application of the audio devices APIs
|
\brief The Audio Devices example shows the application of the audio devices
|
||||||
|
APIs.
|
||||||
|
|
||||||
This example shows how to create a simple application to list and test
|
This example shows how to create a simple application to list and test
|
||||||
the configuration for the various audio devices available on the device
|
the configuration for the various audio devices available on the device
|
||||||
@@ -38,6 +38,5 @@
|
|||||||
|
|
||||||
\image audiodevices.png
|
\image audiodevices.png
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
\title AudioEngine Example
|
\title AudioEngine Example
|
||||||
\ingroup multimedia_examples
|
\ingroup multimedia_examples
|
||||||
\brief The Audio Engine example demonstrates 3D sound control using
|
\brief The Audio Engine example demonstrates 3D sound control using
|
||||||
the QtAudioEngine API.
|
the Qt Audio Engine API.
|
||||||
|
|
||||||
\image audioengine.png
|
The Audio Engine example demonstrates 3D sound control using the
|
||||||
|
\l{Qt Audio Engine QML Types}{Qt Audio Engine} API.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -37,7 +37,8 @@
|
|||||||
Qt provides the QAudioInput class to enable audio functionality within
|
Qt provides the QAudioInput class to enable audio functionality within
|
||||||
a standard application user interface.
|
a standard application user interface.
|
||||||
|
|
||||||
This example calculates the maximum linear value of the input audio from the microphone and displays the output.
|
This example calculates the maximum linear value of the input audio from the
|
||||||
|
microphone and displays the output.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -31,13 +31,14 @@
|
|||||||
\ingroup multimedia_examples
|
\ingroup multimedia_examples
|
||||||
\brief The Audio Output Example show the use of the QAudioOutput API.
|
\brief The Audio Output Example show the use of the QAudioOutput API.
|
||||||
|
|
||||||
The example demonstrates the basic use cases of the QAudioOutput class.
|
The example demonstrates the basic use cases of the QAudioOutput class from
|
||||||
|
\l{Qt Multimedia}.
|
||||||
|
|
||||||
\image audiooutput-example.png
|
\image audiooutput-example.png
|
||||||
|
|
||||||
This example provides a tone generator to supply continuous audio playback.
|
This example provides a tone generator to supply continuous audio playback.
|
||||||
The first button allows pause and resume of the playback, and the second
|
The first button allows pause and resume of the playback, and the second
|
||||||
button allows toggling between push and pull modes of operation.
|
button allows toggling between push and pull modes of operation.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -34,6 +34,12 @@
|
|||||||
It demonstrates the discovery of the supported devices and codecs and the use
|
It demonstrates the discovery of the supported devices and codecs and the use
|
||||||
of recording functions in the QAudioRecorder class.
|
of recording functions in the QAudioRecorder class.
|
||||||
|
|
||||||
|
\image audiorecorder.png
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
|
|
||||||
|
\section1 Displaying the Window and Audio Settings
|
||||||
|
|
||||||
We display a window for the user to select the appropriate audio input,
|
We display a window for the user to select the appropriate audio input,
|
||||||
codec, container, and sample rate. Allow a setting of either quality or
|
codec, container, and sample rate. Allow a setting of either quality or
|
||||||
bitrate. Finally, the output file can be selected and recording can be
|
bitrate. Finally, the output file can be selected and recording can be
|
||||||
@@ -49,7 +55,7 @@
|
|||||||
\l{QMultimedia::NormalQuality}, while the bitrates are hardcoded
|
\l{QMultimedia::NormalQuality}, while the bitrates are hardcoded
|
||||||
into the list.
|
into the list.
|
||||||
|
|
||||||
\image audiorecorder.png
|
\section1 Recording Audio
|
||||||
|
|
||||||
To record audio we simply create a QAudioRecorder object.
|
To record audio we simply create a QAudioRecorder object.
|
||||||
|
|
||||||
@@ -96,5 +102,3 @@
|
|||||||
ui->statusbar->showMessage(tr("Recorded %1 sec").arg(duration / 1000));
|
ui->statusbar->showMessage(tr("Recorded %1 sec").arg(duration / 1000));
|
||||||
\endcode
|
\endcode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -34,35 +34,22 @@ or video.
|
|||||||
|
|
||||||
\image qml-camera.png
|
\image qml-camera.png
|
||||||
|
|
||||||
This example demonstrates how to use the Qt Multimedia QML API to access
|
This example demonstrates how to use the
|
||||||
camera functions. It shows how to change settings and to capture images.
|
\l{Qt Multimedia QML Types}{Qt Multimedia QML API} to access camera functions.
|
||||||
|
It shows how to change settings and to capture images.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
|
|
||||||
|
\section1 Application Structure
|
||||||
|
|
||||||
Most of the QML code supports the user interface for this application with the
|
Most of the QML code supports the user interface for this application with the
|
||||||
camera types being mostly found in \e {declarative-camera.qml} and
|
camera types being mostly found in \e {declarative-camera.qml} and
|
||||||
\e {CaptureControls.qml}.
|
\e {CaptureControls.qml}.
|
||||||
|
|
||||||
In \e {declarative-camera.qml} the \l Camera is initialized with an id
|
CaptureControls, which is implemented in \e {CaptureControls.qml},
|
||||||
of \e {camera}, a photo preview is setup, states are implemented for image
|
|
||||||
preview or capture and \l CaptureControls is initialized. The initial
|
|
||||||
\e state is \e PhotoCapture. \l CameraCapture includes a handler, \e onImageCaptured,
|
|
||||||
for the \l {imageCaptured} signal. The handler sets up the application to process
|
|
||||||
the preview including a change in the user interface state. The \l PhotoPreview
|
|
||||||
becomes visible with any key press being picked up by the handler
|
|
||||||
in PhotoPreview and returning the state to \e PhotoCapture.
|
|
||||||
|
|
||||||
\e CaptureControls, which is implemented in \e {CaptureControls.qml},
|
|
||||||
generates a column on the right hand side of the screen which includes control
|
generates a column on the right hand side of the screen which includes control
|
||||||
buttons for \e focus (not initially visible), \e {capture}, \e {flash modes},
|
buttons for focus (not initially visible), capture, flash modes,
|
||||||
\e {white balance}, \e {exposure compensation}, and if a preview is
|
white balance, exposure compensation, and if a preview is
|
||||||
available a \e {preview} button. The last button exits from the application.
|
available, a preview button. The last button exits from the application.
|
||||||
|
|
||||||
When the Capture button is pressed the \e onClicked handler calls
|
|
||||||
\l {Camera::captureImage()}{captureImage()}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
\brief Demonstrates the radio functionality
|
\brief Demonstrates the radio functionality
|
||||||
\ingroup multimedia_examples
|
\ingroup multimedia_examples
|
||||||
|
|
||||||
This examples uses the Qt Multimedia Radio QML type to list the available
|
This examples uses the \l{Qt Multimedia} \l Radio QML type to list the
|
||||||
channels on the FM frequency.
|
available channels on the FM frequency.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -59,6 +59,6 @@
|
|||||||
(FFT) of a segment of audio data. An open-source library,
|
(FFT) of a segment of audio data. An open-source library,
|
||||||
\l{http://ldesoras.free.fr/prod.html}{FFTReal}, against which the
|
\l{http://ldesoras.free.fr/prod.html}{FFTReal}, against which the
|
||||||
application is dynamically linked, is used to compute the transform.
|
application is dynamically linked, is used to compute the transform.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
examples/multimedia/video/doc/images/qmlvideofx-camera-glow.jpg
Normal file
|
After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 245 KiB |
|
Before Width: | Height: | Size: 200 KiB |
|
After Width: | Height: | Size: 62 KiB |
BIN
examples/multimedia/video/doc/images/qmlvideofx-effects-menu.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 251 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 273 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 215 KiB |
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -34,8 +34,6 @@
|
|||||||
resize; rotate; change aspect ratio) which can be applied to QML \l{VideoOutput}
|
resize; rotate; change aspect ratio) which can be applied to QML \l{VideoOutput}
|
||||||
items.
|
items.
|
||||||
|
|
||||||
\section1 Overview
|
|
||||||
|
|
||||||
This example demonstrates the various manipulations (move; resize; rotate;
|
This example demonstrates the various manipulations (move; resize; rotate;
|
||||||
change aspect ratio) which can be applied to QML \l{VideoOutput} items.
|
change aspect ratio) which can be applied to QML \l{VideoOutput} items.
|
||||||
|
|
||||||
@@ -50,7 +48,9 @@ which moves across the \l{VideoOutput} item.
|
|||||||
|
|
||||||
\image qmlvideo-overlay.png
|
\image qmlvideo-overlay.png
|
||||||
|
|
||||||
\section1 Application structure
|
\include examples-run.qdocinc
|
||||||
|
|
||||||
|
\section1 Application Structure
|
||||||
|
|
||||||
The \l{video/qmlvideo/qml/qmlvideo/main.qml} file creates a UI which includes
|
The \l{video/qmlvideo/qml/qmlvideo/main.qml} file creates a UI which includes
|
||||||
the following items:
|
the following items:
|
||||||
@@ -127,7 +127,7 @@ instance, the embedded
|
|||||||
\l{video/qmlvideo/qml/qmlvideo/Content.qml}{Content} item creates either a
|
\l{video/qmlvideo/qml/qmlvideo/Content.qml}{Content} item creates either a
|
||||||
\l{MediaPlayer} or a \l{Camera} item.
|
\l{MediaPlayer} or a \l{Camera} item.
|
||||||
|
|
||||||
\section1 Calculating and displaying QML painting rate
|
\section1 Calculating and Displaying QML Painting Rate
|
||||||
|
|
||||||
\input multimedia/doc/src/examples/video-qml-paint-rate.qdocinc
|
\input multimedia/doc/src/examples/video-qml-paint-rate.qdocinc
|
||||||
|
|
||||||
@@ -145,4 +145,3 @@ object to a JavaScript function, which will eventually call frequencyItem.notify
|
|||||||
\printuntil SLOT(qmlFramePainted()));
|
\printuntil SLOT(qmlFramePainted()));
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -34,9 +34,11 @@
|
|||||||
can be used to apply postprocessing effects, expressed in \c GLSL, to video
|
can be used to apply postprocessing effects, expressed in \c GLSL, to video
|
||||||
and camera viewfinder content.
|
and camera viewfinder content.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
|
|
||||||
\section1 Overview
|
\section1 Overview
|
||||||
|
|
||||||
This example shows how a \l {ShaderEffectItem} can be used to apply
|
This example shows how a \l {ShaderEffect} can be used to apply
|
||||||
postprocessing effects, expressed in GLSL, to QML \l {VideoOutput} items.
|
postprocessing effects, expressed in GLSL, to QML \l {VideoOutput} items.
|
||||||
|
|
||||||
It also shows how native code can be combined with QML to implement more
|
It also shows how native code can be combined with QML to implement more
|
||||||
@@ -44,36 +46,30 @@ advanced functionality - in this case, C++ code is used to calculate the QML
|
|||||||
frame rate. This value is rendered in QML in a semi-transparent item
|
frame rate. This value is rendered in QML in a semi-transparent item
|
||||||
overlaid on the video content.
|
overlaid on the video content.
|
||||||
|
|
||||||
Finally, this application demonstrates the use of different top-level QML
|
|
||||||
files to handle different physical screen sizes. On small-screen devices,
|
|
||||||
menus are by default hidden, and only appear when summoned by a gesture.
|
|
||||||
Large-screen devices show a more traditional layout in which menus are
|
|
||||||
displayed around the video content pane.
|
|
||||||
|
|
||||||
The following screenshots show shader effects being applied. In each case,
|
The following screenshots show shader effects being applied. In each case,
|
||||||
the effect is implemented using a fragment shader.
|
the effect is implemented using a fragment shader.
|
||||||
|
|
||||||
Here we see an edge detection algorithm being applied to a video clip
|
Here we see an edge detection algorithm being applied to a video clip
|
||||||
(\l{http://orange.blender.org/}{Elephant's Dream from blender.org}).
|
(\l{http://durian.blender.org/}{Sintel from blender.org}).
|
||||||
\image qmlvideofx-video-edgedetection.png
|
\image qmlvideofx-video-edgedetection.jpg
|
||||||
|
|
||||||
This image shows a page curl effect, applied to the same video clip.
|
This image shows a page curl effect, applied to the same video clip.
|
||||||
\image qmlvideofx-video-pagecurl.png
|
\image qmlvideofx-video-pagecurl.jpg
|
||||||
|
|
||||||
Here we see a 'glow' effect (edge detection plus colour quantization) being
|
Here we see a 'glow' effect (edge detection plus colour quantization) being
|
||||||
applied to the camera viewfinder.
|
applied to the camera viewfinder.
|
||||||
\image qmlvideofx-camera-glow.png
|
\image qmlvideofx-camera-glow.jpg
|
||||||
|
|
||||||
This image shows a 'lens magnification' effect applied to the viewfinder.
|
This image shows a 'wobble' effect applied to the viewfinder.
|
||||||
\image qmlvideofx-camera-magnify.png
|
\image qmlvideofx-camera-wobble.jpg
|
||||||
|
|
||||||
The application includes many more effects than the ones shown here - look
|
The application includes many more effects than the ones shown here - look
|
||||||
for Effect*.qml files in the list above to see the full range.
|
for Effect*.qml files in the list of files below to see the full range.
|
||||||
|
|
||||||
\section1 Application structure
|
\section1 Application structure
|
||||||
|
|
||||||
Shader effects can be applied to video or viewfinder content using
|
Shader effects can be applied to video or viewfinder content using
|
||||||
\l{ShaderEffectItem}, as shown in the following example, which applies
|
\l{ShaderEffect}, as shown in the following example, which applies
|
||||||
a wiggly effect to the content:
|
a wiggly effect to the content:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
@@ -171,7 +167,7 @@ is based on the \l{ShaderEffect}:
|
|||||||
\skipto import
|
\skipto import
|
||||||
\printuntil /^\}/
|
\printuntil /^\}/
|
||||||
|
|
||||||
The interface of the \l Effect allows for derived effects to specify the
|
The interface of Effect allows for derived effects to specify the
|
||||||
number of parameters which they support (and therefore the number of sliders
|
number of parameters which they support (and therefore the number of sliders
|
||||||
which should be displayed), and whether a vertical dividing line should be drawn
|
which should be displayed), and whether a vertical dividing line should be drawn
|
||||||
between transformed and untransformed image regions. As an example, here is the
|
between transformed and untransformed image regions. As an example, here is the
|
||||||
@@ -195,11 +191,8 @@ vertical dividing line, which can be dragged left / right by the user. Finally,
|
|||||||
a \l{video/qmlvideofx/qml/qmlvideofx/ParameterPanel.qml}{ParameterPanel} item
|
a \l{video/qmlvideofx/qml/qmlvideofx/ParameterPanel.qml}{ParameterPanel} item
|
||||||
renders the sliders corresponding to each effect parameter.
|
renders the sliders corresponding to each effect parameter.
|
||||||
|
|
||||||
Here is the source selection menu:
|
Here is the effect selection menu:
|
||||||
\image qmlvideofx-source-menu.png
|
\image qmlvideofx-effects-menu.jpg
|
||||||
|
|
||||||
And here is the effect selection menu:
|
|
||||||
\image qmlvideofx-effects-menu.png
|
|
||||||
|
|
||||||
\section1 Calculating and displaying QML painting rate
|
\section1 Calculating and displaying QML painting rate
|
||||||
|
|
||||||
@@ -219,4 +212,3 @@ object to a JavaScript function, which will eventually call frequencyItem.notify
|
|||||||
\printuntil SLOT(qmlFramePainted()));
|
\printuntil SLOT(qmlFramePainted()));
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtSystemInfo 5.0
|
import QtSystemInfo 5.0
|
||||||
|
// NOTE: The QtSystemInfo module is not yet part of Qt 5
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
ScreenSaver {
|
ScreenSaver {
|
||||||
|
|||||||
30
examples/multimedia/video/qmlvideofx/Info.plist
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UIInterfaceOrientation</key>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>qmlvideofx</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.digia.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>${PRODUCT_NAME}</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${PRODUCT_NAME}</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<manifest package="org.qtproject.example.qmlvideofx" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
|
||||||
|
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name">
|
||||||
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:launchMode="singleTop">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
|
||||||
|
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||||
|
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||||
|
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||||
|
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||||
|
<!-- Deploy Qt libs as part of package -->
|
||||||
|
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||||
|
<!-- Run with local libs -->
|
||||||
|
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
||||||
|
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||||
|
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
||||||
|
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
||||||
|
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
||||||
|
<!-- Messages maps -->
|
||||||
|
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||||
|
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||||
|
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||||
|
<!-- Messages maps -->
|
||||||
|
|
||||||
|
<!-- Splash screen -->
|
||||||
|
<!--
|
||||||
|
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>
|
||||||
|
-->
|
||||||
|
<!-- Splash screen -->
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14"/>
|
||||||
|
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||||
|
|
||||||
|
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||||
|
Remove the comment if you do not require these default permissions. -->
|
||||||
|
<!-- %%INSERT_PERMISSIONS -->
|
||||||
|
|
||||||
|
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
||||||
|
Remove the comment if you do not require these default features. -->
|
||||||
|
<!-- %%INSERT_FEATURES -->
|
||||||
|
|
||||||
|
</manifest>
|
||||||
BIN
examples/multimedia/video/qmlvideofx/images/Dropdown_arrows.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/Slider_bar.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/Slider_handle.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/Triangle_Top.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/Triangle_bottom.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/icon_BackArrow.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/icon_Folder.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/multimedia/video/qmlvideofx/images/icon_Menu.png
Normal file
|
After Width: | Height: | Size: 990 B |
|
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 |
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -48,12 +48,6 @@
|
|||||||
#include "filereader.h"
|
#include "filereader.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
#ifdef SMALL_SCREEN_LAYOUT
|
|
||||||
static const QLatin1String MainQmlFile("main-smallscreen.qml");
|
|
||||||
#else
|
|
||||||
static const QLatin1String MainQmlFile("main-largescreen.qml");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PERFORMANCEMONITOR_SUPPORT
|
#ifdef PERFORMANCEMONITOR_SUPPORT
|
||||||
#include "performancemonitordeclarative.h"
|
#include "performancemonitordeclarative.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -99,7 +93,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QQuickView viewer;
|
QQuickView viewer;
|
||||||
|
|
||||||
viewer.setSource(QLatin1String("qrc:///qml/qmlvideofx/") + MainQmlFile);
|
viewer.setSource(QUrl(QLatin1String("qrc:///qml/qmlvideofx/Main.qml")));
|
||||||
QQuickItem *rootObject = viewer.rootObject();
|
QQuickItem *rootObject = viewer.rootObject();
|
||||||
rootObject->setProperty("fileName", fileName);
|
rootObject->setProperty("fileName", fileName);
|
||||||
viewer.rootObject()->setProperty("volume", volume);
|
viewer.rootObject()->setProperty("volume", volume);
|
||||||
@@ -128,13 +122,10 @@ int main(int argc, char *argv[])
|
|||||||
viewer.setTitle("qmlvideofx");
|
viewer.setTitle("qmlvideofx");
|
||||||
viewer.setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint |
|
viewer.setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint |
|
||||||
Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
|
Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
|
||||||
viewer.setMinimumSize(QSize(600, 400));
|
viewer.setMinimumSize(QSize(1280, 720));
|
||||||
|
viewer.setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
|
|
||||||
#ifdef SMALL_SCREEN_PHYSICAL
|
|
||||||
viewer.showFullScreen();
|
|
||||||
#else
|
|
||||||
viewer.show();
|
viewer.show();
|
||||||
#endif
|
|
||||||
|
|
||||||
// Delay invocation of init until the event loop has started, to work around
|
// Delay invocation of init until the event loop has started, to work around
|
||||||
// a GL context issue on Harmattan: without this, we get the following error
|
// a GL context issue on Harmattan: without this, we get the following error
|
||||||
|
|||||||
@@ -43,29 +43,32 @@ import QtQuick 2.0
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
color: textColor
|
color: "transparent"
|
||||||
radius: 0.25 * height
|
height: itemHeight
|
||||||
|
width: itemWidth
|
||||||
|
|
||||||
property string text
|
property string text
|
||||||
property color bgColor: "white"
|
property color bgColor: "transparent"
|
||||||
property color bgColorSelected: "red"
|
property color bgColorSelected: "#14aaff"
|
||||||
property color textColor: "black"
|
property color textColor: "white"
|
||||||
property alias enabled: mouseArea.enabled
|
property alias enabled: mouseArea.enabled
|
||||||
|
property bool active: true
|
||||||
|
property alias horizontalAlign: text.horizontalAlignment
|
||||||
|
|
||||||
signal clicked
|
signal clicked
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors { fill: parent; margins: 1 }
|
anchors { fill: parent; margins: 1 }
|
||||||
color: mouseArea.pressed ? bgColorSelected : bgColor
|
color: mouseArea.pressed ? bgColorSelected : bgColor
|
||||||
radius: 0.25 * height
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: text
|
id: text
|
||||||
anchors.centerIn: parent
|
clip: true
|
||||||
text: root.text
|
text: root.text
|
||||||
font.pixelSize: 0.5 * parent.height
|
anchors { fill: parent; margins: scaledMargin }
|
||||||
color: mouseArea.pressed ? bgColor : textColor
|
font.pixelSize: fontSize
|
||||||
horizontalAlignment: Text.AlignHCenter
|
color: textColor
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +78,7 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
root.clicked()
|
root.clicked()
|
||||||
}
|
}
|
||||||
|
enabled: active
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,11 +39,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
color: "black"
|
|
||||||
property alias effect: effectLoader.item
|
property alias effect: effectLoader.item
|
||||||
property alias gripSize: divider.gripSize
|
property alias gripSize: divider.gripSize
|
||||||
property string effectSource
|
property string effectSource
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -39,13 +39,14 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
import QtMultimedia 5.0
|
import QtMultimedia 5.0
|
||||||
|
|
||||||
VideoOutput {
|
VideoOutput {
|
||||||
source: mediaPlayer
|
source: mediaPlayer
|
||||||
property alias mediaSource: mediaPlayer.source
|
property alias mediaSource: mediaPlayer.source
|
||||||
property alias volume: mediaPlayer.volume
|
property alias volume: mediaPlayer.volume
|
||||||
|
property bool isRunning: true
|
||||||
|
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: mediaPlayer
|
id: mediaPlayer
|
||||||
@@ -55,5 +56,21 @@ VideoOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function play() { mediaPlayer.play() }
|
function play() { mediaPlayer.play() }
|
||||||
|
function pause() { mediaPlayer.pause() }
|
||||||
function stop() { mediaPlayer.stop() }
|
function stop() { mediaPlayer.stop() }
|
||||||
|
|
||||||
|
function toggleplay() {
|
||||||
|
if (isRunning) {
|
||||||
|
pause()
|
||||||
|
isRunning = false
|
||||||
|
} else {
|
||||||
|
play()
|
||||||
|
isRunning = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: toggleplay()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -39,39 +39,56 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
// Based on http://rastergrid.com/blog/downloads/frei-chen-edge-detector/
|
import QtQuick 2.0
|
||||||
|
|
||||||
#version 130
|
Rectangle {
|
||||||
uniform sampler2D source;
|
id: root
|
||||||
uniform float dividerValue;
|
color: "transparent"
|
||||||
uniform float weight;
|
radius: 5
|
||||||
mat3 G[2] = mat3[](
|
property alias value: grip.value
|
||||||
mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ),
|
property color gripColor: "transparent"
|
||||||
mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 )
|
property real gripSize: 20
|
||||||
);
|
property real gripTolerance: 3.0
|
||||||
uniform lowp float qt_Opacity;
|
property real increment: 0.1
|
||||||
in vec2 qt_TexCoord0;
|
property bool enabled: true
|
||||||
out vec4 FragmentColor;
|
property string imageSource: "qrc:/images/Triangle_Top.png"
|
||||||
void main() {
|
|
||||||
vec2 uv = qt_TexCoord0.xy;
|
Rectangle {
|
||||||
vec4 c = vec4(0.0);
|
id: grip
|
||||||
if (uv.x < dividerValue) {
|
property real value: 0.5
|
||||||
mat3 intensity;
|
x: (value * parent.width) - width/2
|
||||||
float conv[2];
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
vec3 sample;
|
width: root.gripTolerance * root.gripSize
|
||||||
for (int i=0; i<3; ++i) {
|
height: width
|
||||||
for (int j=0; j<3; ++j) {
|
radius: width/2
|
||||||
sample = texelFetch(source, ivec2(gl_FragCoord) + ivec2(i-1, j-1), 0).rgb;
|
color: "transparent"
|
||||||
intensity[i][j] = length(sample) * weight;
|
|
||||||
|
Image {
|
||||||
|
id: sliderhandleimage
|
||||||
|
source: imageSource
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
enabled: root.enabled
|
||||||
|
anchors.fill: parent
|
||||||
|
drag {
|
||||||
|
target: grip
|
||||||
|
axis: Drag.XAxis
|
||||||
|
minimumX: -parent.width/2
|
||||||
|
maximumX: root.width - parent.width/2
|
||||||
|
}
|
||||||
|
onPositionChanged: {
|
||||||
|
if (drag.active)
|
||||||
|
updatePosition()
|
||||||
|
}
|
||||||
|
onReleased: {
|
||||||
|
updatePosition()
|
||||||
|
}
|
||||||
|
function updatePosition() {
|
||||||
|
value = (grip.x + grip.width/2) / grip.parent.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i=0; i<2; ++i) {
|
|
||||||
float dp3 = dot(G[i][0], intensity[0]) + dot(G[i][1], intensity[1]) + dot(G[i][2], intensity[2]);
|
|
||||||
conv[i] = dp3 * dp3;
|
|
||||||
}
|
|
||||||
c = vec4(0.5 * sqrt(conv[0]*conv[0] + conv[1]*conv[1]));
|
|
||||||
} else {
|
|
||||||
c = texture2D(source, qt_TexCoord0);
|
|
||||||
}
|
}
|
||||||
FragmentColor = qt_Opacity * c;
|
|
||||||
}
|
}
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtMobility.systeminfo 1.1
|
import QtMobility.systeminfo 1.1
|
||||||
|
// NOTE: The QtSystemInfo module is not yet part of Qt 5
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
ScreenSaver {
|
ScreenSaver {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
@@ -53,21 +53,34 @@ Rectangle {
|
|||||||
id: line
|
id: line
|
||||||
anchors { top: parent.top; bottom: parent.bottom }
|
anchors { top: parent.top; bottom: parent.bottom }
|
||||||
x: parent.value * parent.width - (width / 2)
|
x: parent.value * parent.width - (width / 2)
|
||||||
width: 2
|
width: 4
|
||||||
color: "red"
|
color: "#14aaff"
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider {
|
// topgrip
|
||||||
|
Curtain {
|
||||||
id: slider
|
id: slider
|
||||||
increment: 0.0
|
increment: 0.0
|
||||||
lineColor: "transparent"
|
|
||||||
fillColor: "transparent"
|
|
||||||
gripColor: "red"
|
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: gripSize / 2
|
topMargin: (gripSize / 2) + 5
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
onValueChanged: slider2.value = slider.value
|
||||||
|
}
|
||||||
|
|
||||||
|
// bottomgrip
|
||||||
|
Curtain {
|
||||||
|
id: slider2
|
||||||
|
increment: 0.0
|
||||||
|
anchors {
|
||||||
|
bottom: parent.bottom
|
||||||
|
bottomMargin: (gripSize / 2) + 5
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
imageSource: "qrc:/images/Triangle_bottom.png"
|
||||||
|
onValueChanged: slider.value = slider2.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "grid spacing"
|
name: "Grid Spacing"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "threshold"
|
name: "Threshold"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Item {
|
|||||||
property real dividerValue: 0.5
|
property real dividerValue: 0.5
|
||||||
property ListModel parameters: ListModel {
|
property ListModel parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "radius"
|
name: "Radius"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "hue"
|
name: "Hue"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "width"
|
name: "Width"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ Effect {
|
|||||||
divider: false
|
divider: false
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "radius"
|
name: "Radius"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "diffraction"
|
name: "Diffraction"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Effect {
|
|||||||
divider: false
|
divider: false
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "extent"
|
name: "Extent"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "granularity"
|
name: "Granularity"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "gamma"
|
name: "Gamma"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "amplitude"
|
name: "Amplitude"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "frequency"
|
name: "Frequency"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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: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
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: sources
|
||||||
|
ListElement { name: "No effect"; source: "EffectPassThrough.qml" }
|
||||||
|
ListElement { name: "Billboard"; source: "EffectBillboard.qml" }
|
||||||
|
ListElement { name: "Black & white"; source: "EffectBlackAndWhite.qml" }
|
||||||
|
ListElement { name: "Blur"; source: "EffectGaussianBlur.qml" }
|
||||||
|
ListElement { name: "Edge detection"; source: "EffectSobelEdgeDetection1.qml" }
|
||||||
|
ListElement { name: "Emboss"; source: "EffectEmboss.qml" }
|
||||||
|
ListElement { name: "Glow"; source: "EffectGlow.qml" }
|
||||||
|
ListElement { name: "Isolate"; source: "EffectIsolate.qml" }
|
||||||
|
//ListElement { name: "Magnify"; source: "EffectMagnify.qml" }
|
||||||
|
ListElement { name: "Page curl"; source: "EffectPageCurl.qml" }
|
||||||
|
ListElement { name: "Pixelate"; source: "EffectPixelate.qml" }
|
||||||
|
ListElement { name: "Posterize"; source: "EffectPosterize.qml" }
|
||||||
|
ListElement { name: "Ripple"; source: "EffectRipple.qml" }
|
||||||
|
ListElement { name: "Sepia"; source: "EffectSepia.qml" }
|
||||||
|
ListElement { name: "Sharpen"; source: "EffectSharpen.qml" }
|
||||||
|
ListElement { name: "Shockwave"; source: "EffectShockwave.qml" }
|
||||||
|
ListElement { name: "Tilt shift"; source: "EffectTiltShift.qml" }
|
||||||
|
ListElement { name: "Toon"; source: "EffectToon.qml" }
|
||||||
|
ListElement { name: "Warhol"; source: "EffectWarhol.qml" }
|
||||||
|
ListElement { name: "Wobble"; source: "EffectWobble.qml" }
|
||||||
|
ListElement { name: "Vignette"; source: "EffectVignette.qml" }
|
||||||
|
}
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 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 effectSource: ""
|
|
||||||
|
|
||||||
signal clicked
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
property Item selectedItem
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel {
|
|
||||||
id: sources
|
|
||||||
ListElement { name: "No effect"; source: "EffectPassThrough.qml" }
|
|
||||||
ListElement { name: "Billboard"; source: "EffectBillboard.qml" }
|
|
||||||
ListElement { name: "Black & white"; source: "EffectBlackAndWhite.qml" }
|
|
||||||
ListElement { name: "Blur"; source: "EffectGaussianBlur.qml" }
|
|
||||||
ListElement { name: "Edge detection"; source: "EffectSobelEdgeDetection1.qml" }
|
|
||||||
//ListElement { name: "Edge detection (Sobel, #2)"; source: "EffectSobelEdgeDetection2.qml" }
|
|
||||||
ListElement { name: "Emboss"; source: "EffectEmboss.qml" }
|
|
||||||
ListElement { name: "Glow"; source: "EffectGlow.qml" }
|
|
||||||
ListElement { name: "Isolate"; source: "EffectIsolate.qml" }
|
|
||||||
ListElement { name: "Magnify"; source: "EffectMagnify.qml" }
|
|
||||||
ListElement { name: "Page curl"; source: "EffectPageCurl.qml" }
|
|
||||||
ListElement { name: "Pixelate"; source: "EffectPixelate.qml" }
|
|
||||||
ListElement { name: "Posterize"; source: "EffectPosterize.qml" }
|
|
||||||
ListElement { name: "Ripple"; source: "EffectRipple.qml" }
|
|
||||||
ListElement { name: "Sepia"; source: "EffectSepia.qml" }
|
|
||||||
ListElement { name: "Sharpen"; source: "EffectSharpen.qml" }
|
|
||||||
ListElement { name: "Shockwave"; source: "EffectShockwave.qml" }
|
|
||||||
ListElement { name: "Tilt shift"; source: "EffectTiltShift.qml" }
|
|
||||||
ListElement { name: "Toon"; source: "EffectToon.qml" }
|
|
||||||
ListElement { name: "Warhol"; source: "EffectWarhol.qml" }
|
|
||||||
ListElement { name: "Wobble"; source: "EffectWobble.qml" }
|
|
||||||
ListElement { name: "Vignette"; source: "EffectVignette.qml" }
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: sourceDelegate
|
|
||||||
Item {
|
|
||||||
id: sourceDelegateItem
|
|
||||||
width: root.width
|
|
||||||
height: itemHeight
|
|
||||||
|
|
||||||
Button {
|
|
||||||
id: sourceSelectorItem
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: 0.9 * parent.width
|
|
||||||
height: 0.8 * itemHeight
|
|
||||||
text: name
|
|
||||||
onClicked: {
|
|
||||||
if (d.selectedItem)
|
|
||||||
d.selectedItem.state = "baseState"
|
|
||||||
d.selectedItem = sourceDelegateItem
|
|
||||||
d.selectedItem.state = "selected"
|
|
||||||
effectSource = source
|
|
||||||
root.clicked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "selected"
|
|
||||||
PropertyChanges {
|
|
||||||
target: sourceSelectorItem
|
|
||||||
bgColor: "#ff8888"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (name == "No effect") {
|
|
||||||
state = "selected"
|
|
||||||
d.selectedItem = sourceDelegateItem
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "*"
|
|
||||||
to: "*"
|
|
||||||
ColorAnimation {
|
|
||||||
properties: "color"
|
|
||||||
easing.type: Easing.OutQuart
|
|
||||||
duration: 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Flickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
contentHeight: (itemHeight * sources.count) + layout.anchors.topMargin + layout.spacing
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: layout
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
topMargin: 10
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: sources
|
|
||||||
delegate: sourceDelegate
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "sharpness"
|
name: "Sharpness"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Effect {
|
|||||||
id: root
|
id: root
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "amplitude"
|
name: "Amplitude"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "threshold"
|
name: "Threshold"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "threshold"
|
name: "Threshold"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import QtQuick 2.0
|
|||||||
Effect {
|
Effect {
|
||||||
parameters: ListModel {
|
parameters: ListModel {
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "amplitude"
|
name: "Amplitude"
|
||||||
value: 0.5
|
value: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -39,12 +39,13 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
import Qt.labs.folderlistmodel 2.0
|
import Qt.labs.folderlistmodel 2.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: fileBrowser
|
id: fileBrowser
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
z: 4
|
||||||
|
|
||||||
property string folder
|
property string folder
|
||||||
property bool shown: loader.sourceComponent
|
property bool shown: loader.sourceComponent
|
||||||
@@ -75,12 +76,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
|
||||||
@@ -112,7 +113,7 @@ Rectangle {
|
|||||||
fileBrowser.selectFile(path)
|
fileBrowser.selectFile(path)
|
||||||
}
|
}
|
||||||
width: root.width
|
width: root.width
|
||||||
height: 52
|
height: itemHeight
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -126,10 +127,12 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 48; height: 48
|
width: itemHeight; height: itemHeight
|
||||||
Image {
|
Image {
|
||||||
source: "qrc:/images/folder.png"
|
source: "qrc:/images/icon_Folder.png"
|
||||||
anchors.centerIn: parent
|
fillMode: Image.PreserveAspectFit
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: scaledMargin
|
||||||
visible: folders.isFolder(index)
|
visible: folders.isFolder(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,8 +141,8 @@ Rectangle {
|
|||||||
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 + scaledMargin
|
||||||
font.pixelSize: 32
|
font.pixelSize: fontSize
|
||||||
color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor
|
color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
@@ -262,56 +265,45 @@ Rectangle {
|
|||||||
Keys.onPressed: root.keyPressed(event.key)
|
Keys.onPressed: root.keyPressed(event.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Button {
|
||||||
id: cancelButton
|
id: cancelButton
|
||||||
width: 100
|
width: itemWidth
|
||||||
height: titleBar.height - 7
|
height: itemHeight
|
||||||
color: "black"
|
color: "#353535"
|
||||||
anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
|
anchors { bottom: parent.bottom; right: parent.right; margins: 5 * scaledMargin }
|
||||||
|
text: "Cancel"
|
||||||
Text {
|
horizontalAlign: Text.AlignHCenter
|
||||||
anchors { fill: parent; margins: 4 }
|
onClicked: fileBrowser.selectFile("")
|
||||||
text: "Cancel"
|
|
||||||
color: "white"
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
font.pixelSize: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: fileBrowser.selectFile("")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
// titlebar
|
||||||
source: "qrc:/images/titlebar.sci";
|
Rectangle {
|
||||||
|
color: "black"
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
height: 52
|
height: itemHeight
|
||||||
y: -7
|
|
||||||
id: titleBar
|
id: titleBar
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: upButton
|
id: upButton
|
||||||
width: 48
|
width: titleBar.height
|
||||||
height: titleBar.height - 7
|
height: titleBar.height
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
Image { anchors.centerIn: parent; source: "qrc:/images/up.png" }
|
anchors.left: parent.left
|
||||||
MouseArea { id: upRegion; anchors.centerIn: parent
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: 56
|
anchors.margins: scaledMargin
|
||||||
height: 56
|
|
||||||
onClicked: up()
|
Image { anchors.fill: parent; anchors.margins: scaledMargin; source: "qrc:/images/icon_BackArrow.png" }
|
||||||
}
|
MouseArea { id: upRegion; anchors.fill: parent; onClicked: up() }
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "pressed"
|
name: "pressed"
|
||||||
@@ -321,23 +313,23 @@ Rectangle {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: "gray"
|
|
||||||
x: 48
|
|
||||||
width: 1
|
|
||||||
height: 44
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
|
anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
|
||||||
anchors.leftMargin: 4; anchors.rightMargin: 4
|
anchors.leftMargin: 10; anchors.rightMargin: 4
|
||||||
text: folders.folder
|
text: folders.folder
|
||||||
color: "white"
|
color: "white"
|
||||||
elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
|
elide: Text.ElideLeft; horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter
|
||||||
font.pixelSize: 32
|
font.pixelSize: fontSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: "#353535"
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
anchors.top: titleBar.bottom
|
||||||
|
}
|
||||||
|
|
||||||
function down(path) {
|
function down(path) {
|
||||||
if (folders == folders1) {
|
if (folders == folders1) {
|
||||||
view = view2
|
view = view2
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -39,56 +39,115 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
color: "white"
|
color: "#151515"
|
||||||
property int buttonHeight: 35
|
signal openCamera
|
||||||
property int topMargin: 0
|
|
||||||
|
|
||||||
signal openImage
|
signal openImage
|
||||||
signal openVideo
|
signal openVideo
|
||||||
signal openCamera
|
|
||||||
signal close
|
signal close
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors {
|
|
||||||
top: parent.top;
|
|
||||||
topMargin: root.topMargin
|
|
||||||
bottom: parent.bottom;
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
width: 0.9 * parent.width
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Column {
|
Rectangle {
|
||||||
|
id: menuField
|
||||||
|
height: itemHeight
|
||||||
|
width: itemHeight
|
||||||
|
color: "transparent"
|
||||||
|
anchors.right: parent.right
|
||||||
|
Image {
|
||||||
|
id: menu
|
||||||
|
source: "qrc:///images/icon_Menu.png"
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
top: parent.top
|
||||||
|
margins: scaledMargin
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 5
|
onClicked: fileOpen.state == "expanded" ? fileOpen.state = "collapsed" : fileOpen.state = "expanded"
|
||||||
Button {
|
}
|
||||||
text: "Open image"
|
}
|
||||||
height: buttonHeight
|
|
||||||
width: parent.width
|
Column {
|
||||||
onClicked: root.openImage()
|
anchors {
|
||||||
|
top: menuField.bottom
|
||||||
|
right: parent.right
|
||||||
|
left: parent.left
|
||||||
|
bottom: parent.bottom
|
||||||
|
topMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
spacing: 10
|
||||||
|
visible: fileOpen.state == "expanded"
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 0.9 * parent.width
|
||||||
|
height: 1
|
||||||
|
color: "#353535"
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
text: "Start camera"
|
||||||
|
height: itemHeight
|
||||||
|
width: parent.width
|
||||||
|
onClicked: {
|
||||||
|
fileOpen.state = "collapsed"
|
||||||
|
root.openCamera()
|
||||||
}
|
}
|
||||||
Button {
|
}
|
||||||
text: "Open video"
|
Rectangle {
|
||||||
height: buttonHeight
|
width: 0.9 * parent.width
|
||||||
width: parent.width
|
height: 1
|
||||||
onClicked: root.openVideo()
|
color: "#353535"
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
text: "Open image"
|
||||||
|
height: itemHeight
|
||||||
|
width: parent.width
|
||||||
|
onClicked: {
|
||||||
|
fileOpen.state = "collapsed"
|
||||||
|
root.openImage()
|
||||||
}
|
}
|
||||||
Button {
|
}
|
||||||
text: "Start camera"
|
Rectangle {
|
||||||
height: buttonHeight
|
width: 0.9 * parent.width
|
||||||
width: parent.width
|
height: 1
|
||||||
onClicked: root.openCamera()
|
color: "#353535"
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
text: "Open video"
|
||||||
|
height: itemHeight
|
||||||
|
width: parent.width
|
||||||
|
onClicked: {
|
||||||
|
fileOpen.state = "collapsed"
|
||||||
|
root.openVideo()
|
||||||
}
|
}
|
||||||
Button {
|
}
|
||||||
text: "Reset"
|
Rectangle {
|
||||||
height: buttonHeight
|
width: 0.9 * parent.width
|
||||||
width: parent.width
|
height: 1
|
||||||
onClicked: root.close()
|
color: "#353535"
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
text: "Reset"
|
||||||
|
height: itemHeight
|
||||||
|
width: parent.width
|
||||||
|
onClicked: {
|
||||||
|
fileOpen.state = "collapsed"
|
||||||
|
root.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Rectangle {
|
||||||
|
width: 0.9 * parent.width
|
||||||
|
height: 1
|
||||||
|
color: "#353535"
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
293
examples/multimedia/video/qmlvideofx/qml/qmlvideofx/Main.qml
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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: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.1
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
color: "black"
|
||||||
|
property string fileName
|
||||||
|
property alias volume: content.volume
|
||||||
|
property bool perfMonitorsLogging: false
|
||||||
|
property bool perfMonitorsVisible: false
|
||||||
|
property int pixDens: Math.ceil(Screen.pixelDensity)
|
||||||
|
property int itemWidth: 25 * pixDens
|
||||||
|
property int itemHeight: 10 * pixDens
|
||||||
|
property int windowWidth: Screen.desktopAvailableWidth
|
||||||
|
property int windowHeight: Screen.desktopAvailableHeight
|
||||||
|
property int scaledMargin: 2 * pixDens
|
||||||
|
property int fontSize: 5 * pixDens
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
property real gripSize: 20
|
||||||
|
}
|
||||||
|
|
||||||
|
Content {
|
||||||
|
id: content
|
||||||
|
color: "transparent"
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parameterPanel.top
|
||||||
|
margins: scaledMargin
|
||||||
|
leftMargin: scaledMargin + itemHeight
|
||||||
|
}
|
||||||
|
gripSize: d.gripSize
|
||||||
|
}
|
||||||
|
|
||||||
|
ParameterPanel {
|
||||||
|
id: parameterPanel
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: effectName.left
|
||||||
|
bottom: parent.bottom
|
||||||
|
margins: scaledMargin
|
||||||
|
leftMargin: scaledMargin + itemHeight
|
||||||
|
}
|
||||||
|
gripSize: d.gripSize
|
||||||
|
height: root.itemHeight * 2.5
|
||||||
|
width: root.itemWidth * 3
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: effectName
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
bottom: perfHolder.top
|
||||||
|
margins: scaledMargin
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "No effect"
|
||||||
|
width: itemWidth * 2
|
||||||
|
height: itemHeight
|
||||||
|
onClicked: {
|
||||||
|
effectName.visible = false
|
||||||
|
listview.visible = true
|
||||||
|
lvbg.visible = true
|
||||||
|
}
|
||||||
|
color: "#303030"
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: lvbg
|
||||||
|
width: itemWidth * 2
|
||||||
|
color: "black"
|
||||||
|
opacity: 0.8
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
bottom: perfHolder.top
|
||||||
|
top: parent.top
|
||||||
|
margins: scaledMargin
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: listview
|
||||||
|
width: itemWidth * 2
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
model: EffectSelectionList {}
|
||||||
|
delegate: effectDelegate
|
||||||
|
|
||||||
|
clip: true
|
||||||
|
focus: true
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: effectDelegate
|
||||||
|
Button {
|
||||||
|
text: name
|
||||||
|
width: itemWidth * 2
|
||||||
|
onClicked: {
|
||||||
|
content.effectSource = source
|
||||||
|
listview.visible = false
|
||||||
|
lvbg.visible = false
|
||||||
|
effectName.text = name
|
||||||
|
effectName.visible = true
|
||||||
|
parameterPanel.model = content.effect.parameters
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: perfHolder
|
||||||
|
color: "transparent"
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
margins: scaledMargin
|
||||||
|
}
|
||||||
|
height: root.itemHeight * 1.5
|
||||||
|
width: root.itemWidth
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: performanceLoader
|
||||||
|
function init() {
|
||||||
|
console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
|
||||||
|
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
|
||||||
|
source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
|
||||||
|
}
|
||||||
|
onLoaded: {
|
||||||
|
item.parent = perfHolder
|
||||||
|
item.anchors.top = perfHolder.top
|
||||||
|
item.anchors.bottom = perfHolder.bottom
|
||||||
|
item.anchors.left = perfHolder.left
|
||||||
|
item.anchors.right = perfHolder.right
|
||||||
|
item.logging = root.perfMonitorsLogging
|
||||||
|
item.displayed = root.perfMonitorsVisible
|
||||||
|
item.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FileOpen {
|
||||||
|
id: fileOpen
|
||||||
|
state: "collapsed"
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
|
margins: scaledMargin
|
||||||
|
}
|
||||||
|
width: itemHeight + scaledMargin
|
||||||
|
z: 2
|
||||||
|
opacity: 0.9
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "expanded"
|
||||||
|
PropertyChanges {
|
||||||
|
target: fileOpen
|
||||||
|
width: itemWidth * 1.5
|
||||||
|
opacity: 0.8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "collapsed"
|
||||||
|
PropertyChanges {
|
||||||
|
target: fileOpen
|
||||||
|
width: itemHeight + scaledMargin
|
||||||
|
opacity: 0.9
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
NumberAnimation { target: fileOpen; property: "width"; duration: 100 }
|
||||||
|
NumberAnimation { target: fileOpen; property: "opacity"; duration: 100 }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
FileBrowser {
|
||||||
|
id: imageFileBrowser
|
||||||
|
anchors.fill: root
|
||||||
|
Component.onCompleted: fileSelected.connect(content.openImage)
|
||||||
|
}
|
||||||
|
|
||||||
|
FileBrowser {
|
||||||
|
id: videoFileBrowser
|
||||||
|
anchors.fill: root
|
||||||
|
Component.onCompleted: fileSelected.connect(content.openVideo)
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
fileOpen.openImage.connect(openImage)
|
||||||
|
fileOpen.openVideo.connect(openVideo)
|
||||||
|
fileOpen.openCamera.connect(openCamera)
|
||||||
|
fileOpen.close.connect(close)
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
if (Qt.platform.os === "linux" || Qt.platform.os === "windows" || Qt.platform.os === "osx" || Qt.platform.os === "unix") {
|
||||||
|
if (Screen.desktopAvailableWidth > 1280) {
|
||||||
|
windowWidth = 1280
|
||||||
|
}
|
||||||
|
if (Screen.desktopAvailableHeight > 720) {
|
||||||
|
windowHeight = 720
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
height = windowHeight
|
||||||
|
width = windowWidth
|
||||||
|
|
||||||
|
console.log("[qmlvideofx] root.init")
|
||||||
|
console.log("Height: ", Screen.desktopAvailableHeight)
|
||||||
|
console.log("Width: ", Screen.desktopAvailableWidth)
|
||||||
|
console.log("Pixels per mm: ", Math.ceil(Screen.pixelDensity))
|
||||||
|
console.log("Orientation: ", Screen.orientation)
|
||||||
|
imageFileBrowser.folder = imagePath
|
||||||
|
videoFileBrowser.folder = videoPath
|
||||||
|
content.init()
|
||||||
|
performanceLoader.init()
|
||||||
|
if (fileName != "")
|
||||||
|
content.openVideo(fileName)
|
||||||
|
}
|
||||||
|
|
||||||
|
function qmlFramePainted() {
|
||||||
|
if (performanceLoader.item)
|
||||||
|
performanceLoader.item.qmlFramePainted()
|
||||||
|
}
|
||||||
|
|
||||||
|
function openImage() {
|
||||||
|
imageFileBrowser.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
function openVideo() {
|
||||||
|
videoFileBrowser.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
function openCamera() {
|
||||||
|
content.openCamera()
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
content.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,17 +47,12 @@ Rectangle {
|
|||||||
height: view.model.count * sliderHeight
|
height: view.model.count * sliderHeight
|
||||||
property color lineColor: "black"
|
property color lineColor: "black"
|
||||||
property real gripSize: 25
|
property real gripSize: 25
|
||||||
property real spacing: 10
|
property real spacing: 20
|
||||||
property real sliderHeight: 40
|
property real sliderHeight: 60
|
||||||
|
|
||||||
property ListModel model: ListModel { }
|
property ListModel model: ListModel { }
|
||||||
|
|
||||||
Rectangle {
|
anchors.topMargin: 10
|
||||||
anchors.fill: parent
|
|
||||||
color: "black"
|
|
||||||
opacity: 0.5
|
|
||||||
radius: 10
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: editDelegate
|
id: editDelegate
|
||||||
@@ -77,10 +72,10 @@ Rectangle {
|
|||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
font.pixelSize: 0.5 * parent.height
|
font.pixelSize: fontSize
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
width: 150
|
width: 8 * fontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider {
|
Slider {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Mobility Components.
|
** This file is part of the Qt Mobility Components.
|
||||||
@@ -39,91 +39,84 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
radius: 5
|
radius: 5
|
||||||
property alias value: grip.value
|
property alias value: grip.value
|
||||||
property color fillColor: "white"
|
property color fillColor: "#14aaff"
|
||||||
property color lineColor: "black"
|
property real gripSize: 40
|
||||||
property color gripColor: "white"
|
|
||||||
property real gripSize: 20
|
|
||||||
property real gripTolerance: 3.0
|
property real gripTolerance: 3.0
|
||||||
property real increment: 0.1
|
property real increment: 0.1
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter }
|
id: slider
|
||||||
height: 3
|
anchors {
|
||||||
color: displayedColor(root.lineColor)
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
Rectangle {
|
verticalCenter: parent.verticalCenter
|
||||||
anchors { fill: parent; margins: 1 }
|
|
||||||
color: root.fillColor
|
|
||||||
}
|
}
|
||||||
}
|
height: 10
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
MouseArea {
|
BorderImage {
|
||||||
anchors.fill: parent
|
id: sliderbarimage
|
||||||
enabled: root.enabled
|
source: "qrc:/images/Slider_bar.png"
|
||||||
onClicked: {
|
anchors { fill: parent; margins: 1 }
|
||||||
if (parent.width) {
|
border.right: 5
|
||||||
var newValue = mouse.x / parent.width
|
border.left: 5
|
||||||
if (Math.abs(newValue - parent.value) > parent.increment) {
|
}
|
||||||
if (newValue > parent.value)
|
Rectangle {
|
||||||
parent.value = Math.min(1.0, parent.value + parent.increment)
|
height: parent.height -2
|
||||||
else
|
anchors.left: parent.left
|
||||||
parent.value = Math.max(0.0, parent.value - parent.increment)
|
anchors.right: grip.horizontalCenter
|
||||||
|
color: root.fillColor
|
||||||
|
radius: 3
|
||||||
|
border.width: 1
|
||||||
|
border.color: Qt.darker(color, 1.3)
|
||||||
|
opacity: 0.8
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
id: grip
|
||||||
|
property real value: 0.5
|
||||||
|
x: (value * parent.width) - width/2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: root.gripTolerance * root.gripSize
|
||||||
|
height: width
|
||||||
|
radius: width/2
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: sliderhandleimage
|
||||||
|
source: "qrc:/images/Slider_handle.png"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
enabled: root.enabled
|
||||||
|
anchors.fill: parent
|
||||||
|
drag {
|
||||||
|
target: grip
|
||||||
|
axis: Drag.XAxis
|
||||||
|
minimumX: -parent.width/2
|
||||||
|
maximumX: root.width - parent.width/2
|
||||||
|
}
|
||||||
|
onPositionChanged: {
|
||||||
|
if (drag.active)
|
||||||
|
updatePosition()
|
||||||
|
}
|
||||||
|
onReleased: {
|
||||||
|
updatePosition()
|
||||||
|
}
|
||||||
|
function updatePosition() {
|
||||||
|
value = (grip.x + grip.width/2) / slider.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: grip
|
|
||||||
property real value: 0.5
|
|
||||||
x: (value * parent.width) - width/2
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: root.gripTolerance * root.gripSize
|
|
||||||
height: width
|
|
||||||
radius: width/2
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
enabled: root.enabled
|
|
||||||
anchors.fill: parent
|
|
||||||
drag {
|
|
||||||
target: grip
|
|
||||||
axis: Drag.XAxis
|
|
||||||
minimumX: -parent.width/2
|
|
||||||
maximumX: root.width - parent.width/2
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
if (drag.active)
|
|
||||||
updatePosition()
|
|
||||||
}
|
|
||||||
onReleased: {
|
|
||||||
updatePosition()
|
|
||||||
}
|
|
||||||
function updatePosition() {
|
|
||||||
value = (grip.x + grip.width/2) / grip.parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: root.gripSize
|
|
||||||
height: width
|
|
||||||
radius: width/2
|
|
||||||
color: root.gripColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayedColor(c) {
|
|
||||||
var tint = Qt.rgba(c.r, c.g, c.b, 0.25)
|
|
||||||
return enabled ? c : Qt.tint(c, tint)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,186 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 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: 900
|
|
||||||
height: 600
|
|
||||||
color: "grey"
|
|
||||||
property string fileName
|
|
||||||
property alias volume: content.volume
|
|
||||||
property bool perfMonitorsLogging: false
|
|
||||||
property bool perfMonitorsVisible: false
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
property real gripSize: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: inner
|
|
||||||
anchors.fill: parent
|
|
||||||
color: "grey"
|
|
||||||
|
|
||||||
Content {
|
|
||||||
id: content
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: effectSelectionPanel.left
|
|
||||||
margins: 5
|
|
||||||
}
|
|
||||||
gripSize: d.gripSize
|
|
||||||
width: 600
|
|
||||||
height: 600
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: performanceLoader
|
|
||||||
function init() {
|
|
||||||
console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
|
|
||||||
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
|
|
||||||
source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
|
|
||||||
}
|
|
||||||
onLoaded: {
|
|
||||||
item.parent = content
|
|
||||||
item.anchors.top = content.top
|
|
||||||
item.anchors.left = content.left
|
|
||||||
item.anchors.right = content.right
|
|
||||||
item.logging = root.perfMonitorsLogging
|
|
||||||
item.displayed = root.perfMonitorsVisible
|
|
||||||
item.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ParameterPanel {
|
|
||||||
id: parameterPanel
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
right: effectSelectionPanel.left
|
|
||||||
margins: 20
|
|
||||||
}
|
|
||||||
gripSize: d.gripSize
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectSelectionPanel {
|
|
||||||
id: effectSelectionPanel
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: fileOpen.top
|
|
||||||
right: parent.right
|
|
||||||
margins: 5
|
|
||||||
}
|
|
||||||
width: 300
|
|
||||||
itemHeight: 40
|
|
||||||
onEffectSourceChanged: {
|
|
||||||
content.effectSource = effectSource
|
|
||||||
parameterPanel.model = content.effect.parameters
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileOpen {
|
|
||||||
id: fileOpen
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
margins: 5
|
|
||||||
}
|
|
||||||
width: effectSelectionPanel.width
|
|
||||||
height: 165
|
|
||||||
buttonHeight: 32
|
|
||||||
topMargin: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowser {
|
|
||||||
id: imageFileBrowser
|
|
||||||
anchors.fill: root
|
|
||||||
Component.onCompleted: fileSelected.connect(content.openImage)
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowser {
|
|
||||||
id: videoFileBrowser
|
|
||||||
anchors.fill: root
|
|
||||||
Component.onCompleted: fileSelected.connect(content.openVideo)
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
fileOpen.openImage.connect(openImage)
|
|
||||||
fileOpen.openVideo.connect(openVideo)
|
|
||||||
fileOpen.openCamera.connect(openCamera)
|
|
||||||
fileOpen.close.connect(close)
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
console.log("[qmlvideofx] main.init")
|
|
||||||
imageFileBrowser.folder = imagePath
|
|
||||||
videoFileBrowser.folder = videoPath
|
|
||||||
content.init()
|
|
||||||
performanceLoader.init()
|
|
||||||
if (fileName != "")
|
|
||||||
content.openVideo(fileName)
|
|
||||||
}
|
|
||||||
|
|
||||||
function qmlFramePainted() {
|
|
||||||
if (performanceLoader.item)
|
|
||||||
performanceLoader.item.qmlFramePainted()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openImage() {
|
|
||||||
imageFileBrowser.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openVideo() {
|
|
||||||
videoFileBrowser.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openCamera() {
|
|
||||||
content.openCamera()
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
content.openImage("qrc:/images/qt-logo.png")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,408 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 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: "grey"
|
|
||||||
property string fileName
|
|
||||||
property alias volume: content.volume
|
|
||||||
property bool perfMonitorsLogging: false
|
|
||||||
property bool perfMonitorsVisible: false
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
property bool dialogShown: (fileOpenContainer.state == "shown" ||
|
|
||||||
effectSelectionPanel.state == "shown" ||
|
|
||||||
videoFileBrowser.shown ||
|
|
||||||
imageFileBrowser.shown)
|
|
||||||
property real gripSize: 40
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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: d
|
|
||||||
onDialogShownChanged:
|
|
||||||
if (performanceLoader.item)
|
|
||||||
performanceLoader.item.enabled = !d.dialogShown
|
|
||||||
ignoreUnknownSignals: true
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
console.log("[qmlvideofx] 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.top = root.top
|
|
||||||
item.anchors.left = root.left
|
|
||||||
item.logging = root.perfMonitorsLogging
|
|
||||||
item.displayed = root.perfMonitorsVisible
|
|
||||||
item.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: inner
|
|
||||||
anchors.fill: parent
|
|
||||||
color: "grey"
|
|
||||||
|
|
||||||
Content {
|
|
||||||
id: content
|
|
||||||
anchors.fill: parent
|
|
||||||
gripSize: d.gripSize
|
|
||||||
onVideoFramePainted: performanceLoader.item.videoFramePainted()
|
|
||||||
}
|
|
||||||
|
|
||||||
ParameterPanel {
|
|
||||||
id: parameterPanel
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
right: parent.right;
|
|
||||||
margins: 10
|
|
||||||
}
|
|
||||||
y: parent.height
|
|
||||||
gripSize: d.gripSize
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "shown"
|
|
||||||
PropertyChanges {
|
|
||||||
target: parameterPanel
|
|
||||||
y: parent.height - (parameterPanel.height + 10)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "*"
|
|
||||||
to: "*"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "y"
|
|
||||||
easing.type: Easing.OutQuart
|
|
||||||
duration: 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
state: (enabled && !d.dialogShown) ? "shown" : "baseState"
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectSelectionPanel {
|
|
||||||
id: effectSelectionPanel
|
|
||||||
anchors {
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parameterPanel.top;
|
|
||||||
margins: 10
|
|
||||||
}
|
|
||||||
x: parent.width
|
|
||||||
width: parent.width - 40
|
|
||||||
opacity: 0.75
|
|
||||||
radius: 20
|
|
||||||
itemHeight: 50
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "shown"
|
|
||||||
PropertyChanges {
|
|
||||||
target: effectSelectionPanel
|
|
||||||
x: 20
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "*"
|
|
||||||
to: "*"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "x"
|
|
||||||
easing.type: Easing.OutQuart
|
|
||||||
duration: 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
onEffectSourceChanged: {
|
|
||||||
content.effectSource = effectSource
|
|
||||||
if (content.effect.parameters.count) {
|
|
||||||
parameterPanel.model = content.effect.parameters
|
|
||||||
parameterPanel.enabled = true
|
|
||||||
} else {
|
|
||||||
parameterPanel.enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: state = "baseState"
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: fileOpenContainer
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parameterPanel.top
|
|
||||||
margins: 10
|
|
||||||
}
|
|
||||||
x: -width
|
|
||||||
width: parent.width - 40
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
FileOpen {
|
|
||||||
id: fileOpen
|
|
||||||
color: "transparent"
|
|
||||||
width: parent.width
|
|
||||||
height: 200
|
|
||||||
opacity: 0.75
|
|
||||||
radius: 20
|
|
||||||
buttonHeight: 40
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
width: parent.width
|
|
||||||
height: 250
|
|
||||||
onClicked: fileOpenContainer.state = "baseState"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "shown"
|
|
||||||
PropertyChanges {
|
|
||||||
target: fileOpenContainer
|
|
||||||
x: 20
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "*"
|
|
||||||
to: "*"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "x"
|
|
||||||
easing.type: Easing.OutQuart
|
|
||||||
duration: 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: splashScreen
|
|
||||||
anchors {
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 300
|
|
||||||
height: 200
|
|
||||||
radius: 0.1 * height
|
|
||||||
color: "white"
|
|
||||||
opacity: 0.9
|
|
||||||
border { color: "black"; width: 2 }
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
margins: 5
|
|
||||||
}
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
font.pixelSize: 24
|
|
||||||
text: "Tap on left side to switch between sources.\n\nTap on right side to switch between effects."
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: parent.state = "hidden"
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "hidden"
|
|
||||||
PropertyChanges {
|
|
||||||
target: splashScreen
|
|
||||||
opacity: 0.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "*"
|
|
||||||
to: "*"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "opacity"
|
|
||||||
easing.type: Easing.OutQuart
|
|
||||||
duration: 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
HintedMouseArea {
|
|
||||||
id: fileOpenMouseArea
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parameterPanel.top;
|
|
||||||
topMargin: 75
|
|
||||||
}
|
|
||||||
width: 100
|
|
||||||
onClicked: {
|
|
||||||
fileOpenMouseArea.hintEnabled = false
|
|
||||||
effectSelectionPanelMouseArea.hintEnabled = false
|
|
||||||
splashScreen.state = "hidden"
|
|
||||||
fileOpenContainer.state = "shown"
|
|
||||||
}
|
|
||||||
enabled: !d.dialogShown
|
|
||||||
}
|
|
||||||
|
|
||||||
HintedMouseArea {
|
|
||||||
id: effectSelectionPanelMouseArea
|
|
||||||
anchors {
|
|
||||||
right: parent.right;
|
|
||||||
top: parent.top;
|
|
||||||
bottom: parameterPanel.top;
|
|
||||||
topMargin: 75
|
|
||||||
}
|
|
||||||
width: 100
|
|
||||||
onClicked: {
|
|
||||||
fileOpenMouseArea.hintEnabled = false
|
|
||||||
effectSelectionPanelMouseArea.hintEnabled = false
|
|
||||||
splashScreen.state = "hidden"
|
|
||||||
effectSelectionPanel.state = "shown"
|
|
||||||
}
|
|
||||||
enabled: !d.dialogShown
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
|
||||||
source: "qrc:/images/close.png"
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
right: parent.right
|
|
||||||
margins: 5
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: Qt.quit()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
fileOpen.openImage.connect(openImage)
|
|
||||||
fileOpen.openVideo.connect(openVideo)
|
|
||||||
fileOpen.openCamera.connect(openCamera)
|
|
||||||
fileOpen.close.connect(close)
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowser {
|
|
||||||
id: imageFileBrowser
|
|
||||||
anchors.fill: root
|
|
||||||
Component.onCompleted: fileSelected.connect(content.openImage)
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowser {
|
|
||||||
id: videoFileBrowser
|
|
||||||
anchors.fill: root
|
|
||||||
Component.onCompleted: fileSelected.connect(content.openVideo)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called from main() once root properties have been set
|
|
||||||
function init() {
|
|
||||||
console.log("[qmlvideofx] main.init")
|
|
||||||
imageFileBrowser.folder = imagePath
|
|
||||||
videoFileBrowser.folder = videoPath
|
|
||||||
content.init()
|
|
||||||
performanceLoader.init()
|
|
||||||
if (fileName != "") {
|
|
||||||
fileOpenMouseArea.hintEnabled = false
|
|
||||||
effectSelectionPanelMouseArea.hintEnabled = false
|
|
||||||
splashScreen.state = "hidden"
|
|
||||||
content.openVideo(fileName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function qmlFramePainted() {
|
|
||||||
if (performanceLoader.item)
|
|
||||||
performanceLoader.item.qmlFramePainted()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openImage() {
|
|
||||||
fileOpenContainer.state = "baseState"
|
|
||||||
imageFileBrowser.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openVideo() {
|
|
||||||
fileOpenContainer.state = "baseState"
|
|
||||||
videoFileBrowser.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openCamera() {
|
|
||||||
fileOpenContainer.state = "baseState"
|
|
||||||
content.openCamera()
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
fileOpenContainer.state = "baseState"
|
|
||||||
content.openImage("qrc:/images/qt-logo.png")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,10 +10,12 @@ RESOURCES += qmlvideofx.qrc
|
|||||||
|
|
||||||
include($$PWD/../snippets/performancemonitor/performancemonitordeclarative.pri)
|
include($$PWD/../snippets/performancemonitor/performancemonitordeclarative.pri)
|
||||||
|
|
||||||
maemo6: {
|
|
||||||
DEFINES += SMALL_SCREEN_LAYOUT
|
|
||||||
DEFINES += SMALL_SCREEN_PHYSICAL
|
|
||||||
}
|
|
||||||
|
|
||||||
target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/video/qmlvideofx
|
target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/video/qmlvideofx
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|
||||||
|
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
|
||||||
|
|
||||||
|
OTHER_FILES += \
|
||||||
|
android/AndroidManifest.xml
|
||||||
|
|
||||||
|
QMAKE_INFO_PLIST = Info.plist
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>images/close.png</file>
|
|
||||||
<file>images/folder.png</file>
|
|
||||||
<file>images/titlebar.png</file>
|
|
||||||
<file>images/titlebar.sci</file>
|
|
||||||
<file>images/up.png</file>
|
|
||||||
<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>
|
||||||
@@ -26,12 +21,10 @@
|
|||||||
<file>qml/qmlvideofx/EffectPixelate.qml</file>
|
<file>qml/qmlvideofx/EffectPixelate.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectPosterize.qml</file>
|
<file>qml/qmlvideofx/EffectPosterize.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectRipple.qml</file>
|
<file>qml/qmlvideofx/EffectRipple.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectSelectionPanel.qml</file>
|
|
||||||
<file>qml/qmlvideofx/EffectSepia.qml</file>
|
<file>qml/qmlvideofx/EffectSepia.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectSharpen.qml</file>
|
<file>qml/qmlvideofx/EffectSharpen.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectShockwave.qml</file>
|
<file>qml/qmlvideofx/EffectShockwave.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectSobelEdgeDetection1.qml</file>
|
<file>qml/qmlvideofx/EffectSobelEdgeDetection1.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectSobelEdgeDetection2.qml</file>
|
|
||||||
<file>qml/qmlvideofx/EffectTiltShift.qml</file>
|
<file>qml/qmlvideofx/EffectTiltShift.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectToon.qml</file>
|
<file>qml/qmlvideofx/EffectToon.qml</file>
|
||||||
<file>qml/qmlvideofx/EffectVignette.qml</file>
|
<file>qml/qmlvideofx/EffectVignette.qml</file>
|
||||||
@@ -40,8 +33,6 @@
|
|||||||
<file>qml/qmlvideofx/FileBrowser.qml</file>
|
<file>qml/qmlvideofx/FileBrowser.qml</file>
|
||||||
<file>qml/qmlvideofx/FileOpen.qml</file>
|
<file>qml/qmlvideofx/FileOpen.qml</file>
|
||||||
<file>qml/qmlvideofx/HintedMouseArea.qml</file>
|
<file>qml/qmlvideofx/HintedMouseArea.qml</file>
|
||||||
<file>qml/qmlvideofx/main-largescreen.qml</file>
|
|
||||||
<file>qml/qmlvideofx/main-smallscreen.qml</file>
|
|
||||||
<file>qml/qmlvideofx/ParameterPanel.qml</file>
|
<file>qml/qmlvideofx/ParameterPanel.qml</file>
|
||||||
<file>qml/qmlvideofx/Slider.qml</file>
|
<file>qml/qmlvideofx/Slider.qml</file>
|
||||||
<file>shaders/billboard.fsh</file>
|
<file>shaders/billboard.fsh</file>
|
||||||
@@ -61,11 +52,21 @@
|
|||||||
<file>shaders/sharpen.fsh</file>
|
<file>shaders/sharpen.fsh</file>
|
||||||
<file>shaders/shockwave.fsh</file>
|
<file>shaders/shockwave.fsh</file>
|
||||||
<file>shaders/sobeledgedetection1.fsh</file>
|
<file>shaders/sobeledgedetection1.fsh</file>
|
||||||
<file>shaders/sobeledgedetection2.fsh</file>
|
|
||||||
<file>shaders/tiltshift.fsh</file>
|
<file>shaders/tiltshift.fsh</file>
|
||||||
<file>shaders/toon.fsh</file>
|
<file>shaders/toon.fsh</file>
|
||||||
<file>shaders/vignette.fsh</file>
|
<file>shaders/vignette.fsh</file>
|
||||||
<file>shaders/warhol.fsh</file>
|
<file>shaders/warhol.fsh</file>
|
||||||
<file>shaders/wobble.fsh</file>
|
<file>shaders/wobble.fsh</file>
|
||||||
|
<file>images/Slider_handle.png</file>
|
||||||
|
<file>images/Slider_bar.png</file>
|
||||||
|
<file>qml/qmlvideofx/Curtain.qml</file>
|
||||||
|
<file>images/Triangle_bottom.png</file>
|
||||||
|
<file>images/Triangle_Top.png</file>
|
||||||
|
<file>images/Dropdown_arrows.png</file>
|
||||||
|
<file>images/icon_Folder.png</file>
|
||||||
|
<file>images/icon_BackArrow.png</file>
|
||||||
|
<file>qml/qmlvideofx/Main.qml</file>
|
||||||
|
<file>images/icon_Menu.png</file>
|
||||||
|
<file>qml/qmlvideofx/EffectSelectionList.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -35,10 +35,12 @@
|
|||||||
\brief The Camera Example shows how to use the API to capture a still image
|
\brief The Camera Example shows how to use the API to capture a still image
|
||||||
or video.
|
or video.
|
||||||
|
|
||||||
The Camera Example demonstrates how you can use Qt Multimedia to implement
|
The Camera Example demonstrates how you can use \l{Qt Multimedia} to implement
|
||||||
some basic Camera functionality to take still images and record video clips
|
some basic Camera functionality to take still images and record video clips
|
||||||
with audio.
|
with audio.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
|
|
||||||
A Camera class is created that will act as our Camera. It has a user interface,
|
A Camera class is created that will act as our Camera. It has a user interface,
|
||||||
control functions, setting values and a means of defining the location where
|
control functions, setting values and a means of defining the location where
|
||||||
the image or video clip is to be saved. It will also store the image and video
|
the image or video clip is to be saved. It will also store the image and video
|
||||||
@@ -74,5 +76,3 @@ is started with a call to \l {QMediaRecorder::record()}.
|
|||||||
\image camera-example.png
|
\image camera-example.png
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -34,6 +34,8 @@
|
|||||||
This example creates a simple multimedia player. We can play audio and
|
This example creates a simple multimedia player. We can play audio and
|
||||||
or video files using various codecs.
|
or video files using various codecs.
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
|
|
||||||
The example uses a QMediaPlayer object passed into a QVideoWidget to
|
The example uses a QMediaPlayer object passed into a QVideoWidget to
|
||||||
control the video output. To give the application playlist capability
|
control the video output. To give the application playlist capability
|
||||||
we also use a QPlayList object.
|
we also use a QPlayList object.
|
||||||
@@ -93,4 +95,3 @@
|
|||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -32,9 +32,11 @@
|
|||||||
\brief This example demonstrates how to stream video on a graphics scene.
|
\brief This example demonstrates how to stream video on a graphics scene.
|
||||||
|
|
||||||
The Video Graphics Item example shows how to implement a QGraphicsItem that displays video on a
|
The Video Graphics Item example shows how to implement a QGraphicsItem that displays video on a
|
||||||
graphics scene using Qt Multimedia's QAbstractVideoSurface.
|
graphics scene using \l{Qt Multimedia}'s QAbstractVideoSurface.
|
||||||
|
|
||||||
\image video-videographicsitem.png
|
\image video-videographicsitem.png
|
||||||
|
|
||||||
\sa {Video Widget Example}
|
\sa {Video Widget Example}
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the documentation of the Qt Toolkit.
|
** This file is part of the documentation of the Qt Toolkit.
|
||||||
@@ -32,7 +32,9 @@
|
|||||||
\brief This example is a simple video player
|
\brief This example is a simple video player
|
||||||
|
|
||||||
The Video Widget example denonstrates how to implement a video widget using
|
The Video Widget example denonstrates how to implement a video widget using
|
||||||
Qt Multimedia's QAbstractVideoSurface.
|
\l{Qt Multimedia}'s QAbstractVideoSurface.
|
||||||
|
|
||||||
\image video-videowidget.png
|
\image video-videowidget.png
|
||||||
|
|
||||||
|
\include examples-run.qdocinc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ win32 {
|
|||||||
qtCompileTest(evr)
|
qtCompileTest(evr)
|
||||||
} else:mac {
|
} else:mac {
|
||||||
qtCompileTest(avfoundation)
|
qtCompileTest(avfoundation)
|
||||||
} else:android {
|
} else:android:!android-no-sdk {
|
||||||
SDK_ROOT = $$(ANDROID_SDK_ROOT)
|
SDK_ROOT = $$(ANDROID_SDK_ROOT)
|
||||||
isEmpty(SDK_ROOT): SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT
|
isEmpty(SDK_ROOT): SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT
|
||||||
!exists($$SDK_ROOT/platforms/android-11/android.jar): error("QtMultimedia for Android requires API level 11")
|
!exists($$SDK_ROOT/platforms/android-11/android.jar): error("QtMultimedia for Android requires API level 11")
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ import QtMultimedia 5.0
|
|||||||
|
|
||||||
\sa MediaPlayer, VideoOutput
|
\sa MediaPlayer, VideoOutput
|
||||||
|
|
||||||
|
\omit
|
||||||
\section1 Screen Saver
|
\section1 Screen Saver
|
||||||
|
|
||||||
If it is likely that an application will be playing video for an extended
|
If it is likely that an application will be playing video for an extended
|
||||||
@@ -97,8 +98,11 @@ import QtMultimedia 5.0
|
|||||||
|
|
||||||
ScreenSaver { screenSaverEnabled: false }
|
ScreenSaver { screenSaverEnabled: false }
|
||||||
\endqml
|
\endqml
|
||||||
|
\endomit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// TODO: Restore Qt System Info docs when the module is released
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: video
|
id: video
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ public:
|
|||||||
qmlRegisterUncreatableType<QDeclarativeCameraImageProcessing>(uri, 5, 0, "CameraImageProcessing",
|
qmlRegisterUncreatableType<QDeclarativeCameraImageProcessing>(uri, 5, 0, "CameraImageProcessing",
|
||||||
trUtf8("CameraImageProcessing is provided by Camera"));
|
trUtf8("CameraImageProcessing is provided by Camera"));
|
||||||
|
|
||||||
|
// Make types available for the 5.3 version
|
||||||
|
// Adding "import QtMultimedia 5.3" in QML will fail unless at least one type is registered
|
||||||
|
// for that version.
|
||||||
|
qmlRegisterType<QSoundEffect>(uri, 5, 3, "SoundEffect");
|
||||||
|
|
||||||
qmlRegisterType<QDeclarativeMediaMetaData>();
|
qmlRegisterType<QDeclarativeMediaMetaData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -601,8 +601,14 @@ bool QDeclarativeAudio::hasVideo() const
|
|||||||
/*!
|
/*!
|
||||||
\qmlproperty real QtMultimedia::Audio::bufferProgress
|
\qmlproperty real QtMultimedia::Audio::bufferProgress
|
||||||
|
|
||||||
This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0
|
This property holds how much of the data buffer is currently filled, from \c 0.0 (empty) to
|
||||||
(full).
|
\c 1.0 (full).
|
||||||
|
|
||||||
|
Playback can start or resume only when the buffer is entirely filled, in which case the
|
||||||
|
status is \c Audio.Buffered or \c Audio.Buffering. A value lower than \c 1.0 implies that
|
||||||
|
the status is \c Audio.Stalled.
|
||||||
|
|
||||||
|
\sa status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -1394,8 +1400,14 @@ void QDeclarativeAudio::_q_statusChanged()
|
|||||||
/*!
|
/*!
|
||||||
\qmlproperty real QtMultimedia::MediaPlayer::bufferProgress
|
\qmlproperty real QtMultimedia::MediaPlayer::bufferProgress
|
||||||
|
|
||||||
This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0
|
This property holds how much of the data buffer is currently filled, from \c 0.0 (empty) to
|
||||||
(full).
|
\c 1.0 (full).
|
||||||
|
|
||||||
|
Playback can start or resume only when the buffer is entirely filled, in which case the
|
||||||
|
status is \c MediaPlayer.Buffered or \c MediaPlayer.Buffering. A value lower than \c 1.0
|
||||||
|
implies that the status is \c MediaPlayer.Stalled.
|
||||||
|
|
||||||
|
\sa status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -45,23 +45,15 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QAudio
|
static void qRegisterAudioMetaTypes()
|
||||||
{
|
{
|
||||||
|
qRegisterMetaType<QAudio::Error>();
|
||||||
class RegisterMetaTypes
|
qRegisterMetaType<QAudio::State>();
|
||||||
{
|
qRegisterMetaType<QAudio::Mode>();
|
||||||
public:
|
|
||||||
RegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QAudio::Error>();
|
|
||||||
qRegisterMetaType<QAudio::State>();
|
|
||||||
qRegisterMetaType<QAudio::Mode>();
|
|
||||||
}
|
|
||||||
|
|
||||||
} _register;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioMetaTypes)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\namespace QAudio
|
\namespace QAudio
|
||||||
\brief The QAudio namespace contains enums used by the audio classes.
|
\brief The QAudio namespace contains enums used by the audio classes.
|
||||||
|
|||||||
@@ -47,18 +47,14 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
|
||||||
|
static void qRegisterAudioBufferMetaTypes()
|
||||||
{
|
{
|
||||||
class QAudioBufferPrivateRegisterMetaTypes
|
qRegisterMetaType<QAudioBuffer>();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QAudioBufferPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QAudioBuffer>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioBufferMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
class QAudioBufferPrivate : public QSharedData
|
class QAudioBufferPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,19 +72,14 @@ QT_BEGIN_NAMESPACE
|
|||||||
\sa QAudioBuffer
|
\sa QAudioBuffer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace
|
static void qRegisterAudioDecoderMetaTypes()
|
||||||
{
|
{
|
||||||
class AudioDecoderRegisterMetaTypes
|
qRegisterMetaType<QAudioDecoder::State>("QAudioDecoder::State");
|
||||||
{
|
qRegisterMetaType<QAudioDecoder::Error>("QAudioDecoder::Error");
|
||||||
public:
|
|
||||||
AudioDecoderRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QAudioDecoder::State>("QAudioDecoder::State");
|
|
||||||
qRegisterMetaType<QAudioDecoder::Error>("QAudioDecoder::Error");
|
|
||||||
}
|
|
||||||
} _registerPlayerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioDecoderMetaTypes)
|
||||||
|
|
||||||
class QAudioDecoderPrivate : public QMediaObjectPrivate
|
class QAudioDecoderPrivate : public QMediaObjectPrivate
|
||||||
{
|
{
|
||||||
Q_DECLARE_NON_CONST_PUBLIC(QAudioDecoder)
|
Q_DECLARE_NON_CONST_PUBLIC(QAudioDecoder)
|
||||||
|
|||||||
@@ -49,6 +49,11 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
static QString defaultKey()
|
||||||
|
{
|
||||||
|
return QStringLiteral("default");
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
|
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, audioLoader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, audioLoader,
|
||||||
(QAudioSystemFactoryInterface_iid, QLatin1String("audio"), Qt::CaseInsensitive))
|
(QAudioSystemFactoryInterface_iid, QLatin1String("audio"), Qt::CaseInsensitive))
|
||||||
@@ -137,13 +142,18 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode)
|
|||||||
QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
|
QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
|
||||||
{
|
{
|
||||||
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
|
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
|
||||||
QAudioSystemFactoryInterface* plugin = qobject_cast<QAudioSystemFactoryInterface*>(audioLoader()->instance(QLatin1String("default")));
|
QAudioSystemFactoryInterface* plugin = qobject_cast<QAudioSystemFactoryInterface*>(audioLoader()->instance(defaultKey()));
|
||||||
|
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
QList<QByteArray> list = plugin->availableDevices(QAudio::AudioInput);
|
QList<QByteArray> list = plugin->availableDevices(QAudio::AudioInput);
|
||||||
if (list.size() > 0)
|
if (list.size() > 0)
|
||||||
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput);
|
return QAudioDeviceInfo(defaultKey(), list.at(0), QAudio::AudioInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if no plugin is marked as default or if the default plugin doesn't have any input device,
|
||||||
|
// return the first input available from other plugins.
|
||||||
|
QList<QAudioDeviceInfo> inputDevices = availableDevices(QAudio::AudioInput);
|
||||||
|
if (!inputDevices.isEmpty())
|
||||||
|
return inputDevices.first();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return QAudioDeviceInfo();
|
return QAudioDeviceInfo();
|
||||||
@@ -152,13 +162,18 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
|
|||||||
QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
|
QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
|
||||||
{
|
{
|
||||||
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
|
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
|
||||||
QAudioSystemFactoryInterface* plugin = qobject_cast<QAudioSystemFactoryInterface*>(audioLoader()->instance(QLatin1String("default")));
|
QAudioSystemFactoryInterface* plugin = qobject_cast<QAudioSystemFactoryInterface*>(audioLoader()->instance(defaultKey()));
|
||||||
|
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
QList<QByteArray> list = plugin->availableDevices(QAudio::AudioOutput);
|
QList<QByteArray> list = plugin->availableDevices(QAudio::AudioOutput);
|
||||||
if (list.size() > 0)
|
if (list.size() > 0)
|
||||||
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput);
|
return QAudioDeviceInfo(defaultKey(), list.at(0), QAudio::AudioOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if no plugin is marked as default or if the default plugin doesn't have any output device,
|
||||||
|
// return the first output available from other plugins.
|
||||||
|
QList<QAudioDeviceInfo> outputDevices = availableDevices(QAudio::AudioOutput);
|
||||||
|
if (!outputDevices.isEmpty())
|
||||||
|
return outputDevices.first();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return QAudioDeviceInfo();
|
return QAudioDeviceInfo();
|
||||||
|
|||||||
@@ -47,18 +47,13 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterAudioDeviceInfoMetaTypes()
|
||||||
{
|
{
|
||||||
class QAudioInfoPrivateRegisterMetaTypes
|
qRegisterMetaType<QAudioDeviceInfo>();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QAudioInfoPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QAudioDeviceInfo>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioDeviceInfoMetaTypes)
|
||||||
|
|
||||||
class QAudioDeviceInfoPrivate : public QSharedData
|
class QAudioDeviceInfoPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -44,20 +44,14 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterAudioFormatMetaTypes()
|
||||||
{
|
{
|
||||||
class QAudioFormatPrivateRegisterMetaTypes
|
qRegisterMetaType<QAudioFormat>();
|
||||||
{
|
qRegisterMetaType<QAudioFormat::SampleType>();
|
||||||
public:
|
qRegisterMetaType<QAudioFormat::Endian>();
|
||||||
QAudioFormatPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QAudioFormat>();
|
|
||||||
qRegisterMetaType<QAudioFormat::SampleType>();
|
|
||||||
qRegisterMetaType<QAudioFormat::Endian>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioFormatMetaTypes)
|
||||||
|
|
||||||
class QAudioFormatPrivate : public QSharedData
|
class QAudioFormatPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,26 +56,21 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
namespace
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
static void qRegisterCameraMetaTypes()
|
||||||
{
|
{
|
||||||
class CameraRegisterMetaTypes
|
qRegisterMetaType<QCamera::Error>("QCamera::Error");
|
||||||
{
|
qRegisterMetaType<QCamera::State>("QCamera::State");
|
||||||
public:
|
qRegisterMetaType<QCamera::Status>("QCamera::Status");
|
||||||
CameraRegisterMetaTypes()
|
qRegisterMetaType<QCamera::CaptureModes>("QCamera::CaptureModes");
|
||||||
{
|
qRegisterMetaType<QCamera::LockType>("QCamera::LockType");
|
||||||
qRegisterMetaType<QCamera::Error>("QCamera::Error");
|
qRegisterMetaType<QCamera::LockStatus>("QCamera::LockStatus");
|
||||||
qRegisterMetaType<QCamera::State>("QCamera::State");
|
qRegisterMetaType<QCamera::LockChangeReason>("QCamera::LockChangeReason");
|
||||||
qRegisterMetaType<QCamera::Status>("QCamera::Status");
|
qRegisterMetaType<QCamera::Position>("QCamera::Position");
|
||||||
qRegisterMetaType<QCamera::CaptureModes>("QCamera::CaptureModes");
|
|
||||||
qRegisterMetaType<QCamera::LockType>("QCamera::LockType");
|
|
||||||
qRegisterMetaType<QCamera::LockStatus>("QCamera::LockStatus");
|
|
||||||
qRegisterMetaType<QCamera::LockChangeReason>("QCamera::LockChangeReason");
|
|
||||||
qRegisterMetaType<QCamera::Position>("QCamera::Position");
|
|
||||||
}
|
|
||||||
} _registerCameraMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraMetaTypes)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QCamera
|
\class QCamera
|
||||||
|
|||||||
@@ -65,20 +65,14 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
//#define DEBUG_EXPOSURE_CHANGES 1
|
//#define DEBUG_EXPOSURE_CHANGES 1
|
||||||
|
|
||||||
namespace
|
static void qRegisterCameraExposureMetaTypes()
|
||||||
{
|
{
|
||||||
class CameraExposureRegisterMetaTypes
|
qRegisterMetaType<QCameraExposure::ExposureMode>("QCameraExposure::ExposureMode");
|
||||||
{
|
qRegisterMetaType<QCameraExposure::FlashModes>("QCameraExposure::FlashModes");
|
||||||
public:
|
qRegisterMetaType<QCameraExposure::MeteringMode>("QCameraExposure::MeteringMode");
|
||||||
CameraExposureRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QCameraExposure::ExposureMode>("QCameraExposure::ExposureMode");
|
|
||||||
qRegisterMetaType<QCameraExposure::FlashModes>("QCameraExposure::FlashModes");
|
|
||||||
qRegisterMetaType<QCameraExposure::MeteringMode>("QCameraExposure::MeteringMode");
|
|
||||||
}
|
|
||||||
} _registerCameraExposureMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraExposureMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
class QCameraExposurePrivate
|
class QCameraExposurePrivate
|
||||||
|
|||||||
@@ -55,19 +55,15 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterCameraFocusMetaTypes()
|
||||||
{
|
{
|
||||||
class CameraFocusRegisterMetaTypes
|
qRegisterMetaType<QCameraFocus::FocusModes>("QCameraFocus::FocusModes");
|
||||||
{
|
qRegisterMetaType<QCameraFocus::FocusPointMode>("QCameraFocus::FocusPointMode");
|
||||||
public:
|
|
||||||
CameraFocusRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QCameraFocus::FocusModes>("QCameraFocus::FocusModes");
|
|
||||||
qRegisterMetaType<QCameraFocus::FocusPointMode>("QCameraFocus::FocusPointMode");
|
|
||||||
}
|
|
||||||
} _registerCameraFocusMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraFocusMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
class QCameraFocusFakeZoomControl : public QCameraZoomControl
|
class QCameraFocusFakeZoomControl : public QCameraZoomControl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -83,20 +83,15 @@ QT_BEGIN_NAMESPACE
|
|||||||
\value CaptureToBuffer Capture the image to a buffer for further processing.
|
\value CaptureToBuffer Capture the image to a buffer for further processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace
|
static void qRegisterCameraImageCaptureMetaTypes()
|
||||||
{
|
{
|
||||||
class MediaRecorderRegisterMetaTypes
|
qRegisterMetaType<QCameraImageCapture::Error>("QCameraImageCapture::Error");
|
||||||
{
|
qRegisterMetaType<QCameraImageCapture::CaptureDestination>("QCameraImageCapture::CaptureDestination");
|
||||||
public:
|
qRegisterMetaType<QCameraImageCapture::CaptureDestinations>("QCameraImageCapture::CaptureDestinations");
|
||||||
MediaRecorderRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QCameraImageCapture::Error>("QCameraImageCapture::Error");
|
|
||||||
qRegisterMetaType<QCameraImageCapture::CaptureDestination>("QCameraImageCapture::CaptureDestination");
|
|
||||||
qRegisterMetaType<QCameraImageCapture::CaptureDestinations>("QCameraImageCapture::CaptureDestinations");
|
|
||||||
}
|
|
||||||
} _registerRecorderMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageCaptureMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
class QCameraImageCapturePrivate
|
class QCameraImageCapturePrivate
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,20 +52,15 @@
|
|||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
namespace
|
QT_BEGIN_NAMESPACE
|
||||||
{
|
|
||||||
class QCameraImageProcessingPrivateRegisterMetaTypes
|
static void qRegisterCameraImageProcessingMetaTypes()
|
||||||
{
|
|
||||||
public:
|
|
||||||
QCameraImageProcessingPrivateRegisterMetaTypes()
|
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QCameraImageProcessing::WhiteBalanceMode>();
|
qRegisterMetaType<QCameraImageProcessing::WhiteBalanceMode>();
|
||||||
}
|
}
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageProcessingMetaTypes)
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QCameraImageProcessing
|
\class QCameraImageProcessing
|
||||||
|
|||||||
@@ -44,18 +44,13 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterCameraImageProcessingControlMetaTypes()
|
||||||
{
|
{
|
||||||
class QCameraImageProcessingControlPrivateRegisterMetaTypes
|
qRegisterMetaType<QCameraImageProcessingControl::ProcessingParameter>();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QCameraImageProcessingControlPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QCameraImageProcessingControl::ProcessingParameter>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageProcessingControlMetaTypes)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QCameraImageProcessingControl
|
\class QCameraImageProcessingControl
|
||||||
\inmodule QtMultimedia
|
\inmodule QtMultimedia
|
||||||
|
|||||||
@@ -44,18 +44,14 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterMediaStreamControlMetaTypes()
|
||||||
{
|
{
|
||||||
class QMediaStreamsControlPrivateRegisterMetaTypes
|
qRegisterMetaType<QMediaStreamsControl::StreamType>();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QMediaStreamsControlPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QMediaStreamsControl::StreamType>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaStreamControlMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QMediaStreamsControl
|
\class QMediaStreamsControl
|
||||||
\inmodule QtMultimedia
|
\inmodule QtMultimedia
|
||||||
|
|||||||
@@ -116,18 +116,14 @@ code but more buffering, which may affect latency.
|
|||||||
|
|
||||||
\section2 Decoding Compressed Audio to Memory
|
\section2 Decoding Compressed Audio to Memory
|
||||||
In some cases you may want to decode a compressed audio file and do further
|
In some cases you may want to decode a compressed audio file and do further
|
||||||
processing yourself (like mix multiple samples, or some custom digital signal
|
processing yourself (for example, mixing multiple samples or using custom
|
||||||
processing algorithms). Qt Multimedia 5.0 offers a preliminary API for this
|
digital signal processing algorithms). QAudioDecoder supports decoding local
|
||||||
case - the \l QAudioDecoder class. QAudioDecoder supports decoding local files
|
files or data streams from QIODevice instances.
|
||||||
or from a QIODevice instances.
|
|
||||||
|
|
||||||
Here's an example of decoding a local file:
|
Here's an example of decoding a local file:
|
||||||
|
|
||||||
\snippet multimedia-snippets/audio.cpp Local audio decoding
|
\snippet multimedia-snippets/audio.cpp Local audio decoding
|
||||||
|
|
||||||
Note: This API is preliminary at this time - the API may change or be
|
|
||||||
removed before the final 5.0 release.
|
|
||||||
|
|
||||||
\section1 Examples
|
\section1 Examples
|
||||||
|
|
||||||
There are both C++ and QML examples available.
|
There are both C++ and QML examples available.
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ PRIVATE_HEADERS += \
|
|||||||
qmediaserviceprovider_p.h \
|
qmediaserviceprovider_p.h \
|
||||||
qmediaresourcepolicyplugin_p.h \
|
qmediaresourcepolicyplugin_p.h \
|
||||||
qmediaresourcepolicy_p.h \
|
qmediaresourcepolicy_p.h \
|
||||||
qmediaresourceset_p.h
|
qmediaresourceset_p.h \
|
||||||
|
qmediastoragelocation_p.h
|
||||||
|
|
||||||
PUBLIC_HEADERS += \
|
PUBLIC_HEADERS += \
|
||||||
qmediabindableinterface.h \
|
qmediabindableinterface.h \
|
||||||
@@ -47,6 +48,7 @@ SOURCES += \
|
|||||||
qmediaresourcepolicyplugin_p.cpp \
|
qmediaresourcepolicyplugin_p.cpp \
|
||||||
qmediaresourcepolicy_p.cpp \
|
qmediaresourcepolicy_p.cpp \
|
||||||
qmediaresourceset_p.cpp \
|
qmediaresourceset_p.cpp \
|
||||||
|
qmediastoragelocation.cpp \
|
||||||
qmultimedia.cpp
|
qmultimedia.cpp
|
||||||
|
|
||||||
include(audio/audio.pri)
|
include(audio/audio.pri)
|
||||||
|
|||||||
@@ -307,9 +307,9 @@ Version=2
|
|||||||
|
|
||||||
void setCount(int count) {
|
void setCount(int count) {
|
||||||
m_count = count;
|
m_count = count;
|
||||||
m_fileName = QString(tr("File%1")).arg(count);
|
m_fileName = QStringLiteral("File%1").arg(count);
|
||||||
m_titleName = QString(tr("Title%1")).arg(count);
|
m_titleName = QStringLiteral("Title%1").arg(count);
|
||||||
m_lengthName = QString(tr("Length%1")).arg(count);
|
m_lengthName = QStringLiteral("Length%1").arg(count);
|
||||||
m_item.clear();
|
m_item.clear();
|
||||||
m_readFlags = 0;
|
m_readFlags = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,18 +48,13 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterMediaContentMetaTypes()
|
||||||
{
|
{
|
||||||
class QMediaContentPrivateRegisterMetaTypes
|
qRegisterMetaType<QMediaContent>();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QMediaContentPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QMediaContent>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaContentMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
class QMediaContentPrivate : public QSharedData
|
class QMediaContentPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,20 +90,16 @@ QT_BEGIN_NAMESPACE
|
|||||||
\sa QMediaObject, QMediaService, QVideoWidget, QMediaPlaylist
|
\sa QMediaObject, QMediaService, QVideoWidget, QMediaPlaylist
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace
|
static void qRegisterMediaPlayerMetaTypes()
|
||||||
{
|
{
|
||||||
class MediaPlayerRegisterMetaTypes
|
qRegisterMetaType<QMediaPlayer::State>("QMediaPlayer::State");
|
||||||
{
|
qRegisterMetaType<QMediaPlayer::MediaStatus>("QMediaPlayer::MediaStatus");
|
||||||
public:
|
qRegisterMetaType<QMediaPlayer::Error>("QMediaPlayer::Error");
|
||||||
MediaPlayerRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QMediaPlayer::State>("QMediaPlayer::State");
|
|
||||||
qRegisterMetaType<QMediaPlayer::MediaStatus>("QMediaPlayer::MediaStatus");
|
|
||||||
qRegisterMetaType<QMediaPlayer::Error>("QMediaPlayer::Error");
|
|
||||||
}
|
|
||||||
} _registerPlayerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlayerMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
#define MAX_NESTED_PLAYLISTS 16
|
#define MAX_NESTED_PLAYLISTS 16
|
||||||
|
|
||||||
class QMediaPlayerPrivate : public QMediaObjectPrivate
|
class QMediaPlayerPrivate : public QMediaObjectPrivate
|
||||||
@@ -1238,12 +1234,14 @@ QMultimedia::AvailabilityStatus QMediaPlayer::availability() const
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\property QMediaPlayer::bufferStatus
|
\property QMediaPlayer::bufferStatus
|
||||||
\brief the percentage of the temporary buffer filled before playback begins.
|
\brief the percentage of the temporary buffer filled before playback begins or resumes, from
|
||||||
|
\c 0 (empty) to \c 100 (full).
|
||||||
|
|
||||||
When the player object is buffering; this property holds the percentage of
|
When the player object is buffering; this property holds the percentage of
|
||||||
the temporary buffer that is filled. The buffer will need to reach 100%
|
the temporary buffer that is filled. The buffer will need to reach 100%
|
||||||
filled before playback can resume, at which time the MediaStatus will be
|
filled before playback can start or resume, at which time mediaStatus() will return
|
||||||
BufferedMedia.
|
BufferedMedia or BufferingMedia. If the value is anything lower than \c 100, mediaStatus() will
|
||||||
|
return StalledMedia.
|
||||||
|
|
||||||
\sa mediaStatus()
|
\sa mediaStatus()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -61,19 +61,14 @@ QT_BEGIN_NAMESPACE
|
|||||||
Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, playlistIOLoader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, playlistIOLoader,
|
||||||
(QMediaPlaylistIOInterface_iid, QLatin1String("playlistformats"), Qt::CaseInsensitive))
|
(QMediaPlaylistIOInterface_iid, QLatin1String("playlistformats"), Qt::CaseInsensitive))
|
||||||
|
|
||||||
namespace
|
static void qRegisterMediaPlaylistMetaTypes()
|
||||||
{
|
{
|
||||||
class QMediaPlaylistPrivateRegisterMetaTypes
|
qRegisterMetaType<QMediaPlaylist::Error>();
|
||||||
{
|
qRegisterMetaType<QMediaPlaylist::PlaybackMode>();
|
||||||
public:
|
|
||||||
QMediaPlaylistPrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QMediaPlaylist::Error>();
|
|
||||||
qRegisterMetaType<QMediaPlaylist::PlaybackMode>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlaylistMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QMediaPlaylist
|
\class QMediaPlaylist
|
||||||
|
|||||||
@@ -47,19 +47,15 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace
|
static void qRegisterMediaResourceMetaTypes()
|
||||||
{
|
{
|
||||||
class QMediaResourcePrivateRegisterMetaTypes
|
qRegisterMetaType<QMediaResource>();
|
||||||
{
|
qRegisterMetaType<QMediaResourceList>();
|
||||||
public:
|
|
||||||
QMediaResourcePrivateRegisterMetaTypes()
|
|
||||||
{
|
|
||||||
qRegisterMetaType<QMediaResource>();
|
|
||||||
qRegisterMetaType<QMediaResourceList>();
|
|
||||||
}
|
|
||||||
} _registerMetaTypes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaResourceMetaTypes)
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QMediaResource
|
\class QMediaResource
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Toolkit.
|
** This file is part of the Qt Toolkit.
|
||||||
@@ -39,24 +39,40 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qandroidmediastoragelocation.h"
|
#include "qmediastoragelocation_p.h"
|
||||||
|
|
||||||
#include "jmultimediautils.h"
|
#include <QStandardPaths>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QAndroidMediaStorageLocation::QAndroidMediaStorageLocation()
|
QMediaStorageLocation::QMediaStorageLocation()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir QAndroidMediaStorageLocation::defaultDir(CaptureSource source) const
|
void QMediaStorageLocation::addStorageLocation(MediaType type, const QString &location)
|
||||||
|
{
|
||||||
|
m_customLocations[type].append(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDir QMediaStorageLocation::defaultLocation(MediaType type) const
|
||||||
{
|
{
|
||||||
QStringList dirCandidates;
|
QStringList dirCandidates;
|
||||||
|
|
||||||
if (source == Camera)
|
dirCandidates << m_customLocations.value(type);
|
||||||
dirCandidates << JMultimediaUtils::getDefaultMediaDirectory(JMultimediaUtils::DCIM);
|
|
||||||
else
|
switch (type) {
|
||||||
dirCandidates << JMultimediaUtils::getDefaultMediaDirectory(JMultimediaUtils::Sounds);
|
case Movies:
|
||||||
|
dirCandidates << QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
|
||||||
|
break;
|
||||||
|
case Music:
|
||||||
|
dirCandidates << QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
|
||||||
|
break;
|
||||||
|
case Pictures:
|
||||||
|
dirCandidates << QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
dirCandidates << QDir::homePath();
|
dirCandidates << QDir::homePath();
|
||||||
dirCandidates << QDir::currentPath();
|
dirCandidates << QDir::currentPath();
|
||||||
dirCandidates << QDir::tempPath();
|
dirCandidates << QDir::tempPath();
|
||||||
@@ -69,31 +85,31 @@ QDir QAndroidMediaStorageLocation::defaultDir(CaptureSource source) const
|
|||||||
return QDir();
|
return QDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QAndroidMediaStorageLocation::generateFileName(const QString &requestedName,
|
QString QMediaStorageLocation::generateFileName(const QString &requestedName,
|
||||||
CaptureSource source,
|
MediaType type,
|
||||||
const QString &prefix,
|
const QString &prefix,
|
||||||
const QString &extension) const
|
const QString &extension) const
|
||||||
{
|
{
|
||||||
if (requestedName.isEmpty())
|
if (requestedName.isEmpty())
|
||||||
return generateFileName(prefix, defaultDir(source), extension);
|
return generateFileName(prefix, defaultLocation(type), extension);
|
||||||
|
|
||||||
QString path = requestedName;
|
QString path = requestedName;
|
||||||
|
|
||||||
if (QFileInfo(path).isRelative())
|
if (QFileInfo(path).isRelative())
|
||||||
path = defaultDir(source).absoluteFilePath(path);
|
path = defaultLocation(type).absoluteFilePath(path);
|
||||||
|
|
||||||
if (QFileInfo(path).isDir())
|
if (QFileInfo(path).isDir())
|
||||||
return generateFileName(prefix, QDir(path), extension);
|
return generateFileName(prefix, QDir(path), extension);
|
||||||
|
|
||||||
if (!path.endsWith(extension))
|
if (!path.endsWith(extension))
|
||||||
path.append(QString(".%1").arg(extension));
|
path.append(QString(QLatin1String(".%1")).arg(extension));
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QAndroidMediaStorageLocation::generateFileName(const QString &prefix,
|
QString QMediaStorageLocation::generateFileName(const QString &prefix,
|
||||||
const QDir &dir,
|
const QDir &dir,
|
||||||
const QString &extension) const
|
const QString &extension) const
|
||||||
{
|
{
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
|
|
||||||
@@ -102,7 +118,7 @@ QString QAndroidMediaStorageLocation::generateFileName(const QString &prefix,
|
|||||||
|
|
||||||
if (lastMediaIndex == 0) {
|
if (lastMediaIndex == 0) {
|
||||||
// first run, find the maximum media number during the fist capture
|
// first run, find the maximum media number during the fist capture
|
||||||
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension))) {
|
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString(QLatin1String("%1*.%2")).arg(prefix).arg(extension))) {
|
||||||
const qint64 mediaIndex = fileName.midRef(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
const qint64 mediaIndex = fileName.midRef(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
||||||
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
||||||
}
|
}
|
||||||
@@ -111,7 +127,7 @@ QString QAndroidMediaStorageLocation::generateFileName(const QString &prefix,
|
|||||||
// don't just rely on cached lastMediaIndex value,
|
// don't just rely on cached lastMediaIndex value,
|
||||||
// someone else may create a file after camera started
|
// someone else may create a file after camera started
|
||||||
while (true) {
|
while (true) {
|
||||||
const QString name = QString("%1%2.%3").arg(prefix)
|
const QString name = QString(QLatin1String("%1%2.%3")).arg(prefix)
|
||||||
.arg(lastMediaIndex + 1, 8, 10, QLatin1Char('0'))
|
.arg(lastMediaIndex + 1, 8, 10, QLatin1Char('0'))
|
||||||
.arg(extension);
|
.arg(extension);
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Toolkit.
|
** This file is part of the Qt Toolkit.
|
||||||
@@ -39,37 +39,42 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef QANDROIDMEDIASTORAGELOCATION_H
|
#ifndef QMEDIASTORAGELOCATION_H
|
||||||
#define QANDROIDMEDIASTORAGELOCATION_H
|
#define QMEDIASTORAGELOCATION_H
|
||||||
|
|
||||||
#include <QCamera>
|
#include <qtmultimediadefs.h>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMap>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QAndroidMediaStorageLocation
|
class Q_MULTIMEDIA_EXPORT QMediaStorageLocation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum CaptureSource {
|
enum MediaType {
|
||||||
Camera,
|
Movies,
|
||||||
Audio
|
Music,
|
||||||
|
Pictures,
|
||||||
|
Sounds
|
||||||
};
|
};
|
||||||
|
|
||||||
QAndroidMediaStorageLocation();
|
QMediaStorageLocation();
|
||||||
|
|
||||||
QDir defaultDir(CaptureSource source) const;
|
void addStorageLocation(MediaType type, const QString &location);
|
||||||
|
|
||||||
QString generateFileName(const QString &requestedName, CaptureSource source, const QString &prefix, const QString &extension) const;
|
QDir defaultLocation(MediaType type) const;
|
||||||
|
|
||||||
|
QString generateFileName(const QString &requestedName, MediaType type, const QString &prefix, const QString &extension) const;
|
||||||
QString generateFileName(const QString &prefix, const QDir &dir, const QString &extension) const;
|
QString generateFileName(const QString &prefix, const QDir &dir, const QString &extension) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QHash<QString, qint64> m_lastUsedIndex;
|
|
||||||
|
|
||||||
mutable QMutex m_mutex;
|
mutable QMutex m_mutex;
|
||||||
|
mutable QHash<QString, qint64> m_lastUsedIndex;
|
||||||
|
QMap<MediaType, QStringList> m_customLocations;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QANDROIDMEDIASTORAGELOCATION_H
|
#endif // QMEDIASTORAGELOCATION_H
|
||||||