Kill DeclarativeQtCameraNotifications
authorMohammed Sameer <msameer@foolab.org>
Thu, 25 Jul 2013 20:13:22 +0000 (23:13 +0300)
committerMohammed Sameer <msameer@foolab.org>
Thu, 25 Jul 2013 20:13:22 +0000 (23:13 +0300)
Sounds class will handle all sound playback.
Location of audio files will be part of PlatformSettings instead of QtCamConfig

16 files changed:
data/n9/cameraplus.ini
data/n9/qtcamera.ini
declarative/camera.cpp
declarative/camera.h
declarative/declarative.pro
declarative/declarativeqtcameranotifications.h [deleted file]
declarative/notificationscontainer.cpp
declarative/notificationscontainer.h
declarative/plugin.cpp
declarative/sounds.cpp
declarative/sounds.h
lib/qtcamconfig.cpp
lib/qtcamconfig.h
qml/CameraView.qml
src/platformsettings.cpp
src/platformsettings.h

index 6bc3995..9c801a3 100644 (file)
@@ -26,3 +26,10 @@ path = /
 interface = com.nokia.maemo.meegotouch.ShareUiInterface
 dest = com.nokia.ShareUi
 method = share:share
+
+[sounds]
+imageCaptureStarted = /usr/share/sounds/ui-tones//snd_camera_shutter.wav
+imageCaptureEnded = 
+videoRecordingStarted = /usr/share/sounds/ui-tones//snd_camera_video_record_start.wav
+videoRecordingEnded = /usr/share/sounds/ui-tones//snd_camera_video_record_stop.wav
+autoFocusAcquired = /usr/share/sounds/ui-tones//snd_camera_af.wav
index a9c4595..72d8434 100644 (file)
@@ -166,14 +166,6 @@ night = 10
 aspectratio=16:9
 resolution=720p
 
-
-[sounds]
-imageCaptureStarted = /usr/share/sounds/ui-tones//snd_camera_shutter.wav
-imageCaptureEnded = 
-videoRecordingStarted = /usr/share/sounds/ui-tones//snd_camera_video_record_start.wav
-videoRecordingEnded = /usr/share/sounds/ui-tones//snd_camera_video_record_stop.wav
-autoFocusAcquired = /usr/share/sounds/ui-tones//snd_camera_af.wav
-
 [viewfinder-filters]
 elements = facetracking, motiondetect
 
index f4e4a63..252a6c2 100644 (file)
@@ -26,7 +26,7 @@
 #include "qtcamvideomode.h"
 #include "qtcamgraphicsviewfinder.h"
 #include "qtcamconfig.h"
-#include "declarativeqtcameranotifications.h"
+#include "sounds.h"
 #include "notificationscontainer.h"
 #include "sounds.h"
 #include <QDeclarativeInfo>
@@ -280,19 +280,13 @@ QString Camera::videoSuffix() const {
   return m_cam->config()->videoSuffix();
 }
 
-DeclarativeQtCameraNotifications *Camera::notifications() const {
-  return m_notifications->notifications();
+Sounds *Camera::sounds() const {
+  return m_notifications->sounds();
 }
-
-void Camera::setNotifications(DeclarativeQtCameraNotifications *notifications) {
-  if (m_notifications->setNotifications(notifications)) {
-
-    if (Sounds *s = dynamic_cast<Sounds *>(notifications)) {
-      s->setConfig(m_cam->config());
-      s->reload();
-    }
-
-    emit notificationsChanged();
+void Camera::setSounds(Sounds *sounds) {
+  if (m_notifications->setSounds(sounds)) {
+    sounds->reload();
+    emit soundsChanged();
   }
 }
 
index 76830f7..68e4d25 100644 (file)
@@ -30,7 +30,7 @@
 class QtCamera;
 class QtCamDevice;
 class QtCamGraphicsViewfinder;
-class DeclarativeQtCameraNotifications;
+class Sounds;
 class NotificationsContainer;
 class Zoom;
 class Flash;
@@ -60,7 +60,7 @@ class Camera : public QDeclarativeItem {
   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(Sounds *sounds READ sounds WRITE setSounds NOTIFY soundsChanged);
 
   Q_PROPERTY(QRectF renderArea READ renderArea NOTIFY renderAreaChanged);
   Q_PROPERTY(QSizeF videoResolution READ videoResolution NOTIFY videoResolutionChanged);
@@ -122,8 +122,8 @@ public:
   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;
@@ -159,7 +159,7 @@ signals:
   void idleStateChanged();
   void runningStateChanged();
   void error(const QString& message, int code, const QString& debug);
-  void notificationsChanged();
+  void soundsChanged();
   void renderAreaChanged();
   void videoResolutionChanged();
 
index 47bd976..3621bea 100644 (file)
@@ -28,8 +28,6 @@ SOURCES += plugin.cpp previewprovider.cpp camera.cpp mode.cpp imagemode.cpp vide
            notificationscontainer.cpp sounds.cpp focus.cpp autofocus.cpp \
            roi.cpp cameraconfig.cpp videoplayer.cpp
 
-HEADERS += declarativeqtcameranotifications.h
-
 PLUGIN_IMPORT_PATH = QtCamera
 target.path = $$[QT_INSTALL_IMPORTS]/$$PLUGIN_IMPORT_PATH
 
diff --git a/declarative/declarativeqtcameranotifications.h b/declarative/declarativeqtcameranotifications.h
deleted file mode 100644 (file)
index 3c7c3e8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// -*- c++ -*-
-
-/*!
- * This file is part of CameraPlus.
- *
- * 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef DECLARATIVE_QT_CAMERA_NOTIFICATIONS_H
-#define DECLARATIVE_QT_CAMERA_NOTIFICATIONS_H
-
-#include <QObject>
-
-class DeclarativeQtCameraNotifications {
-public:
-  DeclarativeQtCameraNotifications() {}
-  virtual ~DeclarativeQtCameraNotifications() {}
-
-  virtual void imageCaptureStarted() = 0;
-  virtual void imageCaptureEnded() = 0;
-  virtual void videoRecordingStarted() = 0;
-  virtual void videoRecordingEnded() = 0;
-  virtual void autoFocusAcquired() = 0;
-};
-Q_DECLARE_INTERFACE(DeclarativeQtCameraNotifications, "org.foolab.qml.CameraPlus.Notifications/1.0");
-
-#endif /* DECLARATIVE_QT_CAMERA_NOTIFICATIONS_H */
index bf864f4..691fb61 100644 (file)
 #include "notificationscontainer.h"
 #include "qtcamdevice.h"
 #include "qtcamnotifications.h"
-#include "declarativeqtcameranotifications.h"
+#include "sounds.h"
 
 NotificationsContainer::NotificationsContainer(QObject *parent) :
-  QObject(parent), m_dev(0), m_notifications(0) {
+  QObject(parent), m_dev(0), m_sounds(0) {
 
 }
 
@@ -32,7 +32,7 @@ NotificationsContainer::~NotificationsContainer() {
   setDevice(0);
 
   QMutexLocker locker(&m_mutex);
-  m_notifications = 0;
+  m_sounds = 0;
 }
 
 void NotificationsContainer::setDevice(QtCamDevice *dev) {
@@ -62,15 +62,15 @@ void NotificationsContainer::setDevice(QtCamDevice *dev) {
   }
 }
 
-DeclarativeQtCameraNotifications *NotificationsContainer::notifications() const {
-  return m_notifications;
+Sounds *NotificationsContainer::sounds() const {
+  return m_sounds;
 }
 
-bool NotificationsContainer::setNotifications(DeclarativeQtCameraNotifications *notifications) {
+bool NotificationsContainer::setSounds(Sounds *sounds) {
   QMutexLocker lock(&m_mutex);
 
-  if (m_notifications != notifications) {
-    m_notifications = notifications;
+  if (m_sounds != sounds) {
+    m_sounds = sounds;
     return true;
   }
 
@@ -80,39 +80,39 @@ bool NotificationsContainer::setNotifications(DeclarativeQtCameraNotifications *
 void NotificationsContainer::imageCaptureStarted() {
   QMutexLocker l(&m_mutex);
 
-  if (m_notifications) {
-    m_notifications->imageCaptureStarted();
+  if (m_sounds) {
+    m_sounds->playImageCaptureStartedSound();
   }
 }
 
 void NotificationsContainer::imageCaptureEnded() {
   QMutexLocker l(&m_mutex);
 
-  if (m_notifications) {
-    m_notifications->imageCaptureEnded();
+  if (m_sounds) {
+    m_sounds->playImageCaptureEndedSound();
   }
 }
 
 void NotificationsContainer::videoRecordingStarted() {
   QMutexLocker l(&m_mutex);
 
-  if (m_notifications) {
-    m_notifications->videoRecordingStarted();
+  if (m_sounds) {
+    m_sounds->playVideoRecordingStartedSound();
   }
 }
 
 void NotificationsContainer::videoRecordingEnded() {
   QMutexLocker l(&m_mutex);
 
-  if (m_notifications) {
-    m_notifications->videoRecordingEnded();
+  if (m_sounds) {
+    m_sounds->playVideoRecordingEndedSound();
   }
 }
 
 void NotificationsContainer::autoFocusAcquired() {
   QMutexLocker l(&m_mutex);
 
-  if (m_notifications) {
-    m_notifications->autoFocusAcquired();
+  if (m_sounds) {
+    m_sounds->playAutoFocusAcquiredSound();
   }
 }
index a9fa504..3e4b6b9 100644 (file)
@@ -28,7 +28,7 @@
 #include <QMutex>
 
 class QtCamDevice;
-class DeclarativeQtCameraNotifications;
+class Sounds;
 
 class NotificationsContainer : public QObject {
   Q_OBJECT
@@ -38,8 +38,8 @@ public:
   ~NotificationsContainer();
 
   void setDevice(QtCamDevice *dev);
-  DeclarativeQtCameraNotifications *notifications() const;
-  bool setNotifications(DeclarativeQtCameraNotifications *notifications);
+  Sounds *sounds() const;
+  bool setSounds(Sounds *sounds);
 
 private slots:
   void imageCaptureStarted();
@@ -50,7 +50,7 @@ private slots:
 
 private:
   QPointer<QtCamDevice> m_dev;
-  DeclarativeQtCameraNotifications *m_notifications;
+  Sounds *m_sounds;
   QMutex m_mutex;
 };
 
index 1676e60..7302341 100644 (file)
@@ -44,7 +44,6 @@
 #include "imageresolutionmodel.h"
 #include "videosettings.h"
 #include "videoresolutionmodel.h"
-#include "declarativeqtcameranotifications.h"
 #include "sounds.h"
 #include "cameraconfig.h"
 #include "videoplayer.h"
@@ -97,7 +96,6 @@ void Plugin::registerTypes(const char *uri) {
   qmlRegisterType<ImageSettings>(uri, MAJOR, MINOR, "ImageSettings");
   qmlRegisterType<VideoSettings>(uri, MAJOR, MINOR, "VideoSettings");
   qmlRegisterType<Sounds>(uri, MAJOR, MINOR, "Sounds");
-  qmlRegisterInterface<DeclarativeQtCameraNotifications>("DeclarativeQtCameraNotifications");
 
   qmlRegisterUncreatableType<ImageResolutionModel>(uri, MAJOR, MINOR, "ImageResolutionModel",
                          "ImageResolutionModel can be obtained from ImageSettings");
index 5301f4b..238024b 100644 (file)
@@ -43,7 +43,6 @@ Sounds::Sounds(QObject *parent) :
   QObject(parent),
   m_muted(false),
   m_ctx(0),
-  m_conf(0),
   m_watcher(new QDBusServiceWatcher("org.pulseaudio.Server",
                                    QDBusConnection::systemBus(),
                                    QDBusServiceWatcher::WatchForOwnerChange)) {
@@ -69,10 +68,6 @@ Sounds::~Sounds() {
   }
 }
 
-void Sounds::setConfig(QtCamConfig *conf) {
-  m_conf = conf;
-}
-
 void Sounds::serviceOwnerChanged(const QString& serviceName, const QString& oldOwner,
                                 const QString& newOwner) {
   Q_UNUSED(serviceName);
@@ -90,7 +85,7 @@ void Sounds::serviceOwnerChanged(const QString& serviceName, const QString& oldO
   }
 }
 
-void Sounds::imageCaptureStarted() {
+void Sounds::playImageCaptureStartedSound() {
   if (isMuted() || !m_ctx) {
     return;
   }
@@ -98,7 +93,7 @@ void Sounds::imageCaptureStarted() {
   play(CAMERA_IMAGE_START_SOUND_ID);
 }
 
-void Sounds::imageCaptureEnded() {
+void Sounds::playImageCaptureEndedSound() {
   if (isMuted() || !m_ctx) {
     return;
   }
@@ -106,7 +101,7 @@ void Sounds::imageCaptureEnded() {
   play(CAMERA_IMAGE_END_SOUND_ID);
 }
 
-void Sounds::videoRecordingStarted() {
+void Sounds::playVideoRecordingStartedSound() {
   if (isMuted() || !m_ctx) {
     return;
   }
@@ -114,7 +109,7 @@ void Sounds::videoRecordingStarted() {
   playAndBlock(CAMERA_VIDEO_START_SOUND_ID);
 }
 
-void Sounds::videoRecordingEnded() {
+void Sounds::playVideoRecordingEndedSound() {
   if (isMuted() || !m_ctx) {
     return;
   }
@@ -122,7 +117,7 @@ void Sounds::videoRecordingEnded() {
   play(CAMERA_VIDEO_STOP_SOUND_ID);
 }
 
-void Sounds::autoFocusAcquired() {
+void Sounds::playAutoFocusAcquiredSound() {
   if (isMuted() || !m_ctx) {
     return;
   }
@@ -175,11 +170,11 @@ void Sounds::reload() {
     return;
   }
 
-  cache(m_conf->imageCaptureStartedSound(), CAMERA_IMAGE_START_SOUND_ID);
-  cache(m_conf->imageCaptureEndedSound(), CAMERA_IMAGE_END_SOUND_ID);
-  cache(m_conf->videoRecordingStartedSound(), CAMERA_VIDEO_START_SOUND_ID);
-  cache(m_conf->videoRecordingEndedSound(), CAMERA_VIDEO_STOP_SOUND_ID);
-  cache(m_conf->autoFocusAcquiredSound(), CAMERA_FOCUS_SOUND_ID);
+  cache(m_imageCaptureStart, CAMERA_IMAGE_START_SOUND_ID);
+  cache(m_imageCaptureEnd, CAMERA_IMAGE_END_SOUND_ID);
+  cache(m_videoRecordingStart, CAMERA_VIDEO_START_SOUND_ID);
+  cache(m_videoRecordingEnd, CAMERA_VIDEO_STOP_SOUND_ID);
+  cache(m_autoFocusAcquired, CAMERA_FOCUS_SOUND_ID);
 }
 
 void Sounds::cache(const QString& path, const char *id) {
@@ -263,3 +258,63 @@ void Sounds::audioConnectionChanged() {
     m_volume = CANBERRA_FULL_VOLUME;
   }
 }
+
+QString Sounds::imageCaptureStart() const {
+  return m_imageCaptureStart;
+}
+
+void Sounds::setImageCaptureStart(const QString& path) {
+  if (path != m_imageCaptureStart) {
+    m_imageCaptureStart = path;
+    cache(m_imageCaptureStart, CAMERA_IMAGE_START_SOUND_ID);
+    emit imageCaptureStartChanged();
+  }
+}
+
+QString Sounds::imageCaptureEnd() const {
+  return m_imageCaptureEnd;
+}
+
+void Sounds::setImageCaptureEnd(const QString& path) {
+  if (path != m_imageCaptureEnd) {
+    m_imageCaptureEnd = path;
+    cache(m_imageCaptureEnd, CAMERA_IMAGE_END_SOUND_ID);
+    emit imageCaptureEndChanged();
+  }
+}
+
+QString Sounds::videoRecordingStart() const {
+  return m_videoRecordingStart;
+}
+
+void Sounds::setVideoRecordingStart(const QString& path) {
+  if (path != m_videoRecordingStart) {
+    m_videoRecordingStart = path;
+    cache(m_videoRecordingStart, CAMERA_VIDEO_START_SOUND_ID);
+    emit videoRecordingStartChanged();
+  }
+}
+
+QString Sounds::videoRecordingEnd() const {
+  return m_videoRecordingEnd;
+}
+
+void Sounds::setVideoRecordingEnd(const QString& path) {
+  if (path != m_videoRecordingEnd) {
+    m_videoRecordingEnd = path;
+    cache(m_videoRecordingEnd, CAMERA_VIDEO_STOP_SOUND_ID);
+    emit videoRecordingEndChanged();
+  }
+}
+
+QString Sounds::autoFocusAcquired() const {
+  return m_autoFocusAcquired;
+}
+
+void Sounds::setAutoFocusAcquired(const QString& path) {
+  if (path != m_autoFocusAcquired) {
+    m_autoFocusAcquired = path;
+    cache(m_autoFocusAcquired, CAMERA_FOCUS_SOUND_ID);
+    emit autoFocusAcquiredChanged();
+  }
+}
index c4951e4..813093b 100644 (file)
 #define SOUNDS_H
 
 #include <QObject>
-#include "declarativeqtcameranotifications.h"
 #include <canberra.h>
 
-class QtCamConfig;
 class QDBusServiceWatcher;
 class ContextProperty;
 
-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,
@@ -68,10 +100,14 @@ private:
 
   bool m_muted;
   ca_context *m_ctx;
-  QtCamConfig *m_conf;
   QDBusServiceWatcher *m_watcher;
   ContextProperty *m_audioRoute;
   QString m_volume;
+  QString m_imageCaptureStart;
+  QString m_imageCaptureEnd;
+  QString m_videoRecordingStart;
+  QString m_videoRecordingEnd;
+  QString m_autoFocusAcquired;
 };
 
 #endif /* SOUNDS_H */
index 7c4620d..7200f64 100644 (file)
@@ -196,26 +196,6 @@ QString QtCamConfig::videoSuffix() const {
   return d_ptr->conf->value("video/extension").toString();
 }
 
-QString QtCamConfig::imageCaptureStartedSound() const {
-  return d_ptr->conf->value("sounds/imageCaptureStarted").toString();
-}
-
-QString QtCamConfig::imageCaptureEndedSound() const {
-  return d_ptr->conf->value("sounds/imageCaptureEnded").toString();
-}
-
-QString QtCamConfig::videoRecordingStartedSound() const {
-  return d_ptr->conf->value("sounds/videoRecordingStarted").toString();
-}
-
-QString QtCamConfig::videoRecordingEndedSound() const {
-  return d_ptr->conf->value("sounds/videoRecordingEnded").toString();
-}
-
-QString QtCamConfig::autoFocusAcquiredSound() const {
-  return d_ptr->conf->value("sounds/autoFocusAcquired").toString();
-}
-
 QStringList QtCamConfig::viewfinderFilters() const {
   return d_ptr->conf->value("viewfinder-filters/elements").toStringList();
 }
index 3fa00c7..a5eac06 100644 (file)
@@ -76,12 +76,6 @@ public:
 
   QString audioCaptureCaps() const;
 
-  QString imageCaptureStartedSound() const;
-  QString imageCaptureEndedSound() const;
-  QString videoRecordingStartedSound() const;
-  QString videoRecordingEndedSound() const;
-  QString autoFocusAcquiredSound() const;
-
   QStringList viewfinderFilters() const;
 
   QString roiElement() const;
index d68c4e2..80d5579 100644 (file)
@@ -61,9 +61,14 @@ Camera {
         }
     }
 
-    notifications: Sounds {
+    sounds: Sounds {
         id: sounds
         mute: !settings.soundEnabled
+        imageCaptureStart: platformSettings.imageCaptureStartedSound
+        imageCaptureEnd: platformSettings.imageCaptureEndedSound
+        videoRecordingStart: platformSettings.videoRecordingStartedSound
+        videoRecordingEnd: platformSettings.videoRecordingEndedSound
+        autoFocusAcquired: platformSettings.autoFocusAcquiredSound
     }
 
     BatteryInfo {
index 2d20498..536b9e4 100644 (file)
@@ -123,3 +123,23 @@ PlatformSettings::Service PlatformSettings::service(const QString& id) {
 
   return service;
 }
+
+QString PlatformSettings::imageCaptureStartedSound() const {
+  return m_settings->value("sounds/imageCaptureStarted").toString();
+}
+
+QString PlatformSettings::imageCaptureEndedSound() const {
+  return m_settings->value("sounds/imageCaptureEnded").toString();
+}
+
+QString PlatformSettings::videoRecordingStartedSound() const {
+  return m_settings->value("sounds/videoRecordingStarted").toString();
+}
+
+QString PlatformSettings::videoRecordingEndedSound() const {
+  return m_settings->value("sounds/videoRecordingEnded").toString();
+}
+
+QString PlatformSettings::autoFocusAcquiredSound() const {
+  return m_settings->value("sounds/autoFocusAcquired").toString();
+}
index cb51a12..338f1ee 100644 (file)
@@ -32,6 +32,12 @@ class QSettings;
 class PlatformSettings : public QObject {
   Q_OBJECT
 
+  Q_PROPERTY(QString imageCaptureStartedSound READ imageCaptureStartedSound CONSTANT);
+  Q_PROPERTY(QString imageCaptureEndedSound READ imageCaptureEndedSound CONSTANT);
+  Q_PROPERTY(QString videoRecordingStartedSound READ videoRecordingStartedSound CONSTANT);
+  Q_PROPERTY(QString videoRecordingEndedSound READ videoRecordingEndedSound CONSTANT);
+  Q_PROPERTY(QString autoFocusAcquiredSound READ autoFocusAcquiredSound CONSTANT);
+
 public:
   PlatformSettings(QObject *parent = 0);
   ~PlatformSettings();
@@ -57,6 +63,12 @@ public:
 
   Service service(const QString& id);
 
+  QString imageCaptureStartedSound() const;
+  QString imageCaptureEndedSound() const;
+  QString videoRecordingStartedSound() const;
+  QString videoRecordingEndedSound() const;
+  QString autoFocusAcquiredSound() const;
+
 public slots:
   void init();