Permalink
Browse files

Conflict fixed

  • Loading branch information...
2 parents 06c41f2 + 386c594 commit 8193c2ca249ff0125d0d4599d3668dd0c91f50a2 @janmyler committed Jun 20, 2012
Showing with 21 additions and 14 deletions.
  1. +1 −1 index.html
  2. +20 −13 js/Audiee/Views.PlaybackControls.js
View
@@ -34,7 +34,7 @@
<div class="container-fluid">
<div class="pull-left editable" id="project-name"></div>
<div class="btn-toolbar" id="playback-controls">
- <input type="text" id="time-display" value="- : -">
+ <input type="text" id="time-display" value="-:--:--.---">
<button class="btn" id="play" title="play"><i class="icon-play"></i></button>
<button class="btn" id="stop" title="stop" ><i class="icon-stop"></i></button>
<button class="btn following" id="follow" title="toggle follow"><i class="icon-eye-open"></i><i class="icon-eye-close"></i></button>
@@ -44,17 +44,24 @@ define([
if (typeof currentTime === 'undefined')
currentTime = 0;
- var min = Math.floor(currentTime / 60),
- sec = currentTime % 60,
- i;
+ var hour = Math.floor(currentTime / 60 / 60);
+ currentTime -= hour * 60 * 60;
- // number to string conversion and string shortening
- sec += '';
- i = sec.indexOf('.');
- if (i !== -1)
- sec = sec.substring(0, i + 4);
+ var minute = Math.floor(currentTime / 60);
+ currentTime -= minute * 60;
- this.el.children('#time-display').val(min + ' : ' + sec);
+ var second = Math.floor(currentTime);
+ currentTime -= second;
+
+ var milli = '' + Math.floor(currentTime * 1000);
+
+ if (minute < 10) minute = '0' + minute;
+ if (second < 10) second = '0' + second;
+ while (milli.length < 3) {
+ milli = '0' + milli;
+ }
+
+ this.el.children('#time-display').val(hour + ':' + minute + ':' + second + '.' + milli);
},
play: function() {
@@ -70,7 +77,7 @@ define([
stop: function() {
if (Audiee.Collections.Tracks.length <= 0)
return;
-
+
var $play = $('#play');
Audiee.Player.stop();
@@ -84,12 +91,12 @@ define([
handleKey: function(e) {
if (!Audiee.Views.Menu.hotkeysEnabled)
- return;
+ return;
switch(e.which) {
- case 32:
+ case 32:
if (e.type === 'keydown' && !this.pressingKey) {
- if (Audiee.Player.playing)
+ if (Audiee.Player.playing)
$('#stop').trigger('click');
else
$('#play').trigger('click');

0 comments on commit 8193c2c

Please sign in to comment.