}
void ImageMode::preChangeMode() {
+ if (m_image) {
+ QObject::disconnect(m_image, SIGNAL(captureStarted()), this, SIGNAL(captureStarted()));
+ QObject::disconnect(m_image, SIGNAL(captureEnded()), this, SIGNAL(captureEnded()));
+ }
+
m_image = 0;
}
void ImageMode::postChangeMode() {
m_image = m_cam->device()->imageMode();
+
+ if (m_image) {
+ QObject::connect(m_image, SIGNAL(captureStarted()), this, SIGNAL(captureStarted()));
+ QObject::connect(m_image, SIGNAL(captureEnded()), this, SIGNAL(captureEnded()));
+ }
}
void ImageMode::changeMode() {
Q_INVOKABLE bool capture(const QString& fileName);
+signals:
+ void captureStarted();
+ void captureEnded();
+
protected:
virtual void preChangeMode();
virtual void postChangeMode();
friend class QtCamVideoMute;
friend class QtCamAutoFocusPrivate;
friend class QtCamRoiPrivate;
+ friend class QtCamNotifications;
QtCamDevicePrivate *d_ptr;
};
QtCamImageSettings *settings() const;
+signals:
+ void captureStarted();
+ void captureEnded();
+
protected:
virtual void start();
virtual void stop();
#include "qtcamnotifications.h"
#include "qtcamnotifications_p.h"
#include "qtcamdevice.h"
+#include "qtcamdevice_p.h"
+#include "qtcamimagemode.h"
#ifndef GST_USE_UNSTABLE_API
#define GST_USE_UNSTABLE_API
#endif /* GST_USE_UNSTABLE_API */
QObject::connect(d_ptr->af, SIGNAL(messageSent(GstMessage *)),
this, SLOT(autoFocusStatusChanged(GstMessage *)));
+
+ QObject::connect(d_ptr->imageStart, SIGNAL(messageSent(GstMessage *)),
+ d_ptr->dev->d_ptr->image, SIGNAL(captureStarted()), Qt::AutoConnection);
+ QObject::connect(d_ptr->imageEnd, SIGNAL(messageSent(GstMessage *)),
+ d_ptr->dev->d_ptr->image, SIGNAL(captureEnded()), Qt::AutoConnection);
}
QtCamNotifications::~QtCamNotifications() {