Skip to content

Commit

Permalink
Merge pull request #129 from MoodCat/fix/classify-timestamp
Browse files Browse the repository at this point in the history
Now applies  every second during classification to fix the timer. Fixes #114
  • Loading branch information
Tim van der Lippe authored and Tim van der Lippe committed Jun 25, 2015
2 parents a27270b + c284b50 commit fd4edc1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/scripts/controllers/classify/classifyController.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

angular.module('moodCatApp')
.controller('ClassifyCtrl', ['$scope', '$element', '$compile', 'classifySongService', 'songs', 'currentSongService', '$timeout', '$rootScope',
function ($scope, $element, $compile, classifySongService, songs, currentSongService, $timeout, $rootScope) {
.controller('ClassifyCtrl', ['$scope', '$element', '$compile', 'classifySongService', 'songs', 'currentSongService', '$timeout', '$interval','$rootScope',
function ($scope, $element, $compile, classifySongService, songs, currentSongService, $timeout, $interval, $rootScope) {

$scope.songs = songs;

Expand Down Expand Up @@ -32,9 +32,12 @@ angular.module('moodCatApp')
$rootScope.song = song;
$scope.feedbackSAM = true;

$rootScope.classifyUpdater = $interval($rootScope.$applyAsync(), 1000);

timeout = $timeout(function() {
if($rootScope.sound) {
$rootScope.sound.stop();
$interval.cancel($rootScope.classifyUpdater);
}
}, duration);

Expand Down

0 comments on commit fd4edc1

Please sign in to comment.