-
Notifications
You must be signed in to change notification settings - Fork 11
/
gphotocameraimagecapturecontrol.cpp
39 lines (32 loc) · 1.26 KB
/
gphotocameraimagecapturecontrol.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "gphotocameraimagecapturecontrol.h"
#include "gphotocamerasession.h"
GPhotoCameraImageCaptureControl::GPhotoCameraImageCaptureControl(GPhotoCameraSession *session, QObject *parent)
: QCameraImageCaptureControl(parent)
, m_session(session)
{
using Session = GPhotoCameraSession;
using Control = GPhotoCameraImageCaptureControl;
connect(m_session, &Session::imageAvailable, this, &Control::imageAvailable);
connect(m_session, &Session::imageCaptured, this, &Control::imageCaptured);
connect(m_session, &Session::imageCaptureError, this, &Control::error);
connect(m_session, &Session::imageSaved, this, &Control::imageSaved);
connect(m_session, &Session::readyForCaptureChanged, this, &Control::readyForCaptureChanged);
}
QCameraImageCapture::DriveMode GPhotoCameraImageCaptureControl::driveMode() const
{
return QCameraImageCapture::SingleImageCapture;
}
void GPhotoCameraImageCaptureControl::setDriveMode(QCameraImageCapture::DriveMode /*driveMode*/)
{
}
bool GPhotoCameraImageCaptureControl::isReadyForCapture() const
{
return m_session->isReadyForCapture();
}
int GPhotoCameraImageCaptureControl::capture(const QString &fileName)
{
return m_session->capture(fileName);
}
void GPhotoCameraImageCaptureControl::cancelCapture()
{
}