{"action":"created","comment":{"url":"https://api.github.com/repos/ev3dev/brickman/pulls/comments/68341299","id":68341299,"diff_hunk":"@@ -0,0 +1,109 @@\n+/*\n+ * brickman -- Brick Manager for LEGO MINDSTORMS EV3/ev3dev\n+ *\n+ * Copyright (C) 2016 Kaelin Laundry <wasabifan@outlook.com>\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+\n+/*\n+ * MixerElementVolumeWindow.vala - Allows control of mixer element volume\n+ */\n+\n+using Ev3devKit;\n+using Ev3devKit.Ui;\n+\n+namespace BrickManager {\n+    public class MixerElementVolumeWindow : BrickManagerWindow {\n+        public signal void volume_up ();\n+        public signal void volume_down ();\n+        public signal void volume_min ();","path":"src/view/MixerElementVolumeWindow.vala","position":31,"original_position":31,"commit_id":"240ae1e1d7dd306b20d70348a640ebda3aae8d6d","original_commit_id":"240ae1e1d7dd306b20d70348a640ebda3aae8d6d","user":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"body":"can we call this `mute` instead of `volume_min`?","created_at":"2016-06-24T01:09:53Z","updated_at":"2016-06-24T01:09:53Z","html_url":"https://github.com/ev3dev/brickman/pull/8#discussion_r68341299","pull_request_url":"https://api.github.com/repos/ev3dev/brickman/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/ev3dev/brickman/pulls/comments/68341299"},"html":{"href":"https://github.com/ev3dev/brickman/pull/8#discussion_r68341299"},"pull_request":{"href":"https://api.github.com/repos/ev3dev/brickman/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/ev3dev/brickman/pulls/8","id":74534111,"html_url":"https://github.com/ev3dev/brickman/pull/8","diff_url":"https://github.com/ev3dev/brickman/pull/8.diff","patch_url":"https://github.com/ev3dev/brickman/pull/8.patch","issue_url":"https://api.github.com/repos/ev3dev/brickman/issues/8","number":8,"state":"open","locked":false,"title":"Add ALSA-based volume control and test logic","user":{"login":"WasabiFan","id":3310349,"avatar_url":"https://avatars.githubusercontent.com/u/3310349?v=3","gravatar_id":"","url":"https://api.github.com/users/WasabiFan","html_url":"https://github.com/WasabiFan","followers_url":"https://api.github.com/users/WasabiFan/followers","following_url":"https://api.github.com/users/WasabiFan/following{/other_user}","gists_url":"https://api.github.com/users/WasabiFan/gists{/gist_id}","starred_url":"https://api.github.com/users/WasabiFan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WasabiFan/subscriptions","organizations_url":"https://api.github.com/users/WasabiFan/orgs","repos_url":"https://api.github.com/users/WasabiFan/repos","events_url":"https://api.github.com/users/WasabiFan/events{/privacy}","received_events_url":"https://api.github.com/users/WasabiFan/received_events","type":"User","site_admin":false},"body":"This PR adds an \"Audio\" section in the main menu and associated sub-windows to allow volume control from brickman. The primary volume page looks like this:\r\n![volume control window](https://cloud.githubusercontent.com/assets/3310349/16213296/2f017ce0-3703-11e6-8b37-c6aa359dd5b0.png)\r\n\r\nThere is also a list window that only appears if there are no mixer elements or there is more than one mixer element. That window can be accessed from the desktop test.\r\n\r\nThat menu has the following options:\r\n- Volume up\r\n- Volume down\r\n- Half volume\r\n- Maximum volume\r\n- Minimum volume\r\n- Mute _(this one is disabled in certain cases, including on the EV3 -- see below.)_\r\n\r\nThis audio system is architected slightly differently from other current modules in brickman. I created a `ITestableMixerElement` interface (not a perfect name, but the best I could come up with) with two implementations: one of them is the `AlsaBackedMixerElement` and the other is the `FakeMixerElement`. The views operate on `ITestableMixerElement`s, so the controllers just instantiate whichever implementation they need and hand it to the view and the view handles the common display logic.\r\n\r\nThe views connect to the `notify` signals on elements they are given, so they update automatically whenever the underlying elements change. This is mostly used by the test implementation, but it is also how the volume percentage on the main page operates: when the user hits a volume button, the view emits a signal; the controller then updates the volume value on the base element accordingly and the view gets the property change notification and updates the label.\r\n\r\nSome notes:\r\n- The mixer that is configured by default on the EV3 (which may also apply to the other platforms) does not have a mute switch. This means that the mute toggle is always hidden in the volume control. While one can set the volume to zero, the speakers still emit audible clicks when sound starts playing. I have tested the mute functionality on my desktop PC and know that it works.\r\n- The standard ALSA notation for mixer elements is the name and index separated by a comma. It turns out that the font in brickman makes commas very hard to discern after certain letters, especially *k*s (which, unfortunately, is what \"playback\" ends in). So, after some fiddling, I decided on putting the index in brackets before the name -- if there are other ideas for how this should be formatted I can try those out too.\r\n- I'm pretty sure I didn't do the `CMakeLists.txt` additions correctly. Specifically, on line 139, I added `asound` after `${DEPS_LIBRARIES}` because I couldn't figure out where that variable was coming from. Guidance on where that should go would be appreciated.\r\n","created_at":"2016-06-21T00:19:55Z","updated_at":"2016-06-24T01:09:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91740237c95c45e3011ba9a5f187d0119735c928","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ev3dev/brickman/pulls/8/commits","review_comments_url":"https://api.github.com/repos/ev3dev/brickman/pulls/8/comments","review_comment_url":"https://api.github.com/repos/ev3dev/brickman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ev3dev/brickman/issues/8/comments","statuses_url":"https://api.github.com/repos/ev3dev/brickman/statuses/240ae1e1d7dd306b20d70348a640ebda3aae8d6d","head":{"label":"WasabiFan:add-audio-controls","ref":"add-audio-controls","sha":"240ae1e1d7dd306b20d70348a640ebda3aae8d6d","user":{"login":"WasabiFan","id":3310349,"avatar_url":"https://avatars.githubusercontent.com/u/3310349?v=3","gravatar_id":"","url":"https://api.github.com/users/WasabiFan","html_url":"https://github.com/WasabiFan","followers_url":"https://api.github.com/users/WasabiFan/followers","following_url":"https://api.github.com/users/WasabiFan/following{/other_user}","gists_url":"https://api.github.com/users/WasabiFan/gists{/gist_id}","starred_url":"https://api.github.com/users/WasabiFan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WasabiFan/subscriptions","organizations_url":"https://api.github.com/users/WasabiFan/orgs","repos_url":"https://api.github.com/users/WasabiFan/repos","events_url":"https://api.github.com/users/WasabiFan/events{/privacy}","received_events_url":"https://api.github.com/users/WasabiFan/received_events","type":"User","site_admin":false},"repo":{"id":25797953,"name":"brickman","full_name":"WasabiFan/brickman","owner":{"login":"WasabiFan","id":3310349,"avatar_url":"https://avatars.githubusercontent.com/u/3310349?v=3","gravatar_id":"","url":"https://api.github.com/users/WasabiFan","html_url":"https://github.com/WasabiFan","followers_url":"https://api.github.com/users/WasabiFan/followers","following_url":"https://api.github.com/users/WasabiFan/following{/other_user}","gists_url":"https://api.github.com/users/WasabiFan/gists{/gist_id}","starred_url":"https://api.github.com/users/WasabiFan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WasabiFan/subscriptions","organizations_url":"https://api.github.com/users/WasabiFan/orgs","repos_url":"https://api.github.com/users/WasabiFan/repos","events_url":"https://api.github.com/users/WasabiFan/events{/privacy}","received_events_url":"https://api.github.com/users/WasabiFan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WasabiFan/brickman","description":"Brick Manager for ev3dev","fork":true,"url":"https://api.github.com/repos/WasabiFan/brickman","forks_url":"https://api.github.com/repos/WasabiFan/brickman/forks","keys_url":"https://api.github.com/repos/WasabiFan/brickman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WasabiFan/brickman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WasabiFan/brickman/teams","hooks_url":"https://api.github.com/repos/WasabiFan/brickman/hooks","issue_events_url":"https://api.github.com/repos/WasabiFan/brickman/issues/events{/number}","events_url":"https://api.github.com/repos/WasabiFan/brickman/events","assignees_url":"https://api.github.com/repos/WasabiFan/brickman/assignees{/user}","branches_url":"https://api.github.com/repos/WasabiFan/brickman/branches{/branch}","tags_url":"https://api.github.com/repos/WasabiFan/brickman/tags","blobs_url":"https://api.github.com/repos/WasabiFan/brickman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WasabiFan/brickman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WasabiFan/brickman/git/refs{/sha}","trees_url":"https://api.github.com/repos/WasabiFan/brickman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WasabiFan/brickman/statuses/{sha}","languages_url":"https://api.github.com/repos/WasabiFan/brickman/languages","stargazers_url":"https://api.github.com/repos/WasabiFan/brickman/stargazers","contributors_url":"https://api.github.com/repos/WasabiFan/brickman/contributors","subscribers_url":"https://api.github.com/repos/WasabiFan/brickman/subscribers","subscription_url":"https://api.github.com/repos/WasabiFan/brickman/subscription","commits_url":"https://api.github.com/repos/WasabiFan/brickman/commits{/sha}","git_commits_url":"https://api.github.com/repos/WasabiFan/brickman/git/commits{/sha}","comments_url":"https://api.github.com/repos/WasabiFan/brickman/comments{/number}","issue_comment_url":"https://api.github.com/repos/WasabiFan/brickman/issues/comments{/number}","contents_url":"https://api.github.com/repos/WasabiFan/brickman/contents/{+path}","compare_url":"https://api.github.com/repos/WasabiFan/brickman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WasabiFan/brickman/merges","archive_url":"https://api.github.com/repos/WasabiFan/brickman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WasabiFan/brickman/downloads","issues_url":"https://api.github.com/repos/WasabiFan/brickman/issues{/number}","pulls_url":"https://api.github.com/repos/WasabiFan/brickman/pulls{/number}","milestones_url":"https://api.github.com/repos/WasabiFan/brickman/milestones{/number}","notifications_url":"https://api.github.com/repos/WasabiFan/brickman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WasabiFan/brickman/labels{/name}","releases_url":"https://api.github.com/repos/WasabiFan/brickman/releases{/id}","deployments_url":"https://api.github.com/repos/WasabiFan/brickman/deployments","created_at":"2014-10-27T01:20:02Z","updated_at":"2014-10-27T01:21:56Z","pushed_at":"2016-06-21T03:47:18Z","git_url":"git://github.com/WasabiFan/brickman.git","ssh_url":"git@github.com:WasabiFan/brickman.git","clone_url":"https://github.com/WasabiFan/brickman.git","svn_url":"https://github.com/WasabiFan/brickman","homepage":"","size":1067,"stargazers_count":0,"watchers_count":0,"language":"Vala","has_issues":false,"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":"ev3dev-jessie"}},"base":{"label":"ev3dev:ev3dev-jessie","ref":"ev3dev-jessie","sha":"41316cfea707570445706a75e6d1cd336e12318d","user":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"repo":{"id":20454766,"name":"brickman","full_name":"ev3dev/brickman","owner":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ev3dev/brickman","description":"Brick Manager for ev3dev","fork":false,"url":"https://api.github.com/repos/ev3dev/brickman","forks_url":"https://api.github.com/repos/ev3dev/brickman/forks","keys_url":"https://api.github.com/repos/ev3dev/brickman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ev3dev/brickman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ev3dev/brickman/teams","hooks_url":"https://api.github.com/repos/ev3dev/brickman/hooks","issue_events_url":"https://api.github.com/repos/ev3dev/brickman/issues/events{/number}","events_url":"https://api.github.com/repos/ev3dev/brickman/events","assignees_url":"https://api.github.com/repos/ev3dev/brickman/assignees{/user}","branches_url":"https://api.github.com/repos/ev3dev/brickman/branches{/branch}","tags_url":"https://api.github.com/repos/ev3dev/brickman/tags","blobs_url":"https://api.github.com/repos/ev3dev/brickman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ev3dev/brickman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ev3dev/brickman/git/refs{/sha}","trees_url":"https://api.github.com/repos/ev3dev/brickman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ev3dev/brickman/statuses/{sha}","languages_url":"https://api.github.com/repos/ev3dev/brickman/languages","stargazers_url":"https://api.github.com/repos/ev3dev/brickman/stargazers","contributors_url":"https://api.github.com/repos/ev3dev/brickman/contributors","subscribers_url":"https://api.github.com/repos/ev3dev/brickman/subscribers","subscription_url":"https://api.github.com/repos/ev3dev/brickman/subscription","commits_url":"https://api.github.com/repos/ev3dev/brickman/commits{/sha}","git_commits_url":"https://api.github.com/repos/ev3dev/brickman/git/commits{/sha}","comments_url":"https://api.github.com/repos/ev3dev/brickman/comments{/number}","issue_comment_url":"https://api.github.com/repos/ev3dev/brickman/issues/comments{/number}","contents_url":"https://api.github.com/repos/ev3dev/brickman/contents/{+path}","compare_url":"https://api.github.com/repos/ev3dev/brickman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ev3dev/brickman/merges","archive_url":"https://api.github.com/repos/ev3dev/brickman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ev3dev/brickman/downloads","issues_url":"https://api.github.com/repos/ev3dev/brickman/issues{/number}","pulls_url":"https://api.github.com/repos/ev3dev/brickman/pulls{/number}","milestones_url":"https://api.github.com/repos/ev3dev/brickman/milestones{/number}","notifications_url":"https://api.github.com/repos/ev3dev/brickman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ev3dev/brickman/labels{/name}","releases_url":"https://api.github.com/repos/ev3dev/brickman/releases{/id}","deployments_url":"https://api.github.com/repos/ev3dev/brickman/deployments","created_at":"2014-06-03T18:39:12Z","updated_at":"2016-06-03T21:01:14Z","pushed_at":"2016-06-24T00:10:58Z","git_url":"git://github.com/ev3dev/brickman.git","ssh_url":"git@github.com:ev3dev/brickman.git","clone_url":"https://github.com/ev3dev/brickman.git","svn_url":"https://github.com/ev3dev/brickman","homepage":"http://www.ev3dev.org","size":1043,"stargazers_count":10,"watchers_count":10,"language":"Vala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":10,"default_branch":"ev3dev-jessie"}},"_links":{"self":{"href":"https://api.github.com/repos/ev3dev/brickman/pulls/8"},"html":{"href":"https://github.com/ev3dev/brickman/pull/8"},"issue":{"href":"https://api.github.com/repos/ev3dev/brickman/issues/8"},"comments":{"href":"https://api.github.com/repos/ev3dev/brickman/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/ev3dev/brickman/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/ev3dev/brickman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ev3dev/brickman/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/ev3dev/brickman/statuses/240ae1e1d7dd306b20d70348a640ebda3aae8d6d"}}}}
{"actor":{"display_login":"dlech"}}