summaryrefslogtreecommitdiffstats
path: root/assets/js/models/sample.js
diff options
context:
space:
mode:
authorKawandeep Virdee2013-11-10 02:32:28 -0500
committerKawandeep Virdee2013-11-10 02:32:28 -0500
commit86ee62cc30c70fd2f248c0e13f016c271846b87d (patch)
treee97e4d79d85cddd6b27f73bce263984141aad901 /assets/js/models/sample.js
parent0a1841512314c204e7e54d1a18a63385faecd6b2 (diff)
parentd04aabc49ccb152b9997612a9896ad40539151f2 (diff)
downloadclip-play-86ee62cc30c70fd2f248c0e13f016c271846b87d.tar.bz2
Merge branch 'master' of github.com:whichlight/clip-play
Diffstat (limited to 'assets/js/models/sample.js')
-rw-r--r--assets/js/models/sample.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/assets/js/models/sample.js b/assets/js/models/sample.js
index 5179a7c..2c87344 100644
--- a/assets/js/models/sample.js
+++ b/assets/js/models/sample.js
@@ -16,6 +16,30 @@ ClipPlay.Models.Sample = Backbone.Model.extend({
}
},
+ in_minutes_and_seconds: function(seconds) {
+ var minutes = Math.floor(seconds / 60);
+ seconds = Math.floor(seconds);
+ var seconds = seconds - minutes * 60;
+
+ if (seconds < 10) {
+ seconds = '0' + seconds;
+ }
+
+ return {
+ minutes: minutes,
+ seconds: seconds
+ };
+ },
+
+ start_in_minutes_and_seconds: function() {
+ return this.in_minutes_and_seconds(this.get('start'));
+ },
+
+ stop_in_minutes_and_seconds: function() {
+ return this.in_minutes_and_seconds(this.get('stop'));
+ },
+
+
play: function() {
console.log('playing');
//play then pause