{"action":"created","comment":{"url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/comments/23982206","id":23982206,"diff_hunk":"@@ -90,30 +92,57 @@ void SessionItem::start()\n       for (auto sig: chan->m_signals) {\n         sig->m_buffer->setRate(1.0/m_sample_rate);\n         sig->m_buffer->allocate(m_sample_count);\n-        sig->m_signal->measure_buffer(sig->m_buffer->data(), m_sample_count);\n+\n+        if (m_continuous) {\n+          sig->m_signal->measure_callback([=](float d){\n+            sig->m_buffer->shift(d);\n+          });\n+\n+          connect(sig->m_src, &SrcItem::changed, [=] {\n+            dev->m_device->lock();\n+            sig->m_src->update();\n+            dev->m_device->unlock();\n+          });\n+        } else {\n+          sig->m_signal->measure_buffer(sig->m_buffer->data(), m_sample_count);\n+        }\n         sig->m_src->update();\n+\n       }\n     }\n   }\n \n-  m_session->start(m_sample_count);\n+  m_session->start(continuous ? 0 : m_sample_count);\n }\n \n-void SessionItem::onAttached()\n+void SessionItem::onAttached(Device *device)\n {\n   qDebug() << \"attached\\n\";\n+  auto dev = m_session->add_device(device);\n+  m_devices.append(new DeviceItem(this, device));\n+  devicesChanged();\n+}\n+\n+void SessionItem::onDetached(Device* device){\n+  qDebug() << \"detached\\n\";\n   qDebug() << m_devices;\n-  for (auto i: m_session->m_available_devices) {\n-    auto dev = m_session->add_device(&*i);\n-    m_devices.append(new DeviceItem(this, dev));\n+  if (!m_active) {\n+      m_session->remove_device(device);\n+  }\n+  else {\n+      this->cancel();","path":"SMU.cpp","position":104,"original_position":104,"commit_id":"e092d1c0401a507ac3a0f37da1dad9a2b03cc9d3","original_commit_id":"e092d1c0401a507ac3a0f37da1dad9a2b03cc9d3","user":{"login":"kevinmehall","id":119951,"avatar_url":"https://avatars.githubusercontent.com/u/119951?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmehall","html_url":"https://github.com/kevinmehall","followers_url":"https://api.github.com/users/kevinmehall/followers","following_url":"https://api.github.com/users/kevinmehall/following{/other_user}","gists_url":"https://api.github.com/users/kevinmehall/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmehall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmehall/subscriptions","organizations_url":"https://api.github.com/users/kevinmehall/orgs","repos_url":"https://api.github.com/users/kevinmehall/repos","events_url":"https://api.github.com/users/kevinmehall/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmehall/received_events","type":"User","site_admin":false},"body":"need to `wait` for the transfers to actually cancel. Also, don't you still need to then call remove_device?","created_at":"2015-02-03T04:31:07Z","updated_at":"2015-02-03T04:31:07Z","html_url":"https://github.com/signalspec/pixelpulse2/pull/32#discussion_r23982206","pull_request_url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/comments/23982206"},"html":{"href":"https://github.com/signalspec/pixelpulse2/pull/32#discussion_r23982206"},"pull_request":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32","id":28489451,"html_url":"https://github.com/signalspec/pixelpulse2/pull/32","diff_url":"https://github.com/signalspec/pixelpulse2/pull/32.diff","patch_url":"https://github.com/signalspec/pixelpulse2/pull/32.patch","issue_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues/32","number":32,"state":"open","locked":false,"title":"Defactor hotplug","user":{"login":"itdaniher","id":22683,"avatar_url":"https://avatars.githubusercontent.com/u/22683?v=3","gravatar_id":"","url":"https://api.github.com/users/itdaniher","html_url":"https://github.com/itdaniher","followers_url":"https://api.github.com/users/itdaniher/followers","following_url":"https://api.github.com/users/itdaniher/following{/other_user}","gists_url":"https://api.github.com/users/itdaniher/gists{/gist_id}","starred_url":"https://api.github.com/users/itdaniher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itdaniher/subscriptions","organizations_url":"https://api.github.com/users/itdaniher/orgs","repos_url":"https://api.github.com/users/itdaniher/repos","events_url":"https://api.github.com/users/itdaniher/events{/privacy}","received_events_url":"https://api.github.com/users/itdaniher/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-02T18:08:02Z","updated_at":"2015-02-03T04:31:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d961f5138c57be5fa1802efaf2d22119c6c0f5c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32/commits","review_comments_url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32/comments","review_comment_url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/comments/{number}","comments_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues/32/comments","statuses_url":"https://api.github.com/repos/signalspec/pixelpulse2/statuses/e092d1c0401a507ac3a0f37da1dad9a2b03cc9d3","head":{"label":"signalspec:defactor_hotplug","ref":"defactor_hotplug","sha":"e092d1c0401a507ac3a0f37da1dad9a2b03cc9d3","user":{"login":"signalspec","id":6639585,"avatar_url":"https://avatars.githubusercontent.com/u/6639585?v=3","gravatar_id":"","url":"https://api.github.com/users/signalspec","html_url":"https://github.com/signalspec","followers_url":"https://api.github.com/users/signalspec/followers","following_url":"https://api.github.com/users/signalspec/following{/other_user}","gists_url":"https://api.github.com/users/signalspec/gists{/gist_id}","starred_url":"https://api.github.com/users/signalspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalspec/subscriptions","organizations_url":"https://api.github.com/users/signalspec/orgs","repos_url":"https://api.github.com/users/signalspec/repos","events_url":"https://api.github.com/users/signalspec/events{/privacy}","received_events_url":"https://api.github.com/users/signalspec/received_events","type":"Organization","site_admin":false},"repo":{"id":21784753,"name":"pixelpulse2","full_name":"signalspec/pixelpulse2","owner":{"login":"signalspec","id":6639585,"avatar_url":"https://avatars.githubusercontent.com/u/6639585?v=3","gravatar_id":"","url":"https://api.github.com/users/signalspec","html_url":"https://github.com/signalspec","followers_url":"https://api.github.com/users/signalspec/followers","following_url":"https://api.github.com/users/signalspec/following{/other_user}","gists_url":"https://api.github.com/users/signalspec/gists{/gist_id}","starred_url":"https://api.github.com/users/signalspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalspec/subscriptions","organizations_url":"https://api.github.com/users/signalspec/orgs","repos_url":"https://api.github.com/users/signalspec/repos","events_url":"https://api.github.com/users/signalspec/events{/privacy}","received_events_url":"https://api.github.com/users/signalspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalspec/pixelpulse2","description":"User interface for analog systems exploration.","fork":false,"url":"https://api.github.com/repos/signalspec/pixelpulse2","forks_url":"https://api.github.com/repos/signalspec/pixelpulse2/forks","keys_url":"https://api.github.com/repos/signalspec/pixelpulse2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalspec/pixelpulse2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalspec/pixelpulse2/teams","hooks_url":"https://api.github.com/repos/signalspec/pixelpulse2/hooks","issue_events_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues/events{/number}","events_url":"https://api.github.com/repos/signalspec/pixelpulse2/events","assignees_url":"https://api.github.com/repos/signalspec/pixelpulse2/assignees{/user}","branches_url":"https://api.github.com/repos/signalspec/pixelpulse2/branches{/branch}","tags_url":"https://api.github.com/repos/signalspec/pixelpulse2/tags","blobs_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalspec/pixelpulse2/statuses/{sha}","languages_url":"https://api.github.com/repos/signalspec/pixelpulse2/languages","stargazers_url":"https://api.github.com/repos/signalspec/pixelpulse2/stargazers","contributors_url":"https://api.github.com/repos/signalspec/pixelpulse2/contributors","subscribers_url":"https://api.github.com/repos/signalspec/pixelpulse2/subscribers","subscription_url":"https://api.github.com/repos/signalspec/pixelpulse2/subscription","commits_url":"https://api.github.com/repos/signalspec/pixelpulse2/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalspec/pixelpulse2/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues/comments/{number}","contents_url":"https://api.github.com/repos/signalspec/pixelpulse2/contents/{+path}","compare_url":"https://api.github.com/repos/signalspec/pixelpulse2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalspec/pixelpulse2/merges","archive_url":"https://api.github.com/repos/signalspec/pixelpulse2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalspec/pixelpulse2/downloads","issues_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues{/number}","pulls_url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls{/number}","milestones_url":"https://api.github.com/repos/signalspec/pixelpulse2/milestones{/number}","notifications_url":"https://api.github.com/repos/signalspec/pixelpulse2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalspec/pixelpulse2/labels{/name}","releases_url":"https://api.github.com/repos/signalspec/pixelpulse2/releases{/id}","created_at":"2014-07-13T06:48:33Z","updated_at":"2015-02-02T00:47:37Z","pushed_at":"2015-02-02T17:20:38Z","git_url":"git://github.com/signalspec/pixelpulse2.git","ssh_url":"git@github.com:signalspec/pixelpulse2.git","clone_url":"https://github.com/signalspec/pixelpulse2.git","svn_url":"https://github.com/signalspec/pixelpulse2","homepage":"","size":944,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":2,"default_branch":"master"}},"base":{"label":"signalspec:master","ref":"master","sha":"147efd1f6d8cc02bfa77ece90ba2cb8fc066d249","user":{"login":"signalspec","id":6639585,"avatar_url":"https://avatars.githubusercontent.com/u/6639585?v=3","gravatar_id":"","url":"https://api.github.com/users/signalspec","html_url":"https://github.com/signalspec","followers_url":"https://api.github.com/users/signalspec/followers","following_url":"https://api.github.com/users/signalspec/following{/other_user}","gists_url":"https://api.github.com/users/signalspec/gists{/gist_id}","starred_url":"https://api.github.com/users/signalspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalspec/subscriptions","organizations_url":"https://api.github.com/users/signalspec/orgs","repos_url":"https://api.github.com/users/signalspec/repos","events_url":"https://api.github.com/users/signalspec/events{/privacy}","received_events_url":"https://api.github.com/users/signalspec/received_events","type":"Organization","site_admin":false},"repo":{"id":21784753,"name":"pixelpulse2","full_name":"signalspec/pixelpulse2","owner":{"login":"signalspec","id":6639585,"avatar_url":"https://avatars.githubusercontent.com/u/6639585?v=3","gravatar_id":"","url":"https://api.github.com/users/signalspec","html_url":"https://github.com/signalspec","followers_url":"https://api.github.com/users/signalspec/followers","following_url":"https://api.github.com/users/signalspec/following{/other_user}","gists_url":"https://api.github.com/users/signalspec/gists{/gist_id}","starred_url":"https://api.github.com/users/signalspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalspec/subscriptions","organizations_url":"https://api.github.com/users/signalspec/orgs","repos_url":"https://api.github.com/users/signalspec/repos","events_url":"https://api.github.com/users/signalspec/events{/privacy}","received_events_url":"https://api.github.com/users/signalspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalspec/pixelpulse2","description":"User interface for analog systems exploration.","fork":false,"url":"https://api.github.com/repos/signalspec/pixelpulse2","forks_url":"https://api.github.com/repos/signalspec/pixelpulse2/forks","keys_url":"https://api.github.com/repos/signalspec/pixelpulse2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalspec/pixelpulse2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalspec/pixelpulse2/teams","hooks_url":"https://api.github.com/repos/signalspec/pixelpulse2/hooks","issue_events_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues/events{/number}","events_url":"https://api.github.com/repos/signalspec/pixelpulse2/events","assignees_url":"https://api.github.com/repos/signalspec/pixelpulse2/assignees{/user}","branches_url":"https://api.github.com/repos/signalspec/pixelpulse2/branches{/branch}","tags_url":"https://api.github.com/repos/signalspec/pixelpulse2/tags","blobs_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalspec/pixelpulse2/statuses/{sha}","languages_url":"https://api.github.com/repos/signalspec/pixelpulse2/languages","stargazers_url":"https://api.github.com/repos/signalspec/pixelpulse2/stargazers","contributors_url":"https://api.github.com/repos/signalspec/pixelpulse2/contributors","subscribers_url":"https://api.github.com/repos/signalspec/pixelpulse2/subscribers","subscription_url":"https://api.github.com/repos/signalspec/pixelpulse2/subscription","commits_url":"https://api.github.com/repos/signalspec/pixelpulse2/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalspec/pixelpulse2/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalspec/pixelpulse2/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues/comments/{number}","contents_url":"https://api.github.com/repos/signalspec/pixelpulse2/contents/{+path}","compare_url":"https://api.github.com/repos/signalspec/pixelpulse2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalspec/pixelpulse2/merges","archive_url":"https://api.github.com/repos/signalspec/pixelpulse2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalspec/pixelpulse2/downloads","issues_url":"https://api.github.com/repos/signalspec/pixelpulse2/issues{/number}","pulls_url":"https://api.github.com/repos/signalspec/pixelpulse2/pulls{/number}","milestones_url":"https://api.github.com/repos/signalspec/pixelpulse2/milestones{/number}","notifications_url":"https://api.github.com/repos/signalspec/pixelpulse2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalspec/pixelpulse2/labels{/name}","releases_url":"https://api.github.com/repos/signalspec/pixelpulse2/releases{/id}","created_at":"2014-07-13T06:48:33Z","updated_at":"2015-02-02T00:47:37Z","pushed_at":"2015-02-02T17:20:38Z","git_url":"git://github.com/signalspec/pixelpulse2.git","ssh_url":"git@github.com:signalspec/pixelpulse2.git","clone_url":"https://github.com/signalspec/pixelpulse2.git","svn_url":"https://github.com/signalspec/pixelpulse2","homepage":"","size":944,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32"},"html":{"href":"https://github.com/signalspec/pixelpulse2/pull/32"},"issue":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/issues/32"},"comments":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/signalspec/pixelpulse2/statuses/e092d1c0401a507ac3a0f37da1dad9a2b03cc9d3"}}}}