{"action":"opened","number":162,"pull_request":{"url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/162","id":40946034,"html_url":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine/pull/162","diff_url":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine/pull/162.diff","patch_url":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine/pull/162.patch","issue_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues/162","number":162,"state":"open","locked":false,"title":"feature/osx: AEAudioFilePlayer: add postRenderBlock() and expose lengthInFrames","user":{"login":"crontab","id":1698529,"avatar_url":"https://avatars.githubusercontent.com/u/1698529?v=3","gravatar_id":"","url":"https://api.github.com/users/crontab","html_url":"https://github.com/crontab","followers_url":"https://api.github.com/users/crontab/followers","following_url":"https://api.github.com/users/crontab/following{/other_user}","gists_url":"https://api.github.com/users/crontab/gists{/gist_id}","starred_url":"https://api.github.com/users/crontab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crontab/subscriptions","organizations_url":"https://api.github.com/users/crontab/orgs","repos_url":"https://api.github.com/users/crontab/repos","events_url":"https://api.github.com/users/crontab/events{/privacy}","received_events_url":"https://api.github.com/users/crontab/received_events","type":"User","site_admin":false},"body":"Why is this needed?\r\n\r\nConsider you need to apply an envelope or other time-based effect on a file and you play it in a loop, and on top of that the user can move currentTime arbitrarily. To ensure your effect is applied at exact right times, with frame precision, you'd need to know the current frame position in a file in your render routine. However, exposing AEAudioFilePlayer's _playhead directly may not be a very good idea.\r\n\r\nOn the other hand, there's AEAudioFilePlayer.currentTime, from which you can derive the playhead position, but you don't want to access a public property from within your high-priotiy code.\r\n\r\nI suggest, instead, to provide a high-priority callback block (postRenderBlock) that's called at the end of the AEAudioFilePlayer's render routine and takes a copy of _playhead as an argument (actually it takes originalPlayhead, which is the value of _playhead at the beginning of the render callback).\r\n\r\nAdditionally this patch exposes lengthInFrames as a read-only property. This is not absolutely necessary though, as there is the duration property, but still.\r\n\r\nThis small addition can greatly simplify e.g. your envelope implementation. Mine took literally a couple of dozen lines.\r\n\r\nUnless I'm missing something about TAAE of course. Please feel free to criticize!","created_at":"2015-07-27T20:34:40Z","updated_at":"2015-07-27T20:34:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/162/commits","review_comments_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/162/comments","review_comment_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues/162/comments","statuses_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/statuses/d8db0b36078f8795bb4252845603ba43d2336ca0","head":{"label":"crontab:feature/osx","ref":"feature/osx","sha":"d8db0b36078f8795bb4252845603ba43d2336ca0","user":{"login":"crontab","id":1698529,"avatar_url":"https://avatars.githubusercontent.com/u/1698529?v=3","gravatar_id":"","url":"https://api.github.com/users/crontab","html_url":"https://github.com/crontab","followers_url":"https://api.github.com/users/crontab/followers","following_url":"https://api.github.com/users/crontab/following{/other_user}","gists_url":"https://api.github.com/users/crontab/gists{/gist_id}","starred_url":"https://api.github.com/users/crontab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crontab/subscriptions","organizations_url":"https://api.github.com/users/crontab/orgs","repos_url":"https://api.github.com/users/crontab/repos","events_url":"https://api.github.com/users/crontab/events{/privacy}","received_events_url":"https://api.github.com/users/crontab/received_events","type":"User","site_admin":false},"repo":{"id":39696830,"name":"TheAmazingAudioEngine","full_name":"crontab/TheAmazingAudioEngine","owner":{"login":"crontab","id":1698529,"avatar_url":"https://avatars.githubusercontent.com/u/1698529?v=3","gravatar_id":"","url":"https://api.github.com/users/crontab","html_url":"https://github.com/crontab","followers_url":"https://api.github.com/users/crontab/followers","following_url":"https://api.github.com/users/crontab/following{/other_user}","gists_url":"https://api.github.com/users/crontab/gists{/gist_id}","starred_url":"https://api.github.com/users/crontab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crontab/subscriptions","organizations_url":"https://api.github.com/users/crontab/orgs","repos_url":"https://api.github.com/users/crontab/repos","events_url":"https://api.github.com/users/crontab/events{/privacy}","received_events_url":"https://api.github.com/users/crontab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crontab/TheAmazingAudioEngine","description":"Core Audio, Cordially: A sophisticated framework for iOS audio applications, built so you don't have to.","fork":true,"url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine","forks_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/forks","keys_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/teams","hooks_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/hooks","issue_events_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/issues/events{/number}","events_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/events","assignees_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/assignees{/user}","branches_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/branches{/branch}","tags_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/tags","blobs_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/languages","stargazers_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/stargazers","contributors_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/contributors","subscribers_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/subscribers","subscription_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/subscription","commits_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/contents/{+path}","compare_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/merges","archive_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/downloads","issues_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/issues{/number}","pulls_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/labels{/name}","releases_url":"https://api.github.com/repos/crontab/TheAmazingAudioEngine/releases{/id}","created_at":"2015-07-25T18:03:37Z","updated_at":"2015-07-25T18:03:38Z","pushed_at":"2015-07-27T20:10:32Z","git_url":"git://github.com/crontab/TheAmazingAudioEngine.git","ssh_url":"git@github.com:crontab/TheAmazingAudioEngine.git","clone_url":"https://github.com/crontab/TheAmazingAudioEngine.git","svn_url":"https://github.com/crontab/TheAmazingAudioEngine","homepage":null,"size":29934,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"TheAmazingAudioEngine:feature/osx","ref":"feature/osx","sha":"d352e3dfd9efe9dcbb9ba35f3ce28865243cb3b2","user":{"login":"TheAmazingAudioEngine","id":2557419,"avatar_url":"https://avatars.githubusercontent.com/u/2557419?v=3","gravatar_id":"","url":"https://api.github.com/users/TheAmazingAudioEngine","html_url":"https://github.com/TheAmazingAudioEngine","followers_url":"https://api.github.com/users/TheAmazingAudioEngine/followers","following_url":"https://api.github.com/users/TheAmazingAudioEngine/following{/other_user}","gists_url":"https://api.github.com/users/TheAmazingAudioEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/TheAmazingAudioEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheAmazingAudioEngine/subscriptions","organizations_url":"https://api.github.com/users/TheAmazingAudioEngine/orgs","repos_url":"https://api.github.com/users/TheAmazingAudioEngine/repos","events_url":"https://api.github.com/users/TheAmazingAudioEngine/events{/privacy}","received_events_url":"https://api.github.com/users/TheAmazingAudioEngine/received_events","type":"User","site_admin":false},"repo":{"id":6214210,"name":"TheAmazingAudioEngine","full_name":"TheAmazingAudioEngine/TheAmazingAudioEngine","owner":{"login":"TheAmazingAudioEngine","id":2557419,"avatar_url":"https://avatars.githubusercontent.com/u/2557419?v=3","gravatar_id":"","url":"https://api.github.com/users/TheAmazingAudioEngine","html_url":"https://github.com/TheAmazingAudioEngine","followers_url":"https://api.github.com/users/TheAmazingAudioEngine/followers","following_url":"https://api.github.com/users/TheAmazingAudioEngine/following{/other_user}","gists_url":"https://api.github.com/users/TheAmazingAudioEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/TheAmazingAudioEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheAmazingAudioEngine/subscriptions","organizations_url":"https://api.github.com/users/TheAmazingAudioEngine/orgs","repos_url":"https://api.github.com/users/TheAmazingAudioEngine/repos","events_url":"https://api.github.com/users/TheAmazingAudioEngine/events{/privacy}","received_events_url":"https://api.github.com/users/TheAmazingAudioEngine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine","description":"Core Audio, Cordially: A sophisticated framework for iOS audio applications, built so you don't have to.","fork":false,"url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine","forks_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/forks","keys_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/teams","hooks_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/hooks","issue_events_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues/events{/number}","events_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/events","assignees_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/assignees{/user}","branches_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/branches{/branch}","tags_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/tags","blobs_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/languages","stargazers_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/stargazers","contributors_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/contributors","subscribers_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/subscribers","subscription_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/subscription","commits_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/contents/{+path}","compare_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/merges","archive_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/downloads","issues_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues{/number}","pulls_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/labels{/name}","releases_url":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/releases{/id}","created_at":"2012-10-14T14:09:04Z","updated_at":"2015-07-27T18:41:55Z","pushed_at":"2015-07-26T22:29:45Z","git_url":"git://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine.git","ssh_url":"git@github.com:TheAmazingAudioEngine/TheAmazingAudioEngine.git","clone_url":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine.git","svn_url":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine","homepage":null,"size":29934,"stargazers_count":1910,"watchers_count":1910,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":382,"mirror_url":null,"open_issues_count":35,"forks":382,"open_issues":35,"watchers":1910,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/162"},"html":{"href":"https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine/pull/162"},"issue":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues/162"},"comments":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/TheAmazingAudioEngine/TheAmazingAudioEngine/statuses/d8db0b36078f8795bb4252845603ba43d2336ca0"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":10,"deletions":3,"changed_files":3}}