-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMP.controller.js.html
386 lines (324 loc) · 12.4 KB
/
MP.controller.js.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DocStrap Source: MP.controller.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cosmo.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">DocStrap</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="MemoryPlayerAPI.html">MemoryPlayerAPI</a></li><li><a href="MemoryPlayerComponent.html">MemoryPlayerComponent</a></li><li><a href="MemoryPlayerConfig.html">MemoryPlayerConfig</a></li><li><a href="MemoryPlayerController.html">MemoryPlayerController</a></li><li><a href="MemoryPlayerControls.html">MemoryPlayerControls</a></li><li><a href="MemoryPlayerProvider.html">MemoryPlayerProvider</a></li><li><a href="MemoryPlayerRun.html">MemoryPlayerRun</a></li><li><a href="MemoryPlayerSharing.html">MemoryPlayerSharing</a></li><li><a href="MemoryPlayerState.html">MemoryPlayerState</a></li><li><a href="MPPlayerController.html">MPPlayerController</a></li><li><a href="MPSharingComponent.html">MPSharingComponent</a></li><li><a href="MPSharingController.html">MPSharingController</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-12">
<div id="main">
<h1 class="page-title">Source: MP.controller.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var MemoryPlayerController = /** @class */ (function () {
/**
* Implements IController
* @constructs MemoryPlayerController
* @param {IScope} $scope - The core angular scope service.
* @param {IMemoryPlayerState} MemoryPlayerState - The service that manages memory player state.
* @param {IMemoryPlayerControls} MemoryPlayerControls - The service that manages memory player controls.
* @param {IMemoryPlayerSharing} MemoryPlayerSharing - The service that manages memory player link sharing.
*/
function MemoryPlayerController($scope, MemoryPlayerState, MemoryPlayerControls, MemoryPlayerSharing) {
var _this = this;
this.$scope = $scope;
this.MemoryPlayerState = MemoryPlayerState;
this.MemoryPlayerControls = MemoryPlayerControls;
this.MemoryPlayerSharing = MemoryPlayerSharing;
// Turns on sharing
this.isShareable = true;
// Sets initial state of player
this.playlists = this.MemoryPlayerState.getPlaylists();
this.currentPlaylist = this.MemoryPlayerState.getPlaylist();
this.currentTrack = this.MemoryPlayerState.getTrack();
this.isPaused = this.MemoryPlayerState.getIsPaused();
// Watches state service for playlists change
this.$scope.$watch(function () {
return _this.MemoryPlayerState.getPlaylists();
}, function (newPlaylists, oldPlaylists) {
// If playlists change then update
if (angular.isDefined(newPlaylists) && newPlaylists !== oldPlaylists) {
// Updates playlists
_this.playlists = newPlaylists;
}
});
// Watches state service for playlist change
this.$scope.$watch(function () {
return _this.MemoryPlayerState.getPlaylist();
}, function (newPlaylist, oldPlaylist) {
// If playlist changes then update
if (angular.isDefined(newPlaylist) && newPlaylist !== oldPlaylist) {
// Updates current playlist
_this.currentPlaylist = newPlaylist;
}
});
// Watches state service for track change
this.$scope.$watch(function () {
return _this.MemoryPlayerState.getTrack();
}, function (newTrack, oldTrack) {
// If track changes then update
if (angular.isDefined(newTrack) && newTrack !== oldTrack) {
// Updates current track
_this.currentTrack = newTrack;
}
});
// Watches state service for play state change
this.$scope.$watch(function () {
return _this.MemoryPlayerState.getIsPaused();
}, function (newState, oldState) {
// If play state changes then update
if (angular.isDefined(newState) && newState !== oldState) {
// Updates play state
_this.isPaused = newState;
}
});
}
/**
* Implements cancel timer method of {@link MemoryPlayerSharing}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.cancelTimer = function () {
this.MemoryPlayerSharing.cancelTimer();
};
/**
* Implements max volume method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.maxVolume = function () {
this.MemoryPlayerControls.maxVolume();
};
/**
* Implements toggle mute and unmute method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.mute = function () {
this.MemoryPlayerControls.mute();
};
/**
* Implements play next track method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.next = function () {
this.MemoryPlayerControls.next();
};
/**
* Implements toggle play and pause method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.play = function () {
this.MemoryPlayerControls.play();
};
/**
* Implements play previous track method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.previous = function () {
this.MemoryPlayerControls.previous();
};
/**
* Implements play selected playlist method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
* @param {string} playlistName - The name of selected playlist.
*/
MemoryPlayerController.prototype.selectPlaylist = function (playlistName) {
this.MemoryPlayerControls.selectPlaylist(playlistName);
};
/**
* Implements play selected track method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
* @param {number} trackIndex - The index of selected track in playlist.
*/
MemoryPlayerController.prototype.selectTrack = function (trackIndex) {
this.MemoryPlayerControls.selectTrack(trackIndex);
};
/**
* Implements share method of {@link MemoryPlayerSharing}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.share = function () {
this.MemoryPlayerSharing.share();
};
/**
* Implements toggle playlist dropdown method of {@link MemoryPlayerControls}
* @memberof MemoryPlayerController
* @instance
* @param {JQueryEventObject} $event - The event from trigger element.
*/
MemoryPlayerController.prototype.toggleDropdown = function ($event) {
this.MemoryPlayerControls.toggleDropdown($event);
};
/**
* Implements update time method of {@link MemoryPlayerSharing}
* @memberof MemoryPlayerController
* @instance
* @param {string} updatedTime - The updated sharelink time.
*/
MemoryPlayerController.prototype.updateTime = function (updatedTime) {
this.MemoryPlayerSharing.updateTime(updatedTime);
};
/**
* Implements toggle use time method of {@link MemoryPlayerSharing}
* @memberof MemoryPlayerController
* @instance
*/
MemoryPlayerController.prototype.useTime = function () {
this.MemoryPlayerSharing.useTime();
};
MemoryPlayerController.instance = [
'$scope',
'MemoryPlayerState',
'MemoryPlayerControls',
'MemoryPlayerSharing',
MemoryPlayerController
];
return MemoryPlayerController;
}());
(function () {
'use strict';
angular.module('MemoryPlayer')
.controller('MemoryPlayerController', MemoryPlayerController.instance);
})();
</pre>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="copyright">
DocStrap Copyright © 2012-2017 The contributors to the JSDoc3 and DocStrap projects.
</span>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
on Mon Sep 10th 2018
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>