{"action":"created","comment":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/25138271","id":25138271,"diff_hunk":"@@ -61,62 +65,55 @@ void QuantizeControl::trackUnloaded(TrackPointer pTrack) {\n void QuantizeControl::slotBeatsUpdated() {\n     if (m_pTrack) {\n         m_pBeats = m_pTrack->getBeats();\n+        setCurrentSample(0, 0);\n     }\n }\n \n-double QuantizeControl::process(const double dRate,\n-                                const double currentSample,\n-                                const double totalSamples,\n-                                const int iBufferSize) {\n-    Q_UNUSED(dRate);\n-    Q_UNUSED(totalSamples);\n-    Q_UNUSED(iBufferSize);\n-\n-    if (!m_pBeats) {\n-        return kNoTrigger;\n+void QuantizeControl::setCurrentSample(const double dCurrentSample,\n+                                       const double dTotalSamples) {\n+    if (dCurrentSample == getCurrentSample()) {\n+        // No need to recalculate.","path":"src/engine/quantizecontrol.cpp","position":39,"original_position":39,"commit_id":"aa11e4d8799a1e3100369a4a76436e773fbde071","original_commit_id":"c378c96a7315ef6c1558e02c9329034872d7d3cf","user":{"login":"rryan","id":26527,"avatar_url":"https://avatars.githubusercontent.com/u/26527?v=3","gravatar_id":"","url":"https://api.github.com/users/rryan","html_url":"https://github.com/rryan","followers_url":"https://api.github.com/users/rryan/followers","following_url":"https://api.github.com/users/rryan/following{/other_user}","gists_url":"https://api.github.com/users/rryan/gists{/gist_id}","starred_url":"https://api.github.com/users/rryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rryan/subscriptions","organizations_url":"https://api.github.com/users/rryan/orgs","repos_url":"https://api.github.com/users/rryan/repos","events_url":"https://api.github.com/users/rryan/events{/privacy}","received_events_url":"https://api.github.com/users/rryan/received_events","type":"User","site_admin":false},"body":"unless the beat object changed since the last calculation","created_at":"2015-02-22T23:14:48Z","updated_at":"2015-02-22T23:14:48Z","html_url":"https://github.com/mixxxdj/mixxx/pull/497#discussion_r25138271","pull_request_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497","_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/25138271"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/497#discussion_r25138271"},"pull_request":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497"}}},"pull_request":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497","id":29772531,"html_url":"https://github.com/mixxxdj/mixxx/pull/497","diff_url":"https://github.com/mixxxdj/mixxx/pull/497.diff","patch_url":"https://github.com/mixxxdj/mixxx/pull/497.patch","issue_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/497","number":497,"state":"open","locked":false,"title":"Refactor beat lookups","user":{"login":"ywwg","id":888940,"avatar_url":"https://avatars.githubusercontent.com/u/888940?v=3","gravatar_id":"","url":"https://api.github.com/users/ywwg","html_url":"https://github.com/ywwg","followers_url":"https://api.github.com/users/ywwg/followers","following_url":"https://api.github.com/users/ywwg/following{/other_user}","gists_url":"https://api.github.com/users/ywwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ywwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywwg/subscriptions","organizations_url":"https://api.github.com/users/ywwg/orgs","repos_url":"https://api.github.com/users/ywwg/repos","events_url":"https://api.github.com/users/ywwg/events{/privacy}","received_events_url":"https://api.github.com/users/ywwg/received_events","type":"User","site_admin":false},"body":"This is where the real beat-lookup mutex savings is found -- the quantize control already sets control objects for next and previous beat, so bpmcontrol should use them instead of doing its own lookup.  This is a more risky change because it relies on the timing of the updated values being ready when bpmcontrol needs them, but it's easy to check that the current sample being calculated is inside the span of the beats.  In the long run it should actually reduce flakiness because all parts of the engine are using the same beat position values.  Tests still pass.","created_at":"2015-02-22T16:23:08Z","updated_at":"2015-02-22T23:14:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"667626658dd52c5012b47fa8882ad9cadb43663b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497/commits","review_comments_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497/comments","review_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/497/comments","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/aa11e4d8799a1e3100369a4a76436e773fbde071","head":{"label":"ywwg:beat-prev-next-quantizerefactor","ref":"beat-prev-next-quantizerefactor","sha":"aa11e4d8799a1e3100369a4a76436e773fbde071","user":{"login":"ywwg","id":888940,"avatar_url":"https://avatars.githubusercontent.com/u/888940?v=3","gravatar_id":"","url":"https://api.github.com/users/ywwg","html_url":"https://github.com/ywwg","followers_url":"https://api.github.com/users/ywwg/followers","following_url":"https://api.github.com/users/ywwg/following{/other_user}","gists_url":"https://api.github.com/users/ywwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ywwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywwg/subscriptions","organizations_url":"https://api.github.com/users/ywwg/orgs","repos_url":"https://api.github.com/users/ywwg/repos","events_url":"https://api.github.com/users/ywwg/events{/privacy}","received_events_url":"https://api.github.com/users/ywwg/received_events","type":"User","site_admin":false},"repo":{"id":10135825,"name":"mixxx","full_name":"ywwg/mixxx","owner":{"login":"ywwg","id":888940,"avatar_url":"https://avatars.githubusercontent.com/u/888940?v=3","gravatar_id":"","url":"https://api.github.com/users/ywwg","html_url":"https://github.com/ywwg","followers_url":"https://api.github.com/users/ywwg/followers","following_url":"https://api.github.com/users/ywwg/following{/other_user}","gists_url":"https://api.github.com/users/ywwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ywwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywwg/subscriptions","organizations_url":"https://api.github.com/users/ywwg/orgs","repos_url":"https://api.github.com/users/ywwg/repos","events_url":"https://api.github.com/users/ywwg/events{/privacy}","received_events_url":"https://api.github.com/users/ywwg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ywwg/mixxx","description":"Personal work branches for the mixxx project -- you may be interested in DJO-hacks-trunk, which contains a bunch of UNSUPPORTED tweaks I like","fork":true,"url":"https://api.github.com/repos/ywwg/mixxx","forks_url":"https://api.github.com/repos/ywwg/mixxx/forks","keys_url":"https://api.github.com/repos/ywwg/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ywwg/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ywwg/mixxx/teams","hooks_url":"https://api.github.com/repos/ywwg/mixxx/hooks","issue_events_url":"https://api.github.com/repos/ywwg/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/ywwg/mixxx/events","assignees_url":"https://api.github.com/repos/ywwg/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/ywwg/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/ywwg/mixxx/tags","blobs_url":"https://api.github.com/repos/ywwg/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ywwg/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ywwg/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/ywwg/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ywwg/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/ywwg/mixxx/languages","stargazers_url":"https://api.github.com/repos/ywwg/mixxx/stargazers","contributors_url":"https://api.github.com/repos/ywwg/mixxx/contributors","subscribers_url":"https://api.github.com/repos/ywwg/mixxx/subscribers","subscription_url":"https://api.github.com/repos/ywwg/mixxx/subscription","commits_url":"https://api.github.com/repos/ywwg/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/ywwg/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/ywwg/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/ywwg/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/ywwg/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/ywwg/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ywwg/mixxx/merges","archive_url":"https://api.github.com/repos/ywwg/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ywwg/mixxx/downloads","issues_url":"https://api.github.com/repos/ywwg/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/ywwg/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/ywwg/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/ywwg/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ywwg/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/ywwg/mixxx/releases{/id}","created_at":"2013-05-18T02:52:01Z","updated_at":"2015-02-20T22:28:35Z","pushed_at":"2015-02-22T20:58:57Z","git_url":"git://github.com/ywwg/mixxx.git","ssh_url":"git@github.com:ywwg/mixxx.git","clone_url":"https://github.com/ywwg/mixxx.git","svn_url":"https://github.com/ywwg/mixxx","homepage":"","size":240678,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mixxxdj:master","ref":"master","sha":"2b4eee284dbc9c1390e81cfd0d0178bcf91098dc","user":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"repo":{"id":10126031,"name":"mixxx","full_name":"mixxxdj/mixxx","owner":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixxxdj/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":false,"url":"https://api.github.com/repos/mixxxdj/mixxx","forks_url":"https://api.github.com/repos/mixxxdj/mixxx/forks","keys_url":"https://api.github.com/repos/mixxxdj/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixxxdj/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixxxdj/mixxx/teams","hooks_url":"https://api.github.com/repos/mixxxdj/mixxx/hooks","issue_events_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/mixxxdj/mixxx/events","assignees_url":"https://api.github.com/repos/mixxxdj/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/mixxxdj/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/mixxxdj/mixxx/tags","blobs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixxxdj/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixxxdj/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/mixxxdj/mixxx/languages","stargazers_url":"https://api.github.com/repos/mixxxdj/mixxx/stargazers","contributors_url":"https://api.github.com/repos/mixxxdj/mixxx/contributors","subscribers_url":"https://api.github.com/repos/mixxxdj/mixxx/subscribers","subscription_url":"https://api.github.com/repos/mixxxdj/mixxx/subscription","commits_url":"https://api.github.com/repos/mixxxdj/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixxxdj/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixxxdj/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/mixxxdj/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixxxdj/mixxx/merges","archive_url":"https://api.github.com/repos/mixxxdj/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixxxdj/mixxx/downloads","issues_url":"https://api.github.com/repos/mixxxdj/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/mixxxdj/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/mixxxdj/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixxxdj/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/mixxxdj/mixxx/releases{/id}","created_at":"2013-05-17T15:14:38Z","updated_at":"2015-02-22T23:09:41Z","pushed_at":"2015-02-22T23:09:40Z","git_url":"git://github.com/mixxxdj/mixxx.git","ssh_url":"git@github.com:mixxxdj/mixxx.git","clone_url":"https://github.com/mixxxdj/mixxx.git","svn_url":"https://github.com/mixxxdj/mixxx","homepage":"http://mixxx.org","size":313293,"stargazers_count":241,"watchers_count":241,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":36,"forks":194,"open_issues":36,"watchers":241,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/497"},"issue":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/497"},"comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/497/comments"},"review_comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497/comments"},"review_comment":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/497/commits"},"statuses":{"href":"https://api.github.com/repos/mixxxdj/mixxx/statuses/aa11e4d8799a1e3100369a4a76436e773fbde071"}}}}