{"action":"created","comment":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments/48298001","id":48298001,"diff_hunk":"@@ -0,0 +1,212 @@\n+\n+#if defined _WIN32\n+#include <Mmdeviceapi.h> // Must be included before devpkey:\n+#include <Functiondiscoverykeys_devpkey.h>\n+#elif defined HAVE_ALSA && HAVE_ALSA\n+#include <alsa/asoundlib.h>\n+#endif\n+\n+#include \"AudioDevice.h\"\n+#include \"Common/StringUtil.h\"\n+#include \"Core/ConfigManager.h\"\n+\n+std::vector<AudioDevice> AudioDevice::devices;\n+// index 0 fits XAudio2_7 default, id \"default\" fits ALSA default\n+AudioDevice AudioDevice::DEFAULT = AudioDevice(0, \"Default audio device\", \"\", \"default\");\n+bool AudioDevice::loaded = false;\n+\n+void AudioDevice::LoadDevices()\n+{\n+\tdevices.clear();\n+\n+#if defined _WIN32\n+#define THROW_ON_ERROR(hr) if(FAILED(hr)) { throw hr; }\n+\n+\tHRESULT hr;\n+\n+\tIMMDeviceEnumerator* device_enumerator = NULL;\n+\tIMMDeviceCollection* device_collection = NULL;\n+\tu32 count = 0;\n+\n+\t// Some awful COM code to get the number of audio endpoints.\n+\ttry\n+\t{\n+\t\thr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&device_enumerator);\n+\t\tTHROW_ON_ERROR(hr);\n+\n+\t\thr = device_enumerator->EnumAudioEndpoints(EDataFlow::eRender, DEVICE_STATE_ACTIVE, &device_collection);\n+\t\tTHROW_ON_ERROR(hr);\n+\n+\t\thr = device_collection->GetCount(&count);\n+\t\tTHROW_ON_ERROR(hr);\n+\t}\n+\tcatch (HRESULT hresult)\n+\t{\n+\t\tERROR_LOG(AUDIO, \"Error while loading audio device list: %#X\", hresult);\n+\t}\n+\n+\t// Retrieve details for each audio endpoint.\n+\tfor (u32 i = 0; i < count; i++)\n+\t{\n+\t\tAudioDevice device;\n+\t\tdevice.index = i;\n+\n+\t\tLPWSTR id = NULL;\n+\t\tIPropertyStore* propStore = NULL;","path":"Source/Core/AudioCommon/AudioDevice.cpp","position":55,"original_position":55,"commit_id":"0c3a61a540f41b682bd22e5785c5d2e9c2a0994f","original_commit_id":"0c3a61a540f41b682bd22e5785c5d2e9c2a0994f","user":{"login":"lioncash","id":712067,"avatar_url":"https://avatars.githubusercontent.com/u/712067?v=3","gravatar_id":"","url":"https://api.github.com/users/lioncash","html_url":"https://github.com/lioncash","followers_url":"https://api.github.com/users/lioncash/followers","following_url":"https://api.github.com/users/lioncash/following{/other_user}","gists_url":"https://api.github.com/users/lioncash/gists{/gist_id}","starred_url":"https://api.github.com/users/lioncash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lioncash/subscriptions","organizations_url":"https://api.github.com/users/lioncash/orgs","repos_url":"https://api.github.com/users/lioncash/repos","events_url":"https://api.github.com/users/lioncash/events{/privacy}","received_events_url":"https://api.github.com/users/lioncash/received_events","type":"User","site_admin":false},"body":"nullptr","created_at":"2015-12-22T21:05:49Z","updated_at":"2015-12-22T21:05:49Z","html_url":"https://github.com/dolphin-emu/dolphin/pull/3378#discussion_r48298001","pull_request_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378","_links":{"self":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments/48298001"},"html":{"href":"https://github.com/dolphin-emu/dolphin/pull/3378#discussion_r48298001"},"pull_request":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378"}}},"pull_request":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378","id":54400903,"html_url":"https://github.com/dolphin-emu/dolphin/pull/3378","diff_url":"https://github.com/dolphin-emu/dolphin/pull/3378.diff","patch_url":"https://github.com/dolphin-emu/dolphin/pull/3378.patch","issue_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3378","number":3378,"state":"open","locked":false,"title":"Add audio output device changeability [WIP]","user":{"login":"Felk","id":1996138,"avatar_url":"https://avatars.githubusercontent.com/u/1996138?v=3","gravatar_id":"","url":"https://api.github.com/users/Felk","html_url":"https://github.com/Felk","followers_url":"https://api.github.com/users/Felk/followers","following_url":"https://api.github.com/users/Felk/following{/other_user}","gists_url":"https://api.github.com/users/Felk/gists{/gist_id}","starred_url":"https://api.github.com/users/Felk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Felk/subscriptions","organizations_url":"https://api.github.com/users/Felk/orgs","repos_url":"https://api.github.com/users/Felk/repos","events_url":"https://api.github.com/users/Felk/events{/privacy}","received_events_url":"https://api.github.com/users/Felk/received_events","type":"User","site_admin":false},"body":"This, as of the first commit, adds a dropdown menu to the audio settings, enabling the selection of the audio device to output to. It currently fully works on Windows, and a bit on Linux (displays too many devices atm, and only ALSA). This is a rather exotic feature to have, but I needed it for Windows, so I thought why not try to fully and cleanly implement it.\r\n\r\nIt still needs quite some work before this is actually mergeable, so please don't hold back giving feedback if required.","created_at":"2015-12-22T18:38:07Z","updated_at":"2015-12-22T21:05:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80eba958238081976317e252fa8b3f360e0e8277","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378/commits","review_comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378/comments","review_comment_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3378/comments","statuses_url":"https://api.github.com/repos/dolphin-emu/dolphin/statuses/0c3a61a540f41b682bd22e5785c5d2e9c2a0994f","head":{"label":"Felk:audio-device","ref":"audio-device","sha":"0c3a61a540f41b682bd22e5785c5d2e9c2a0994f","user":{"login":"Felk","id":1996138,"avatar_url":"https://avatars.githubusercontent.com/u/1996138?v=3","gravatar_id":"","url":"https://api.github.com/users/Felk","html_url":"https://github.com/Felk","followers_url":"https://api.github.com/users/Felk/followers","following_url":"https://api.github.com/users/Felk/following{/other_user}","gists_url":"https://api.github.com/users/Felk/gists{/gist_id}","starred_url":"https://api.github.com/users/Felk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Felk/subscriptions","organizations_url":"https://api.github.com/users/Felk/orgs","repos_url":"https://api.github.com/users/Felk/repos","events_url":"https://api.github.com/users/Felk/events{/privacy}","received_events_url":"https://api.github.com/users/Felk/received_events","type":"User","site_admin":false},"repo":{"id":42151962,"name":"dolphin","full_name":"Felk/dolphin","owner":{"login":"Felk","id":1996138,"avatar_url":"https://avatars.githubusercontent.com/u/1996138?v=3","gravatar_id":"","url":"https://api.github.com/users/Felk","html_url":"https://github.com/Felk","followers_url":"https://api.github.com/users/Felk/followers","following_url":"https://api.github.com/users/Felk/following{/other_user}","gists_url":"https://api.github.com/users/Felk/gists{/gist_id}","starred_url":"https://api.github.com/users/Felk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Felk/subscriptions","organizations_url":"https://api.github.com/users/Felk/orgs","repos_url":"https://api.github.com/users/Felk/repos","events_url":"https://api.github.com/users/Felk/events{/privacy}","received_events_url":"https://api.github.com/users/Felk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Felk/dolphin","description":"Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.","fork":true,"url":"https://api.github.com/repos/Felk/dolphin","forks_url":"https://api.github.com/repos/Felk/dolphin/forks","keys_url":"https://api.github.com/repos/Felk/dolphin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Felk/dolphin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Felk/dolphin/teams","hooks_url":"https://api.github.com/repos/Felk/dolphin/hooks","issue_events_url":"https://api.github.com/repos/Felk/dolphin/issues/events{/number}","events_url":"https://api.github.com/repos/Felk/dolphin/events","assignees_url":"https://api.github.com/repos/Felk/dolphin/assignees{/user}","branches_url":"https://api.github.com/repos/Felk/dolphin/branches{/branch}","tags_url":"https://api.github.com/repos/Felk/dolphin/tags","blobs_url":"https://api.github.com/repos/Felk/dolphin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Felk/dolphin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Felk/dolphin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Felk/dolphin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Felk/dolphin/statuses/{sha}","languages_url":"https://api.github.com/repos/Felk/dolphin/languages","stargazers_url":"https://api.github.com/repos/Felk/dolphin/stargazers","contributors_url":"https://api.github.com/repos/Felk/dolphin/contributors","subscribers_url":"https://api.github.com/repos/Felk/dolphin/subscribers","subscription_url":"https://api.github.com/repos/Felk/dolphin/subscription","commits_url":"https://api.github.com/repos/Felk/dolphin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Felk/dolphin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Felk/dolphin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Felk/dolphin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Felk/dolphin/contents/{+path}","compare_url":"https://api.github.com/repos/Felk/dolphin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Felk/dolphin/merges","archive_url":"https://api.github.com/repos/Felk/dolphin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Felk/dolphin/downloads","issues_url":"https://api.github.com/repos/Felk/dolphin/issues{/number}","pulls_url":"https://api.github.com/repos/Felk/dolphin/pulls{/number}","milestones_url":"https://api.github.com/repos/Felk/dolphin/milestones{/number}","notifications_url":"https://api.github.com/repos/Felk/dolphin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Felk/dolphin/labels{/name}","releases_url":"https://api.github.com/repos/Felk/dolphin/releases{/id}","created_at":"2015-09-09T02:47:37Z","updated_at":"2015-09-09T02:47:58Z","pushed_at":"2015-12-22T18:35:59Z","git_url":"git://github.com/Felk/dolphin.git","ssh_url":"git@github.com:Felk/dolphin.git","clone_url":"https://github.com/Felk/dolphin.git","svn_url":"https://github.com/Felk/dolphin","homepage":"https://dolphin-emu.org/","size":228349,"stargazers_count":0,"watchers_count":0,"language":"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":"dolphin-emu:master","ref":"master","sha":"1b69743ba14ebca7c51862b7df8da6751eb213f0","user":{"login":"dolphin-emu","id":5050316,"avatar_url":"https://avatars.githubusercontent.com/u/5050316?v=3","gravatar_id":"","url":"https://api.github.com/users/dolphin-emu","html_url":"https://github.com/dolphin-emu","followers_url":"https://api.github.com/users/dolphin-emu/followers","following_url":"https://api.github.com/users/dolphin-emu/following{/other_user}","gists_url":"https://api.github.com/users/dolphin-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/dolphin-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolphin-emu/subscriptions","organizations_url":"https://api.github.com/users/dolphin-emu/orgs","repos_url":"https://api.github.com/users/dolphin-emu/repos","events_url":"https://api.github.com/users/dolphin-emu/events{/privacy}","received_events_url":"https://api.github.com/users/dolphin-emu/received_events","type":"Organization","site_admin":false},"repo":{"id":11577304,"name":"dolphin","full_name":"dolphin-emu/dolphin","owner":{"login":"dolphin-emu","id":5050316,"avatar_url":"https://avatars.githubusercontent.com/u/5050316?v=3","gravatar_id":"","url":"https://api.github.com/users/dolphin-emu","html_url":"https://github.com/dolphin-emu","followers_url":"https://api.github.com/users/dolphin-emu/followers","following_url":"https://api.github.com/users/dolphin-emu/following{/other_user}","gists_url":"https://api.github.com/users/dolphin-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/dolphin-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolphin-emu/subscriptions","organizations_url":"https://api.github.com/users/dolphin-emu/orgs","repos_url":"https://api.github.com/users/dolphin-emu/repos","events_url":"https://api.github.com/users/dolphin-emu/events{/privacy}","received_events_url":"https://api.github.com/users/dolphin-emu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dolphin-emu/dolphin","description":"Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.","fork":false,"url":"https://api.github.com/repos/dolphin-emu/dolphin","forks_url":"https://api.github.com/repos/dolphin-emu/dolphin/forks","keys_url":"https://api.github.com/repos/dolphin-emu/dolphin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dolphin-emu/dolphin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dolphin-emu/dolphin/teams","hooks_url":"https://api.github.com/repos/dolphin-emu/dolphin/hooks","issue_events_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/events{/number}","events_url":"https://api.github.com/repos/dolphin-emu/dolphin/events","assignees_url":"https://api.github.com/repos/dolphin-emu/dolphin/assignees{/user}","branches_url":"https://api.github.com/repos/dolphin-emu/dolphin/branches{/branch}","tags_url":"https://api.github.com/repos/dolphin-emu/dolphin/tags","blobs_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/refs{/sha}","trees_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dolphin-emu/dolphin/statuses/{sha}","languages_url":"https://api.github.com/repos/dolphin-emu/dolphin/languages","stargazers_url":"https://api.github.com/repos/dolphin-emu/dolphin/stargazers","contributors_url":"https://api.github.com/repos/dolphin-emu/dolphin/contributors","subscribers_url":"https://api.github.com/repos/dolphin-emu/dolphin/subscribers","subscription_url":"https://api.github.com/repos/dolphin-emu/dolphin/subscription","commits_url":"https://api.github.com/repos/dolphin-emu/dolphin/commits{/sha}","git_commits_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/commits{/sha}","comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/comments{/number}","issue_comment_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/comments{/number}","contents_url":"https://api.github.com/repos/dolphin-emu/dolphin/contents/{+path}","compare_url":"https://api.github.com/repos/dolphin-emu/dolphin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dolphin-emu/dolphin/merges","archive_url":"https://api.github.com/repos/dolphin-emu/dolphin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dolphin-emu/dolphin/downloads","issues_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues{/number}","pulls_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls{/number}","milestones_url":"https://api.github.com/repos/dolphin-emu/dolphin/milestones{/number}","notifications_url":"https://api.github.com/repos/dolphin-emu/dolphin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dolphin-emu/dolphin/labels{/name}","releases_url":"https://api.github.com/repos/dolphin-emu/dolphin/releases{/id}","created_at":"2013-07-22T09:07:57Z","updated_at":"2015-12-22T10:15:25Z","pushed_at":"2015-12-22T21:05:06Z","git_url":"git://github.com/dolphin-emu/dolphin.git","ssh_url":"git@github.com:dolphin-emu/dolphin.git","clone_url":"https://github.com/dolphin-emu/dolphin.git","svn_url":"https://github.com/dolphin-emu/dolphin","homepage":"https://dolphin-emu.org/","size":250841,"stargazers_count":1886,"watchers_count":1886,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":576,"mirror_url":null,"open_issues_count":77,"forks":576,"open_issues":77,"watchers":1886,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378"},"html":{"href":"https://github.com/dolphin-emu/dolphin/pull/3378"},"issue":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3378"},"comments":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3378/comments"},"review_comments":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378/comments"},"review_comment":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3378/commits"},"statuses":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/statuses/0c3a61a540f41b682bd22e5785c5d2e9c2a0994f"}}}}