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 src="/resources/js/libs/utils.js">/**/</script>
<script data-main="/resources/js/main" src="/resources/vendors/require/require.min.js">/**/</script> <script data-main="/resources/js/main" src="/resources/vendors/require/require.min.js">/**/</script>
</head> </head>
<body class="loading"> <body class="loading"></body>
</body>
</html> </html>

@ -2,6 +2,8 @@
/*jslint laxcomma:true */ /*jslint laxcomma:true */
/*jslint loopfunc:true */ /*jslint loopfunc:true */
/*jslint strict:true */ /*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
require.config({ require.config({
shim: { shim: {
"jquery-ui": ["jquery"] "jquery-ui": ["jquery"]
@ -90,20 +92,19 @@ require.config({
, urlArgs: "v=0.3.2" , urlArgs: "v=0.3.2"
}); });
require( require([
[ "app"
"app"
, "jquery" , "jquery"
] ]
, function __fnMainRequireLoader( App, $ ) { , function __fnMainRequireLoader ( App, $ ) {
"use strict"; "use strict";
// JQuery Backwords compatibility fix // JQuery Backwords compatibility fix
$.curCSS = $.css; $.curCSS = $.css;
$("body").ready(function __fnAppRequireLoader(){ $("body").ready(function __fnAppRequireLoader () {
window.App = new App(); // 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" , "jquery"
, "backbone" , "backbone"
, "modules/webaudio"
, "text!../../templates/player/layout.html" , "text!../../templates/player/layout.html"
, "text!../../templates/player/player-status.html" , "text!../../templates/player/player-status.html"
] ]
@ -17,6 +19,8 @@ _
, $ , $
, Backbone , Backbone
, WebAudio
, tmplPlayerLayout , tmplPlayerLayout
, tmplPlayerStatus , tmplPlayerStatus
) { ) {
@ -42,12 +46,26 @@ _
, _stateAudio: null , _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) { , initialize: function (options) {
var that = this var that = this
; ;
_.bindAll(this _.bindAll(this
, "setPlayIndex"
, "setRandomState" , "setRandomState"
, "setRepeatState" , "setRepeatState"
, "__buttonPlayPause" , "__buttonPlayPause"
@ -56,6 +74,7 @@ _
, "__buttonVolumeUp" , "__buttonVolumeUp"
, "__buttonVolumeDown" , "__buttonVolumeDown"
, "__buttonVolumeClick" , "__buttonVolumeClick"
, "__buttonSeek"
, "_createWebAudio" , "_createWebAudio"
, "__waStateChanged" , "__waStateChanged"
, "_playerEnded" , "_playerEnded"
@ -66,6 +85,8 @@ _
, "_playerStop" , "_playerStop"
, "_playerStart" , "_playerStart"
, "_setVolume" , "_setVolume"
, "_getItemData"
, "_getItemMediaUrl"
, "_setViewport" , "_setViewport"
, "_updateViewportProgress" , "_updateViewportProgress"
); );
@ -84,6 +105,9 @@ _
return that; return that;
} }
/**
* PUBLIC
**/
, setPlayIndex: function (index) { , setPlayIndex: function (index) {
var that = this var that = this
; ;
@ -102,6 +126,9 @@ _
} }
/**
* EVENTS
**/
, __buttonPlayPause: function (event) { , __buttonPlayPause: function (event) {
var that = this var that = this
; ;
@ -138,6 +165,16 @@ _
} }
, __buttonSeek: function (event) {
var that = this
;
}
/**
* PRIVATE
**/
// Audio Player
, _createWebAudio: function () { , _createWebAudio: function () {
var that = this var that = this
; ;
@ -150,6 +187,7 @@ _
} }
// Player Controls
, _playerEnded: function () { , _playerEnded: function () {
var that = this var that = this
; ;
@ -198,6 +236,19 @@ _
} }
// Viewport methods
, _getItemData: function (item) {
var that = this
;
}
, _getItemMediaUrl: function (item) {
var that = this
;
}
, _setViewport: function (item) { , _setViewport: function (item) {
var that = this var that = this
; ;

Loading…
Cancel
Save