/*!
* This file is part of CameraPlus.
*
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#ifndef CAMERA_H
#define CAMERA_H
-#include <QDeclarativeItem>
+#include <QObject>
#include <QVariant>
#include <QPointer>
class QtCamera;
class QtCamDevice;
-class QtCamGraphicsViewfinder;
-class DeclarativeQtCameraNotifications;
+class Sounds;
class NotificationsContainer;
class Zoom;
class Flash;
class Roi;
class VideoMute;
class VideoTorch;
+class CameraConfig;
+class Quirks;
-class Camera : public QDeclarativeItem {
+class Camera : public QObject {
Q_OBJECT
Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
- Q_PROPERTY(DeclarativeQtCameraNotifications *notifications READ notifications WRITE setNotifications NOTIFY notificationsChanged);
-
- Q_PROPERTY(QRectF renderArea READ renderArea NOTIFY renderAreaChanged);
- Q_PROPERTY(QSizeF videoResolution READ videoResolution NOTIFY videoResolutionChanged);
+ Q_PROPERTY(Sounds *sounds READ sounds WRITE setSounds NOTIFY soundsChanged);
Q_PROPERTY(Zoom *zoom READ zoom NOTIFY zoomChanged);
Q_PROPERTY(Flash *flash READ flash NOTIFY flashChanged);
Q_PROPERTY(VideoMute *videoMute READ videoMute NOTIFY videoMuteChanged);
Q_PROPERTY(VideoTorch *videoTorch READ videoTorch NOTIFY videoTorchChanged);
- Q_PROPERTY(bool renderingEnabled READ isRenderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged);
+ Q_PROPERTY(Quirks *quirks READ quirks NOTIFY quirksChanged);
+
+ // TODO: We need a setter here too.
+ Q_PROPERTY(CameraConfig *cameraConfig READ cameraConfig CONSTANT);
Q_ENUMS(CameraMode);
VideoMode
} CameraMode;
- Camera(QDeclarativeItem *parent = 0);
+ Camera(QObject *parent = 0);
~Camera();
- virtual void componentComplete();
-
int deviceCount() const;
Q_INVOKABLE QString deviceName(int index) const;
Q_INVOKABLE QVariant deviceId(int index) const;
QString imageSuffix() const;
QString videoSuffix() const;
- DeclarativeQtCameraNotifications *notifications() const;
- void setNotifications(DeclarativeQtCameraNotifications *notifications);
+ Sounds *sounds() const;
+ void setSounds(Sounds *sounds);
Zoom *zoom() const;
Flash *flash() const;
VideoMute *videoMute() const;
VideoTorch *videoTorch() const;
- QRectF renderArea() const;
- QSizeF videoResolution() const;
+ Quirks *quirks() const;
- bool isRenderingEnabled() const;
- void setRenderingEnabled(bool enabled);
+ CameraConfig *cameraConfig() const;
signals:
void deviceCountChanged();
void deviceIdChanged();
+ void prepareForDeviceChange();
void deviceChanged();
void modeChanged();
void idleStateChanged();
void runningStateChanged();
void error(const QString& message, int code, const QString& debug);
- void notificationsChanged();
+ void soundsChanged();
void renderAreaChanged();
void videoResolutionChanged();
void videoMuteChanged();
void videoTorchChanged();
void renderingEnabledChanged();
-
-protected:
- void geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry);
+ void quirksChanged();
private:
bool applyMode();
QtCamera *m_cam;
QtCamDevice *m_dev;
QVariant m_id;
- QtCamGraphicsViewfinder *m_vf;
CameraMode m_mode;
NotificationsContainer *m_notifications;
VideoMute *m_videoMute;
VideoTorch *m_videoTorch;
+ CameraConfig *m_config;
+ Quirks *m_quirks;
};
#endif /* CAMERA_H */