diff options
author | Angus Kong <shkong@google.com> | 2013-10-08 14:59:18 -0700 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2013-10-08 14:59:18 -0700 |
commit | f5aa51e6e8da349c8f1a604b431af243cc0802c0 (patch) | |
tree | 00b57553568b8897fa89b5b55ef9ba37710978f2 /src/com | |
parent | 94f5f216821c1090bd8a0660483935456dc13df1 (diff) | |
download | android_packages_apps_Snap-f5aa51e6e8da349c8f1a604b431af243cc0802c0.tar.gz android_packages_apps_Snap-f5aa51e6e8da349c8f1a604b431af243cc0802c0.tar.bz2 android_packages_apps_Snap-f5aa51e6e8da349c8f1a604b431af243cc0802c0.zip |
Add shutter click sound in SoundClips.
bug:11135055
Change-Id: Ib4396ada73021beff9845c49fee7c5eb8f4cc96d
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/SoundClips.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/camera/SoundClips.java b/src/com/android/camera/SoundClips.java index 3130aac68..e8e5ce733 100644 --- a/src/com/android/camera/SoundClips.java +++ b/src/com/android/camera/SoundClips.java @@ -35,6 +35,7 @@ public class SoundClips { public static final int FOCUS_COMPLETE = 0; public static final int START_VIDEO_RECORDING = 1; public static final int STOP_VIDEO_RECORDING = 2; + public static final int SHUTTER_CLICK = 3; public interface Player { public void release(); @@ -77,6 +78,7 @@ public class SoundClips { mSound.load(MediaActionSound.START_VIDEO_RECORDING); mSound.load(MediaActionSound.STOP_VIDEO_RECORDING); mSound.load(MediaActionSound.FOCUS_COMPLETE); + mSound.load(MediaActionSound.SHUTTER_CLICK); } @Override @@ -91,6 +93,9 @@ public class SoundClips { case STOP_VIDEO_RECORDING: mSound.play(MediaActionSound.STOP_VIDEO_RECORDING); break; + case SHUTTER_CLICK: + mSound.play(MediaActionSound.SHUTTER_CLICK); + break; default: Log.w(TAG, "Unrecognized action:" + action); } @@ -107,15 +112,15 @@ public class SoundClips { private static final String TAG = "SoundPoolPlayer"; private static final int NUM_SOUND_STREAMS = 1; private static final int[] SOUND_RES = { // Soundtrack res IDs. - R.raw.focus_complete, - R.raw.video_record + R.raw.focus_complete, + R.raw.video_record, }; // ID returned by load() should be non-zero. private static final int ID_NOT_LOADED = 0; // Maps a sound action to the id; - private final int[] mSoundRes = {0, 1, 1}; + private final int[] mSoundRes = {0, 1, 1, 1}; // Store the context for lazy loading. private Context mContext; // mSoundPool is created every time load() is called and cleared every |