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;
53 class Camera : public QObject {
56 Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
57 Q_PROPERTY(QVariant deviceId READ deviceId NOTIFY deviceIdChanged);
58 Q_PROPERTY(CameraMode mode READ mode NOTIFY modeChanged);
59 Q_PROPERTY(bool idle READ isIdle NOTIFY idleStateChanged);
60 Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
61 Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
62 Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
63 Q_PROPERTY(Sounds *sounds READ sounds WRITE setSounds NOTIFY soundsChanged);
65 Q_PROPERTY(Zoom *zoom READ zoom NOTIFY zoomChanged);
66 Q_PROPERTY(Flash *flash READ flash NOTIFY flashChanged);
67 Q_PROPERTY(Scene *scene READ scene NOTIFY sceneChanged);
68 Q_PROPERTY(EvComp *evComp READ evComp NOTIFY evCompChanged);
69 Q_PROPERTY(WhiteBalance *whiteBalance READ whiteBalance NOTIFY whiteBalanceChanged);
70 Q_PROPERTY(ColorTone *colorTone READ colorTone NOTIFY colorToneChanged);
71 Q_PROPERTY(Iso *iso READ iso NOTIFY isoChanged);
72 Q_PROPERTY(Exposure *exposure READ exposure NOTIFY exposureChanged);
73 Q_PROPERTY(Aperture *aperture READ aperture NOTIFY apertureChanged);
74 Q_PROPERTY(NoiseReduction *noiseReduction READ noiseReduction NOTIFY noiseReductionChanged);
75 Q_PROPERTY(FlickerReduction *flickerReduction READ flickerReduction NOTIFY flickerReductionChanged);
76 Q_PROPERTY(Focus *focus READ focus NOTIFY focusChanged);
77 Q_PROPERTY(AutoFocus *autoFocus READ autoFocus NOTIFY autoFocusChanged);
78 Q_PROPERTY(Roi *roi READ roi NOTIFY roiChanged);
80 Q_PROPERTY(VideoMute *videoMute READ videoMute NOTIFY videoMuteChanged);
81 Q_PROPERTY(VideoTorch *videoTorch READ videoTorch NOTIFY videoTorchChanged);
83 Q_PROPERTY(Quirks *quirks READ quirks NOTIFY quirksChanged);
85 // TODO: We need a setter here too.
86 Q_PROPERTY(CameraConfig *cameraConfig READ cameraConfig CONSTANT);
97 Camera(QObject *parent = 0);
100 int deviceCount() const;
101 Q_INVOKABLE QString deviceName(int index) const;
102 Q_INVOKABLE QVariant deviceId(int index) const;
104 Q_INVOKABLE bool reset(const QVariant& deviceId, const CameraMode& mode);
106 QVariant deviceId() const;
110 QtCamDevice *device() const;
112 Q_INVOKABLE bool start();
113 Q_INVOKABLE bool stop(bool force = false);
118 QString imageSuffix() const;
119 QString videoSuffix() const;
121 Sounds *sounds() const;
122 void setSounds(Sounds *sounds);
125 Flash *flash() const;
126 Scene *scene() const;
127 EvComp *evComp() const;
128 WhiteBalance *whiteBalance() const;
129 ColorTone *colorTone() const;
131 Exposure *exposure() const;
132 Aperture *aperture() const;
133 NoiseReduction *noiseReduction() const;
134 FlickerReduction *flickerReduction() const;
135 Focus *focus() const;
136 AutoFocus *autoFocus() const;
139 VideoMute *videoMute() const;
140 VideoTorch *videoTorch() const;
142 Quirks *quirks() const;
144 CameraConfig *cameraConfig() const;
147 void deviceCountChanged();
148 void deviceIdChanged();
149 void prepareForDeviceChange();
150 void deviceChanged();
152 void idleStateChanged();
153 void runningStateChanged();
154 void error(const QString& message, int code, const QString& debug);
155 void soundsChanged();
156 void renderAreaChanged();
157 void videoResolutionChanged();
162 void evCompChanged();
163 void whiteBalanceChanged();
164 void colorToneChanged();
166 void exposureChanged();
167 void apertureChanged();
168 void noiseReductionChanged();
169 void flickerReductionChanged();
171 void autoFocusChanged();
174 void videoMuteChanged();
175 void videoTorchChanged();
176 void renderingEnabledChanged();
177 void quirksChanged();
181 bool setDeviceId(const QVariant& deviceId);
182 bool setMode(const CameraMode& mode);
184 void resetCapabilities();
190 NotificationsContainer *m_notifications;
196 WhiteBalance *m_whiteBalance;
197 ColorTone *m_colorTone;
199 Exposure *m_exposure;
200 Aperture *m_aperture;
201 NoiseReduction *m_noiseReduction;
202 FlickerReduction *m_flickerReduction;
204 AutoFocus *m_autoFocus;
207 VideoMute *m_videoMute;
208 VideoTorch *m_videoTorch;
209 CameraConfig *m_config;
213 #endif /* CAMERA_H */