X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=declarative%2Fsounds.h;h=9184d26a4e4a5bced841419c7112a4c7c366eb43;hp=27dbae3a8584effea067004136eb6600b2e9e073;hb=639e4278c097fd53eb04c2e7b10327e177774676;hpb=b37f9df89dc20000f88767537caf4415746a34a5 diff --git a/declarative/sounds.h b/declarative/sounds.h index 27dbae3..9184d26 100644 --- a/declarative/sounds.h +++ b/declarative/sounds.h @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,36 +24,68 @@ #define SOUNDS_H #include -#include "declarativeqtcameranotifications.h" #include -class QtCamConfig; class QDBusServiceWatcher; -class Sounds : public QObject, public DeclarativeQtCameraNotifications { +class Sounds : public QObject { Q_OBJECT - Q_INTERFACES(DeclarativeQtCameraNotifications); Q_PROPERTY(bool mute READ isMuted WRITE setMuted NOTIFY muteChanged); + Q_PROPERTY(QString imageCaptureStart READ imageCaptureStart WRITE setImageCaptureStart NOTIFY imageCaptureStartChanged); + Q_PROPERTY(QString imageCaptureEnd READ imageCaptureEnd WRITE setImageCaptureEnd NOTIFY imageCaptureEndChanged); + Q_PROPERTY(QString videoRecordingStart READ videoRecordingStart WRITE setVideoRecordingStart NOTIFY videoRecordingStartChanged); + Q_PROPERTY(QString videoRecordingEnd READ videoRecordingEnd WRITE setVideoRecordingEnd NOTIFY videoRecordingEndChanged); + Q_PROPERTY(QString autoFocusAcquired READ autoFocusAcquired WRITE setAutoFocusAcquired NOTIFY autoFocusAcquiredChanged); + Q_PROPERTY(Volume volume READ volume WRITE setVolume NOTIFY volumeChanged); + Q_ENUMS(Volume); public: Sounds(QObject *parent = 0); ~Sounds(); - void imageCaptureStarted(); - void imageCaptureEnded(); - void videoRecordingStarted(); - void videoRecordingEnded(); - void autoFocusAcquired(); + typedef enum { + VolumeLow, + VolumeHigh, + } Volume; + + void playImageCaptureStartedSound(); + void playImageCaptureEndedSound(); + void playVideoRecordingStartedSound(); + void playVideoRecordingEndedSound(); + void playAutoFocusAcquiredSound(); bool isMuted() const; void setMuted(bool mute); - void setConfig(QtCamConfig *conf); + Volume volume() const; + void setVolume(const Volume& volume); + void reload(); + QString imageCaptureStart() const; + void setImageCaptureStart(const QString& path); + + QString imageCaptureEnd() const; + void setImageCaptureEnd(const QString& path); + + QString videoRecordingStart() const; + void setVideoRecordingStart(const QString& path); + + QString videoRecordingEnd() const; + void setVideoRecordingEnd(const QString& path); + + QString autoFocusAcquired() const; + void setAutoFocusAcquired(const QString& path); + signals: void muteChanged(); + void volumeChanged(); + void imageCaptureStartChanged(); + void imageCaptureEndChanged(); + void videoRecordingStartChanged(); + void videoRecordingEndChanged(); + void autoFocusAcquiredChanged(); private slots: void serviceOwnerChanged(const QString& serviceName, const QString& oldOwner, @@ -66,8 +98,14 @@ private: bool m_muted; ca_context *m_ctx; - QtCamConfig *m_conf; + Volume m_volume; QDBusServiceWatcher *m_watcher; + QString m_volumeString; + QString m_imageCaptureStart; + QString m_imageCaptureEnd; + QString m_videoRecordingStart; + QString m_videoRecordingEnd; + QString m_autoFocusAcquired; }; #endif /* SOUNDS_H */