Merge lp:~schwann/qtubuntu-camera/camera-click-sound into lp:qtubuntu-camera

Proposed by Günter Schwann
Status: Merged
Approved by: Günter Schwann
Approved revision: 85
Merged at revision: 84
Proposed branch: lp:~schwann/qtubuntu-camera/camera-click-sound
Merge into: lp:qtubuntu-camera
Diff against target: 57 lines (+8/-1)
2 files modified
src/aalimagecapturecontrol.cpp (+6/-1)
src/aalimagecapturecontrol.h (+2/-0)
To merge this branch: bzr merge lp:~schwann/qtubuntu-camera/camera-click-sound
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Thomas Moenicke (community) Approve
Review via email: mp+185989@code.launchpad.net

Commit message

Play sound when capturing a photo fixes LP: #1220736

Description of the change

Play sound when capturing a photo fixes LP: #1220736

To post a comment you must log in.
Revision history for this message
Thomas Moenicke (thomas-moenicke) wrote :

maybe delete it in destructor

85. By Günter Schwann

Explicitly delete the m_audioPlayer object

Revision history for this message
Thomas Moenicke (thomas-moenicke) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/aalimagecapturecontrol.cpp'
2--- src/aalimagecapturecontrol.cpp 2013-06-24 07:00:43 +0000
3+++ src/aalimagecapturecontrol.cpp 2013-09-17 09:30:23 +0000
4@@ -27,6 +27,7 @@
5 #include <QDir>
6 #include <QFile>
7 #include <QFileInfo>
8+#include <QMediaPlayer>
9 #include <QStandardPaths>
10 #include <QTemporaryFile>
11
12@@ -44,13 +45,16 @@
13 m_photoWidth(320),
14 m_photoHeight(240),
15 m_aspectRatio(0.0),
16- m_screenAspectRatio(0.0)
17+ m_screenAspectRatio(0.0),
18+ m_audioPlayer(new QMediaPlayer(this))
19 {
20 m_galleryPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
21+ m_audioPlayer->setMedia(QUrl::fromLocalFile("/system/media/audio/ui/camera_click.ogg"));
22 }
23
24 AalImageCaptureControl::~AalImageCaptureControl()
25 {
26+ delete(m_audioPlayer);
27 }
28
29 bool AalImageCaptureControl::isReadyForCapture() const
30@@ -157,6 +161,7 @@
31
32 void AalImageCaptureControl::shutter()
33 {
34+ m_audioPlayer->play();
35 Q_EMIT imageExposed(m_lastRequestId);
36 }
37
38
39=== modified file 'src/aalimagecapturecontrol.h'
40--- src/aalimagecapturecontrol.h 2013-06-24 07:00:43 +0000
41+++ src/aalimagecapturecontrol.h 2013-09-17 09:30:23 +0000
42@@ -27,6 +27,7 @@
43 class AalCameraControl;
44 class CameraControl;
45 class CameraControlListener;
46+class QMediaPlayer;
47
48 class AalImageCaptureControl : public QCameraImageCaptureControl
49 {
50@@ -81,6 +82,7 @@
51 /// currently selected camera
52 QList<float> m_prioritizedAspectRatios;
53 QString m_galleryPath;
54+ QMediaPlayer *m_audioPlayer;
55 };
56
57 #endif

Subscribers

People subscribed via source and target branches