summaryrefslogtreecommitdiffstats
path: root/assets/js/models/sample.js
diff options
context:
space:
mode:
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 79cbace..d059f6b 100644
--- a/assets/js/models/sample.js
+++ b/assets/js/models/sample.js
@@ -10,6 +10,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;
+ }
+ console.log(minutes + ':' + 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() {
}