GitHub PullRequestReviewCommentEvent at 2014-11-25 18:20:06
Repository: ola
Actor: peternewman
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/20882825","id":20882825,"diff_hunk":"@@ -0,0 +1,158 @@\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 2 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 Library 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, write to the Free Software\n+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ *\n+ * AsyncUsbSender.cpp\n+ * A Asynchronous DMX USB sender.\n+ * Copyright (C) 2014 Simon Newton\n+ */\n+\n+#include \"plugins/usbdmx/AsyncUsbSender.h\"\n+\n+#include \"ola/Logging.h\"\n+#include \"plugins/usbdmx/LibUsbAdaptor.h\"\n+\n+namespace ola {\n+namespace plugin {\n+namespace usbdmx {\n+\n+namespace {\n+\n+/*\n+ * Called by libusb when the transfer completes.\n+ */\n+void AsyncCallback(struct libusb_transfer *transfer) {\n+  AsyncUsbSender *widget = reinterpret_cast<AsyncUsbSender*>(\n+      transfer->user_data);\n+  widget->TransferComplete(transfer);\n+}\n+}  // namespace\n+\n+AsyncUsbSender::AsyncUsbSender(LibUsbAdaptor *adaptor,\n+                               libusb_device *usb_device)\n+    : m_adaptor(adaptor),\n+      m_usb_device(usb_device),\n+      m_usb_handle(NULL),\n+      m_transfer_state(IDLE),\n+      m_pending_tx(false) {\n+  m_transfer = m_adaptor->AllocTransfer(0);\n+  m_adaptor->RefDevice(usb_device);\n+}\n+\n+AsyncUsbSender::~AsyncUsbSender() {\n+  CancelTransfer();\n+  m_adaptor->Close(m_usb_handle);\n+  m_adaptor->UnrefDevice(m_usb_device);\n+}\n+\n+bool AsyncUsbSender::Init() {\n+  m_usb_handle = SetupHandle();\n+  return m_usb_handle ? true : false;\n+}\n+\n+bool AsyncUsbSender::SendDMX(const DmxBuffer &buffer) {\n+  if (!m_usb_handle) {\n+    OLA_WARN << \"AsynchronousAnymaWidget hasn't been initialized\";","path":"plugins/usbdmx/AsyncUsbSender.cpp","position":66,"original_position":66,"commit_id":"51d0e43c7e34757edf974bf1881f3071d43eb814","original_commit_id":"51d0e43c7e34757edf974bf1881f3071d43eb814","user":{"login":"peternewman","id":6216436,"avatar_url":"https://avatars.githubusercontent.com/u/6216436?v=3","gravatar_id":"","url":"https://api.github.com/users/peternewman","html_url":"https://github.com/peternewman","followers_url":"https://api.github.com/users/peternewman/followers","following_url":"https://api.github.com/users/peternewman/following{/other_user}","gists_url":"https://api.github.com/users/peternewman/gists{/gist_id}","starred_url":"https://api.github.com/users/peternewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternewman/subscriptions","organizations_url":"https://api.github.com/users/peternewman/orgs","repos_url":"https://api.github.com/users/peternewman/repos","events_url":"https://api.github.com/users/peternewman/events{/privacy}","received_events_url":"https://api.github.com/users/peternewman/received_events","type":"User","site_admin":false},"body":"Don't know that it's Anyma here. Copy/paste error?","created_at":"2014-11-25T18:20:06Z","updated_at":"2014-11-25T18:20:06Z","html_url":"https://github.com/OpenLightingProject/ola/pull/541#discussion_r20882825","pull_request_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541","_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/20882825"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/541#discussion_r20882825"},"pull_request":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541"}}},"pull_request":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541","id":25012344,"html_url":"https://github.com/OpenLightingProject/ola/pull/541","diff_url":"https://github.com/OpenLightingProject/ola/pull/541.diff","patch_url":"https://github.com/OpenLightingProject/ola/pull/541.patch","issue_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/541","number":541,"state":"open","locked":false,"title":"Add the threaded and async libusb senders.","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-25T14:45:48Z","updated_at":"2014-11-25T18:20:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88764406fe476c32ad80c33569449b746d21f2f1","assignee":{"login":"peternewman","id":6216436,"avatar_url":"https://avatars.githubusercontent.com/u/6216436?v=3","gravatar_id":"","url":"https://api.github.com/users/peternewman","html_url":"https://github.com/peternewman","followers_url":"https://api.github.com/users/peternewman/followers","following_url":"https://api.github.com/users/peternewman/following{/other_user}","gists_url":"https://api.github.com/users/peternewman/gists{/gist_id}","starred_url":"https://api.github.com/users/peternewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternewman/subscriptions","organizations_url":"https://api.github.com/users/peternewman/orgs","repos_url":"https://api.github.com/users/peternewman/repos","events_url":"https://api.github.com/users/peternewman/events{/privacy}","received_events_url":"https://api.github.com/users/peternewman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541/commits","review_comments_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541/comments","review_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/541/comments","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/51d0e43c7e34757edf974bf1881f3071d43eb814","head":{"label":"nomis52:libusb-int","ref":"libusb-int","sha":"51d0e43c7e34757edf974bf1881f3071d43eb814","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"repo":{"id":15822023,"name":"ola","full_name":"nomis52/ola","owner":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nomis52/ola","description":"The Open Lighting Architecture","fork":true,"url":"https://api.github.com/repos/nomis52/ola","forks_url":"https://api.github.com/repos/nomis52/ola/forks","keys_url":"https://api.github.com/repos/nomis52/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nomis52/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nomis52/ola/teams","hooks_url":"https://api.github.com/repos/nomis52/ola/hooks","issue_events_url":"https://api.github.com/repos/nomis52/ola/issues/events{/number}","events_url":"https://api.github.com/repos/nomis52/ola/events","assignees_url":"https://api.github.com/repos/nomis52/ola/assignees{/user}","branches_url":"https://api.github.com/repos/nomis52/ola/branches{/branch}","tags_url":"https://api.github.com/repos/nomis52/ola/tags","blobs_url":"https://api.github.com/repos/nomis52/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nomis52/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nomis52/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/nomis52/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nomis52/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/nomis52/ola/languages","stargazers_url":"https://api.github.com/repos/nomis52/ola/stargazers","contributors_url":"https://api.github.com/repos/nomis52/ola/contributors","subscribers_url":"https://api.github.com/repos/nomis52/ola/subscribers","subscription_url":"https://api.github.com/repos/nomis52/ola/subscription","commits_url":"https://api.github.com/repos/nomis52/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/nomis52/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/nomis52/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/nomis52/ola/issues/comments/{number}","contents_url":"https://api.github.com/repos/nomis52/ola/contents/{+path}","compare_url":"https://api.github.com/repos/nomis52/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nomis52/ola/merges","archive_url":"https://api.github.com/repos/nomis52/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nomis52/ola/downloads","issues_url":"https://api.github.com/repos/nomis52/ola/issues{/number}","pulls_url":"https://api.github.com/repos/nomis52/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/nomis52/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/nomis52/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nomis52/ola/labels{/name}","releases_url":"https://api.github.com/repos/nomis52/ola/releases{/id}","created_at":"2014-01-11T12:21:27Z","updated_at":"2014-11-23T17:37:54Z","pushed_at":"2014-11-25T14:45:35Z","git_url":"git://github.com/nomis52/ola.git","ssh_url":"git@github.com:nomis52/ola.git","clone_url":"https://github.com/nomis52/ola.git","svn_url":"https://github.com/nomis52/ola","homepage":null,"size":17340,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenLightingProject:master","ref":"master","sha":"2620e9c31ea5b7bc5bcfa8940b2deb3b4bb90f03","user":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"repo":{"id":15233168,"name":"ola","full_name":"OpenLightingProject/ola","owner":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenLightingProject/ola","description":"The Open Lighting Architecture","fork":false,"url":"https://api.github.com/repos/OpenLightingProject/ola","forks_url":"https://api.github.com/repos/OpenLightingProject/ola/forks","keys_url":"https://api.github.com/repos/OpenLightingProject/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenLightingProject/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenLightingProject/ola/teams","hooks_url":"https://api.github.com/repos/OpenLightingProject/ola/hooks","issue_events_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/events{/number}","events_url":"https://api.github.com/repos/OpenLightingProject/ola/events","assignees_url":"https://api.github.com/repos/OpenLightingProject/ola/assignees{/user}","branches_url":"https://api.github.com/repos/OpenLightingProject/ola/branches{/branch}","tags_url":"https://api.github.com/repos/OpenLightingProject/ola/tags","blobs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenLightingProject/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenLightingProject/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenLightingProject/ola/languages","stargazers_url":"https://api.github.com/repos/OpenLightingProject/ola/stargazers","contributors_url":"https://api.github.com/repos/OpenLightingProject/ola/contributors","subscribers_url":"https://api.github.com/repos/OpenLightingProject/ola/subscribers","subscription_url":"https://api.github.com/repos/OpenLightingProject/ola/subscription","commits_url":"https://api.github.com/repos/OpenLightingProject/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenLightingProject/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenLightingProject/ola/contents/{+path}","compare_url":"https://api.github.com/repos/OpenLightingProject/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenLightingProject/ola/merges","archive_url":"https://api.github.com/repos/OpenLightingProject/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenLightingProject/ola/downloads","issues_url":"https://api.github.com/repos/OpenLightingProject/ola/issues{/number}","pulls_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenLightingProject/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenLightingProject/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenLightingProject/ola/labels{/name}","releases_url":"https://api.github.com/repos/OpenLightingProject/ola/releases{/id}","created_at":"2013-12-16T18:06:52Z","updated_at":"2014-11-25T14:37:09Z","pushed_at":"2014-11-25T14:37:09Z","git_url":"git://github.com/OpenLightingProject/ola.git","ssh_url":"git@github.com:OpenLightingProject/ola.git","clone_url":"https://github.com/OpenLightingProject/ola.git","svn_url":"https://github.com/OpenLightingProject/ola","homepage":null,"size":23094,"stargazers_count":58,"watchers_count":58,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":70,"forks":31,"open_issues":70,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/541"},"issue":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/541"},"comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/541/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/541/commits"},"statuses":{"href":"https://api.github.com/repos/OpenLightingProject/ola/statuses/51d0e43c7e34757edf974bf1881f3071d43eb814"}}}}