diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-12-14 16:53:43 -0500 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-12-14 16:53:43 -0500 |
| commit | 5030376f650715c255047b004f35d62511b516e5 (patch) | |
| tree | aaf692bf35854faea8154dbb9f859b125e7c5e61 | |
| parent | e8a21f8042cf417b31781939730b0d31d24e7937 (diff) | |
event speed changes
Former-commit-id: fba320d1aa3cb03edc4009341b1304f3f6c71697
| -rw-r--r-- | www/js/ModalCtrl.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 1f2a6c74..0e1385cf 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -584,7 +584,49 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco }); + // Playback speed adjuster + $scope.adjustSpeed = function (val) + { + switch(val) { + + case "super": + $scope.eventSpeed = 20/$scope.event.Event.Frames; + stopOrPlay.setDuration($scope.eventSpeed); + break; + case "normal": + $scope.eventSpeed = $scope.event.Event.Length/$scope.event.Event.Frames; + //$scope.eventSpeed = 5; + stopOrPlay.setDuration($scope.eventSpeed); + + break; + case "faster": + $scope.eventSpeed = $scope.eventSpeed / 2; + if ($scope.eventSpeed <20/$scope.event.Event.Frames) + $scope.eventSpeed = 10/$scope.event.Event.Frames; + stopOrPlay.setDuration($scope.eventSpeed); + break; + case "slower": + $scope.eventSpeed = $scope.eventSpeed * 2; + stopOrPlay.setDuration($scope.eventSpeed); + + break; + default: + + } + ZMDataModel.zmDebug("Set playback speed to "+$scope.eventSpeed); + + $ionicLoading.show({ + template: 'playback interval: '+$scope.eventSpeed.toFixed(3)+"ms", + animation: 'fade-in', + showBackdrop: false, + duration: 1500, + maxWidth: 300, + showDelay: 0 + }); + + + }; $scope.toggleGapless = function() @@ -945,6 +987,8 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco $scope.mycarousel.index = 0; $scope.ionRange.index = 1; + $scope.eventSpeed = $scope.event.Event.Length/$scope.event.Event.Frames; + //console.log("**Resetting range"); $scope.slides = []; var i; |
