[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bphonon=5D_phonon/experimental=3A_Add_state=28=29_an?=
From: Casian Andrei <skeletk13 () gmail ! com>
Date: 2011-02-28 21:50:21
Message-ID: 20110228215021.A6B4DA60DD () git ! kde ! org
[Download RAW message or body]
Git commit fb30590832ddf85d8ecae3e323a24e44de0e88be by Casian Andrei.
Committed on 28/02/2011 at 22:15.
Pushed by casianandrei into branch 'master'.
Add state() and pause() to AvCapture
M +17 -0 phonon/experimental/avcapture.cpp
M +15 -0 phonon/experimental/avcapture.h
M +2 -0 phonon/experimental/avcaptureinterface.h
http://commits.kde.org/phonon/fb30590832ddf85d8ecae3e323a24e44de0e88be
diff --git a/phonon/experimental/avcapture.cpp b/phonon/experimental/avcapture.cpp
index 1a76d04..d70ceb4 100644
--- a/phonon/experimental/avcapture.cpp
+++ b/phonon/experimental/avcapture.cpp
@@ -41,6 +41,15 @@ namespace Experimental
{
PHONON_OBJECT_IMPL
+Phonon::State AvCapture::state() const
+{
+ K_D(const AvCapture);
+ if (d->m_backendObject) {
+ return INTERFACE_CALL(state());
+ }
+ return Phonon::StoppedState;
+}
+
void AvCapture::start()
{
K_D(AvCapture);
@@ -49,6 +58,14 @@ void AvCapture::start()
}
}
+void AvCapture::pause()
+{
+ K_D(AvCapture);
+ if (d->backendObject()) {
+ INTERFACE_CALL(pause());
+ }
+}
+
void AvCapture::stop()
{
K_D(AvCapture);
diff --git a/phonon/experimental/avcapture.h b/phonon/experimental/avcapture.h
index 7eb1d10..ba62e5c 100644
--- a/phonon/experimental/avcapture.h
+++ b/phonon/experimental/avcapture.h
@@ -68,6 +68,16 @@ namespace Experimental
Q_PROPERTY(Phonon::VideoCaptureDevice videoCaptureDevice READ \
videoCaptureDevice WRITE setVideoCaptureDevice) public:
/**
+ * Returns the current state of the capture.
+ *
+ * \li If only the audio capture device is valid, it returns the audio \
capture state. + * \li If only the video capture device is valid, it \
returns the video capture state. + * \li If both the audio and video \
capture devices are valid, it only returns the + * video capture state.
+ */
+ State state() const;
+
+ /**
* Returns the currently used capture source for the audio signal.
*
* @see AudioCaptureDevice
@@ -124,6 +134,11 @@ namespace Experimental
void start();
/**
+ * Pause capture.
+ */
+ void pause();
+
+ /**
* Stop capture.
*/
void stop();
diff --git a/phonon/experimental/avcaptureinterface.h \
b/phonon/experimental/avcaptureinterface.h index 923e8e5..ad38eda 100644
--- a/phonon/experimental/avcaptureinterface.h
+++ b/phonon/experimental/avcaptureinterface.h
@@ -33,7 +33,9 @@ class AvCaptureInterface
public:
virtual ~AvCaptureInterface() {}
+ virtual Phonon::State state() const = 0;
virtual void start() = 0;
+ virtual void pause() = 0;
virtual void stop() = 0;
virtual Phonon::AudioCaptureDevice audioCaptureDevice() const = 0;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic