/*!
* 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
#include <QObject>
class QSettings;
+class DeviceSettings;
class Settings : public QObject {
Q_OBJECT
Q_PROPERTY(int mode READ mode WRITE setMode NOTIFY modeChanged);
Q_PROPERTY(QString creatorName READ creatorName WRITE setCreatorName NOTIFY creatorNameChanged);
- Q_PROPERTY(int postCaptureTimeout READ postCaptureTimeout WRITE setPostCaptureTimeout NOTIFY postCaptureTimeoutChanged);
Q_PROPERTY(bool useGps READ useGps WRITE setUseGps NOTIFY useGpsChanged);
Q_PROPERTY(bool useGeotags READ useGeotags WRITE setUseGeotags NOTIFY useGeotagsChanged);
Q_PROPERTY(int imageSceneMode READ imageSceneMode WRITE setImageSceneMode NOTIFY imageSceneModeChanged);
Q_PROPERTY(QString videoAspectRatio READ videoAspectRatio WRITE setVideoAspectRatio NOTIFY videoAspectRatioChanged);
Q_PROPERTY(QString videoResolution READ videoResolution WRITE setVideoResolution NOTIFY videoResolutionChanged);
+ Q_PROPERTY(bool soundEnabled READ isSoundEnabled WRITE setSoundEnabled NOTIFY soundEnabledChanged);
+ Q_PROPERTY(bool videoTorchOn READ isVideoTorchOn WRITE setVideoTorchOn NOTIFY videoTorchOnChanged);
+
+ Q_PROPERTY(bool showToolBar READ isToolBarShown WRITE setToolBarShown NOTIFY toolBarShownChanged);
+ Q_PROPERTY(bool videoMuted READ isVideoMuted WRITE setVideoMuted NOTIFY videoMutedChanged);
+
+ Q_PROPERTY(bool gridEnabled READ isGridEnabled WRITE setGridEnabled NOTIFY gridEnabledChanged);
+
+ Q_PROPERTY(bool faceDetectionEnabled READ isFaceDetectionEnabled WRITE setFaceDetectionEnabled NOTIFY faceDetectionEnabledChanged);
+ Q_PROPERTY(bool zoomAsShutter READ isZoomAsShutterEnabled WRITE setZoomAsShutterEnabled NOTIFY zoomAsShutterChanged);
+ Q_PROPERTY(bool proximityAsShutter READ isProximityAsShutterEnabled WRITE setProximityAsShutterEnabled NOTIFY proximityAsShutterChanged);
+ Q_PROPERTY(int device READ device WRITE setDevice NOTIFY deviceChanged);
+
public:
Settings(QObject *parent = 0);
~Settings();
QString creatorName() const;
void setCreatorName(const QString& name);
- int postCaptureTimeout() const;
- void setPostCaptureTimeout(int timeout);
-
bool useGps() const;
void setUseGps(bool enable);
bool useGeotags() const;
void setUseGeotags(bool enable);
- int imageSceneMode() const;
+ int imageSceneMode();
void setImageSceneMode(int mode);
- int imageColorFilter() const;
+ int imageColorFilter();
void setImageColorFilter(int filter);
- int imageWhiteBalance() const;
+ int imageWhiteBalance();
void setImageWhiteBalance(int wb);
- qreal imageEvComp() const;
+ qreal imageEvComp();
void setImageEvComp(qreal ev);
- int videoSceneMode() const;
+ int videoSceneMode();
void setVideoSceneMode(int mode);
- int videoColorFilter() const;
+ int videoColorFilter();
void setVideoColorFilter(int filter);
- int videoWhiteBalance() const;
+ int videoWhiteBalance();
void setVideoWhiteBalance(int wb);
- qreal videoEvComp() const;
+ qreal videoEvComp();
void setVideoEvComp(qreal ev);
- int imageFlashMode() const;
+ int imageFlashMode();
void setImageFlashMode(int mode);
- int imageIso() const;
+ int imageIso();
void setImageIso(int iso);
- QString imageAspectRatio() const;
+ QString imageAspectRatio();
void setImageAspectRatio(const QString& aspectRatio);
- QString imageResolution() const;
+ QString imageResolution();
void setImageResolution(const QString& resolution);
- QString videoAspectRatio() const;
+ QString videoAspectRatio();
void setVideoAspectRatio(const QString& aspectRatio);
- QString videoResolution() const;
+ QString videoResolution();
void setVideoResolution(const QString& resolution);
+ bool isSoundEnabled() const;
+ void setSoundEnabled(bool enabled);
+
+ bool isVideoTorchOn();
+ void setVideoTorchOn(bool on);
+
+ bool isToolBarShown() const;
+ void setToolBarShown(bool shown);
+
+ bool isVideoMuted() const;
+ void setVideoMuted(bool muted);
+
+ bool isGridEnabled() const;
+ void setGridEnabled(bool enabled);
+
+ bool isFaceDetectionEnabled() const;
+ void setFaceDetectionEnabled(bool enabled);
+
+ bool isZoomAsShutterEnabled() const;
+ void setZoomAsShutterEnabled(bool enabled);
+
+ bool isProximityAsShutterEnabled() const;
+ void setProximityAsShutterEnabled(bool enabled);
+
+ int device() const;
+ void setDevice(int device);
+
+ QString fileNamingStamp(const QString& id) const;
+ void setFileNamingStamp(const QString& id, const QString& stamp);
+
+ int fileNamingCounter(const QString& id) const;
+ void setFileNamingCounter(const QString& id, int counter);
+
signals:
void modeChanged();
void creatorNameChanged();
- void postCaptureTimeoutChanged();
void useGpsChanged();
void useGeotagsChanged();
void imageSceneModeChanged();
void imageResolutionChanged();
void videoAspectRatioChanged();
void videoResolutionChanged();
+ void soundEnabledChanged();
+ void videoTorchOnChanged();
+ void toolBarShownChanged();
+ void videoMutedChanged();
+ void gridEnabledChanged();
+ void faceDetectionEnabledChanged();
+ void zoomAsShutterChanged();
+ void proximityAsShutterChanged();
+ void deviceAboutToChange();
+ void deviceChanged();
private:
+ DeviceSettings *deviceSettings();
+ QVariant deviceValue(const char *key, const QVariant& defaultValue);
+ void setDeviceValue(const char *key, const QVariant& value);
+
QSettings *m_settings;
+ DeviceSettings *m_device;
};
#endif /* SETTINGS_H */