Initial implementation
[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 numerator;
10   int denominator;
11 };
12
13 QtCamVideoSettings::QtCamVideoSettings(const QString& id, const QString& name,
14                                        const QSize& capture, const QSize& preview,
15                                        int numerator, int denominator) :
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->numerator = numerator;
23   d_ptr->denominator = denominator;
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->numerator = other.d_ptr->numerator;
34   d_ptr->denominator = other.d_ptr->denominator;
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->numerator = other.d_ptr->numerator;
48   d_ptr->denominator = other.d_ptr->denominator;
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 QPair<int, int> QtCamVideoSettings::frameRate() const {
70   return qMakePair<int, int>(d_ptr->numerator, d_ptr->denominator);
71 }