Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
49
gaia/apps/camera/js/controllers/sounds.js
Executable file
49
gaia/apps/camera/js/controllers/sounds.js
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
define(function(require, exports, module) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Dependencies
|
||||
*/
|
||||
|
||||
var debug = require('debug')('controller:sounds');
|
||||
var Sounds = require('lib/sounds');
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = function(app) { return new SoundsController(app); };
|
||||
module.exports.SoundsController = SoundsController;
|
||||
|
||||
/**
|
||||
* Initialize a new `SoundsController`
|
||||
*
|
||||
* @param {App} app [description]
|
||||
*/
|
||||
function SoundsController(app) {
|
||||
var list = app.settings.sounds.get('list');
|
||||
this.sounds = new Sounds(list);
|
||||
this.app = app;
|
||||
this.bindEvents();
|
||||
debug('initialized');
|
||||
}
|
||||
|
||||
SoundsController.prototype.bindEvents = function() {
|
||||
this.app.on('change:recording', this.onRecordingChange.bind(this));
|
||||
this.app.on('camera:willrecord', this.sounds.player('recordingStart'));
|
||||
this.app.on('camera:shutter', this.sounds.player('shutter'));
|
||||
this.app.on('countdown:immanent', this.sounds.player('countdown'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Plays the start/end recording sound.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
SoundsController.prototype.onRecordingChange = function(recording) {
|
||||
if (!recording) {
|
||||
this.sounds.play('recordingEnd');
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue