1
0
Fork 0

Added webaudio module files, small lint changes and comments

master
Matthieu Lalonde 12 years ago
parent 3562e762ef
commit e5c2ba602a

@ -26,6 +26,5 @@
<script src="/resources/js/libs/utils.js">/**/</script>
<script data-main="/resources/js/main" src="/resources/vendors/require/require.min.js">/**/</script>
</head>
<body class="loading">
</body>
<body class="loading"></body>
</html>

@ -2,6 +2,8 @@
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
require.config({
shim: {
"jquery-ui": ["jquery"]
@ -90,20 +92,19 @@ require.config({
, urlArgs: "v=0.3.2"
});
require(
[
"app"
require([
"app"
, "jquery"
]
, function __fnMainRequireLoader( App, $ ) {
"use strict";
, "jquery"
]
, function __fnMainRequireLoader ( App, $ ) {
"use strict";
// JQuery Backwords compatibility fix
$.curCSS = $.css;
// JQuery Backwords compatibility fix
$.curCSS = $.css;
$("body").ready(function __fnAppRequireLoader(){
window.App = new App();
});
}
);
$("body").ready(function __fnAppRequireLoader () {
// We export App to window for debuging purposes.
window.App = new App();
});
});

@ -0,0 +1,18 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
define([
"underscore"
]
, function (
_
) {
"use strict";
var WebAudio = function() {};
return WebAudio;
});

@ -9,6 +9,8 @@ define([
, "jquery"
, "backbone"
, "modules/webaudio"
, "text!../../templates/player/layout.html"
, "text!../../templates/player/player-status.html"
]
@ -17,6 +19,8 @@ _
, $
, Backbone
, WebAudio
, tmplPlayerLayout
, tmplPlayerStatus
) {
@ -42,12 +46,26 @@ _
, _stateAudio: null
, events: {
//"click #add-friend": "showPrompt",
"click div:first-child > a.buttonPrev": "__buttonPrevious"
, "click div:first-child > a.buttonNext": "__buttonNext"
, "click div:first-child > a.buttonPlay": "__buttonPlayPause"
// Volume Down
, "click div:first-child > .playerVolumeWrapper > a:first-child": "__buttonVolumeDown"
// Volume Up
, "click div:first-child > .playerVolumeWrapper > a:last-child": "__buttonVolumeUp"
// Volume click
, "click div:first-child > .playerVolumeWrapper > input": "__buttonVolumeClick"
// Seek input
, "click div:last-child > .playerProgressWrapper > progress": "__buttonSeek"
}
, initialize: function (options) {
var that = this
;
_.bindAll(this
, "setPlayIndex"
, "setRandomState"
, "setRepeatState"
, "__buttonPlayPause"
@ -56,6 +74,7 @@ _
, "__buttonVolumeUp"
, "__buttonVolumeDown"
, "__buttonVolumeClick"
, "__buttonSeek"
, "_createWebAudio"
, "__waStateChanged"
, "_playerEnded"
@ -66,6 +85,8 @@ _
, "_playerStop"
, "_playerStart"
, "_setVolume"
, "_getItemData"
, "_getItemMediaUrl"
, "_setViewport"
, "_updateViewportProgress"
);
@ -84,6 +105,9 @@ _
return that;
}
/**
* PUBLIC
**/
, setPlayIndex: function (index) {
var that = this
;
@ -102,6 +126,9 @@ _
}
/**
* EVENTS
**/
, __buttonPlayPause: function (event) {
var that = this
;
@ -138,6 +165,16 @@ _
}
, __buttonSeek: function (event) {
var that = this
;
}
/**
* PRIVATE
**/
// Audio Player
, _createWebAudio: function () {
var that = this
;
@ -150,6 +187,7 @@ _
}
// Player Controls
, _playerEnded: function () {
var that = this
;
@ -198,6 +236,19 @@ _
}
// Viewport methods
, _getItemData: function (item) {
var that = this
;
}
, _getItemMediaUrl: function (item) {
var that = this
;
}
, _setViewport: function (item) {
var that = this
;

Loading…
Cancel
Save