Emit aspectRatioChanged() after we populate the model with new resolutions.
[harmattan/cameraplus] / declarative / sounds.h
1 // -*- c++ -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
7  *
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.
12  *
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.
17  *
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
21  */
22
23 #ifndef SOUNDS_H
24 #define SOUNDS_H
25
26 #include <QObject>
27 #include "declarativeqtcameranotifications.h"
28 #include <canberra.h>
29
30 class QtCamConfig;
31 class QDBusServiceWatcher;
32 class ContextProperty;
33
34 class Sounds : public QObject, public DeclarativeQtCameraNotifications {
35   Q_OBJECT
36   Q_INTERFACES(DeclarativeQtCameraNotifications);
37
38   Q_PROPERTY(bool mute READ isMuted WRITE setMuted NOTIFY muteChanged);
39
40 public:
41   Sounds(QObject *parent = 0);
42   ~Sounds();
43
44   void imageCaptureStarted();
45   void imageCaptureEnded();
46   void videoRecordingStarted();
47   void videoRecordingEnded();
48   void autoFocusAcquired();
49
50   bool isMuted() const;
51   void setMuted(bool mute);
52
53   void setConfig(QtCamConfig *conf);
54   void reload();
55
56 signals:
57   void muteChanged();
58
59 private slots:
60   void serviceOwnerChanged(const QString& serviceName, const QString& oldOwner,
61                            const QString& newOwner);
62   void audioConnectionChanged();
63
64 private:
65   void cache(const QString& path, const char *id);
66   void play(const char *id);
67   void playAndBlock(const char *id);
68
69   bool m_muted;
70   ca_context *m_ctx;
71   QtCamConfig *m_conf;
72   QDBusServiceWatcher *m_watcher;
73   ContextProperty *m_audioRoute;
74   QString m_volume;
75 };
76
77 #endif /* SOUNDS_H */