Changes to night mode handling:
[harmattan/cameraplus] / lib / qtcamvideosettings.cpp
1 #include "qtcamvideosettings.h"
2
3 class QtCamVideoSettingsPrivate {
4 public:
5   QString id;
6   QString name;
7   QSize capture;
8   QSize preview;
9   int fps;
10   int nightFps;
11 };
12
13 QtCamVideoSettings::QtCamVideoSettings(const QString& id, const QString& name,
14                                        const QSize& capture, const QSize& preview,
15                                        int fps, int nightFps) :
16   d_ptr(new QtCamVideoSettingsPrivate) {
17
18   d_ptr->id = id;
19   d_ptr->name = name;
20   d_ptr->capture = capture;
21   d_ptr->preview = preview;
22   d_ptr->fps = fps;
23   d_ptr->nightFps = nightFps;
24 }
25
26 QtCamVideoSettings::QtCamVideoSettings(const QtCamVideoSettings& other) :
27   d_ptr(new QtCamVideoSettingsPrivate) {
28
29   d_ptr->id = other.d_ptr->id;
30   d_ptr->name = other.d_ptr->name;
31   d_ptr->capture = other.d_ptr->capture;
32   d_ptr->preview = other.d_ptr->preview;
33   d_ptr->fps = other.d_ptr->fps;
34   d_ptr->nightFps = other.d_ptr->nightFps;
35 }
36
37 QtCamVideoSettings::~QtCamVideoSettings() {
38   delete d_ptr;
39 }
40
41 QtCamVideoSettings& QtCamVideoSettings::operator=(const QtCamVideoSettings&
42                                                                 other) {
43   d_ptr->id = other.d_ptr->id;
44   d_ptr->name = other.d_ptr->name;
45   d_ptr->capture = other.d_ptr->capture;
46   d_ptr->preview = other.d_ptr->preview;
47   d_ptr->fps = other.d_ptr->fps;
48   d_ptr->nightFps = other.d_ptr->nightFps;
49
50   return *this;
51 }
52
53 QString QtCamVideoSettings::id() const {
54   return d_ptr->id;
55 }
56
57 QString QtCamVideoSettings::name() const {
58   return d_ptr->name;
59 }
60
61 QSize QtCamVideoSettings::captureResolution() const {
62   return d_ptr->capture;
63 }
64
65 QSize QtCamVideoSettings::previewResolution() const {
66   return d_ptr->preview;
67 }
68
69 int QtCamVideoSettings::frameRate() const {
70   return d_ptr->fps;
71 }
72
73 int QtCamVideoSettings::nightFrameRate() const {
74   return d_ptr->nightFps;
75 }