Git commit 2a80da2ab43e46960151f93b9058c3dfb4061c02 by Casian Andrei. Committed on 28/02/2011 at 21:53. Pushed by casianandrei into branch 'master'. Add stateChanged signal to AvCapture M +3 -0 phonon/experimental/avcapture.cpp M +12 -1 phonon/experimental/avcapture.h M +2 -1 phonon/experimental/avcapture_p.h http://commits.kde.org/phonon/2a80da2ab43e46960151f93b9058c3dfb4061c02 diff --git a/phonon/experimental/avcapture.cpp b/phonon/experimental/avcapture.cpp index faa5aee..1a76d04 100644 --- a/phonon/experimental/avcapture.cpp +++ b/phonon/experimental/avcapture.cpp @@ -125,8 +125,11 @@ bool AvCapturePrivate::aboutToDeleteBackendObject() void AvCapturePrivate::setupBackendObject() { + Q_Q(AvCapture); Q_ASSERT(m_backendObject); + QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SIGNAL(stateChanged(Phonon::State, Phonon::State)), Qt::QueuedConnection); + // set up attributes pINTERFACE_CALL(setAudioCaptureDevice(audioCaptureDevice)); pINTERFACE_CALL(setVideoCaptureDevice(videoCaptureDevice)); diff --git a/phonon/experimental/avcapture.h b/phonon/experimental/avcapture.h index 1eabafa..7eb1d10 100644 --- a/phonon/experimental/avcapture.h +++ b/phonon/experimental/avcapture.h @@ -32,7 +32,7 @@ #include "../medianode.h" #include "../phonondefs.h" #include "objectdescription.h" -#include "phonon/Global" +#include "phonon/phononnamespace.h" class QString; class QStringList; @@ -127,6 +127,17 @@ namespace Experimental * Stop capture. */ void stop(); + + Q_SIGNALS: + /** + * Emitted when the state of the video or audio capture device has been changed. + * + * \li If only the audio capture device is valid, it notifies about the audio capture state. + * \li If only the video capture device is valid, it notifies about the video capture state. + * \li If both the audio and video capture devices are valid, it only notifies about the + * video capture state. + */ + void stateChanged(Phonon::State newstate, Phonon::State oldstate); }; } // namespace Experimental diff --git a/phonon/experimental/avcapture_p.h b/phonon/experimental/avcapture_p.h index e1facfe..ebda59e 100644 --- a/phonon/experimental/avcapture_p.h +++ b/phonon/experimental/avcapture_p.h @@ -26,7 +26,6 @@ #ifndef NO_PHONON_AVCAPTURE #include "avcapture.h" -#include "../medianode_p.h" #include "../phonondefs_p.h" namespace Phonon @@ -40,6 +39,8 @@ class AvCapturePrivate : public MediaNodePrivate PHONON_PRIVATECLASS public: protected: + PHONON_EXPORT void _k_stateChanged(Phonon::State, Phonon::State); + protected: Phonon::AudioCaptureDevice audioCaptureDevice; Phonon::VideoCaptureDevice videoCaptureDevice; };