4 * This file is part of CameraPlus.
6 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 class NotificationsContainer;
44 class FlickerReduction;
52 class Camera : public QObject {
55 Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
56 Q_PROPERTY(QVariant deviceId READ deviceId NOTIFY deviceIdChanged);
57 Q_PROPERTY(CameraMode mode READ mode NOTIFY modeChanged);
58 Q_PROPERTY(bool idle READ isIdle NOTIFY idleStateChanged);
59 Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
60 Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
61 Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
62 Q_PROPERTY(Sounds *sounds READ sounds WRITE setSounds NOTIFY soundsChanged);
64 Q_PROPERTY(Zoom *zoom READ zoom NOTIFY zoomChanged);
65 Q_PROPERTY(Flash *flash READ flash NOTIFY flashChanged);
66 Q_PROPERTY(Scene *scene READ scene NOTIFY sceneChanged);
67 Q_PROPERTY(EvComp *evComp READ evComp NOTIFY evCompChanged);
68 Q_PROPERTY(WhiteBalance *whiteBalance READ whiteBalance NOTIFY whiteBalanceChanged);
69 Q_PROPERTY(ColorTone *colorTone READ colorTone NOTIFY colorToneChanged);
70 Q_PROPERTY(Iso *iso READ iso NOTIFY isoChanged);
71 Q_PROPERTY(Exposure *exposure READ exposure NOTIFY exposureChanged);
72 Q_PROPERTY(Aperture *aperture READ aperture NOTIFY apertureChanged);
73 Q_PROPERTY(NoiseReduction *noiseReduction READ noiseReduction NOTIFY noiseReductionChanged);
74 Q_PROPERTY(FlickerReduction *flickerReduction READ flickerReduction NOTIFY flickerReductionChanged);
75 Q_PROPERTY(Focus *focus READ focus NOTIFY focusChanged);
76 Q_PROPERTY(AutoFocus *autoFocus READ autoFocus NOTIFY autoFocusChanged);
77 Q_PROPERTY(Roi *roi READ roi NOTIFY roiChanged);
79 Q_PROPERTY(VideoMute *videoMute READ videoMute NOTIFY videoMuteChanged);
80 Q_PROPERTY(VideoTorch *videoTorch READ videoTorch NOTIFY videoTorchChanged);
82 // TODO: We need a setter here too.
83 Q_PROPERTY(CameraConfig *cameraConfig READ cameraConfig CONSTANT);
94 Camera(QObject *parent = 0);
97 int deviceCount() const;
98 Q_INVOKABLE QString deviceName(int index) const;
99 Q_INVOKABLE QVariant deviceId(int index) const;
101 Q_INVOKABLE bool reset(const QVariant& deviceId, const CameraMode& mode);
103 QVariant deviceId() const;
107 QtCamDevice *device() const;
109 Q_INVOKABLE bool start();
110 Q_INVOKABLE bool stop(bool force = false);
115 QString imageSuffix() const;
116 QString videoSuffix() const;
118 Sounds *sounds() const;
119 void setSounds(Sounds *sounds);
122 Flash *flash() const;
123 Scene *scene() const;
124 EvComp *evComp() const;
125 WhiteBalance *whiteBalance() const;
126 ColorTone *colorTone() const;
128 Exposure *exposure() const;
129 Aperture *aperture() const;
130 NoiseReduction *noiseReduction() const;
131 FlickerReduction *flickerReduction() const;
132 Focus *focus() const;
133 AutoFocus *autoFocus() const;
136 VideoMute *videoMute() const;
137 VideoTorch *videoTorch() const;
139 CameraConfig *cameraConfig() const;
142 void deviceCountChanged();
143 void deviceIdChanged();
144 void deviceChanged();
146 void idleStateChanged();
147 void runningStateChanged();
148 void error(const QString& message, int code, const QString& debug);
149 void soundsChanged();
150 void renderAreaChanged();
151 void videoResolutionChanged();
156 void evCompChanged();
157 void whiteBalanceChanged();
158 void colorToneChanged();
160 void exposureChanged();
161 void apertureChanged();
162 void noiseReductionChanged();
163 void flickerReductionChanged();
165 void autoFocusChanged();
168 void videoMuteChanged();
169 void videoTorchChanged();
170 void renderingEnabledChanged();
174 bool setDeviceId(const QVariant& deviceId);
175 bool setMode(const CameraMode& mode);
177 void resetCapabilities();
183 NotificationsContainer *m_notifications;
189 WhiteBalance *m_whiteBalance;
190 ColorTone *m_colorTone;
192 Exposure *m_exposure;
193 Aperture *m_aperture;
194 NoiseReduction *m_noiseReduction;
195 FlickerReduction *m_flickerReduction;
197 AutoFocus *m_autoFocus;
200 VideoMute *m_videoMute;
201 VideoTorch *m_videoTorch;
202 CameraConfig *m_config;
205 #endif /* CAMERA_H */