{"action":"created","comment":{"url":"https://api.github.com/repos/Mudlet/Mudlet/pulls/comments/90760850","pull_request_review_id":11280268,"id":90760850,"diff_hunk":"@@ -2399,35 +2399,40 @@ void mudlet::slot_replaySpeedDown()\n \n void mudlet::stopSounds()\n {\n-    mpMusicBox1->stop();\n-    mpMusicBox2->stop();\n-    mpMusicBox3->stop();\n-    mpMusicBox4->stop();\n-}\n-\n-void mudlet::playSound( QString s )\n-{\n-    if( mpMusicBox1->state() != QMediaPlayer::PlayingState )\n-    {\n-        mpMusicBox1->setMedia( QUrl::fromLocalFile( s ) );\n-        mpMusicBox1->play();\n-    }\n-    else if( mpMusicBox2->state() != QMediaPlayer::PlayingState )\n-    {\n-        mpMusicBox2->setMedia( QUrl::fromLocalFile( s ) );\n-        mpMusicBox2->play();\n-    }\n-    else if( mpMusicBox3->state() != QMediaPlayer::PlayingState )\n-    {\n-        mpMusicBox3->setMedia( QUrl::fromLocalFile( s ) );\n-        mpMusicBox3->play();\n-    }\n-    else\n-    {\n-        mpMusicBox4->stop();\n-        mpMusicBox4->setMedia( QUrl::fromLocalFile( s ) );\n-        mpMusicBox4->play();\n-    }\n+\tQListIterator<QMediaPlayer *> itMusicBox( MusicBoxList );\n+\n+\twhile( itMusicBox.hasNext() ) {\n+\t\titMusicBox.next()->stop();\n+\t} \n+}\n+\n+void mudlet::playSound( QString s, int soundVolume )\n+{\n+\tQListIterator<QMediaPlayer *> itMusicBox( MusicBoxList );\n+\tQMediaPlayer * pPlayer=0;\n+\t\n+\t/* find first available inactive QMediaPlayer */\n+\twhile( itMusicBox.hasNext() ) {\n+\t\tQMediaPlayer * pTestPlayer=itMusicBox.next();\n+\t\n+\t\tif ( pTestPlayer->state() != QMediaPlayer::PlayingState &&\n+\t\t\t pTestPlayer->mediaStatus() != QMediaPlayer::LoadingMedia )\n+\t\t{\n+\t\t\tpPlayer=pTestPlayer;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\t/* no available QMediaPlayer, create a new one */\n+\tif (!pPlayer) {\n+\t\tpPlayer = new QMediaPlayer(this);","path":"src/mudlet.cpp","position":79,"original_position":81,"commit_id":"f1fbf32979c3352562178b21d52ed8951569e0d9","original_commit_id":"c53f2df75897869a0bba0f165460046f149d7c9d","user":{"login":"SlySven","id":6163092,"avatar_url":"https://avatars.githubusercontent.com/u/6163092?v=3","gravatar_id":"","url":"https://api.github.com/users/SlySven","html_url":"https://github.com/SlySven","followers_url":"https://api.github.com/users/SlySven/followers","following_url":"https://api.github.com/users/SlySven/following{/other_user}","gists_url":"https://api.github.com/users/SlySven/gists{/gist_id}","starred_url":"https://api.github.com/users/SlySven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SlySven/subscriptions","organizations_url":"https://api.github.com/users/SlySven/orgs","repos_url":"https://api.github.com/users/SlySven/repos","events_url":"https://api.github.com/users/SlySven/events{/privacy}","received_events_url":"https://api.github.com/users/SlySven/received_events","type":"User","site_admin":false},"body":"You've said your code allows an _unlimited_ number of  `QMediaPlayers` to be created but I think you must now check that you are able to do this - I think it would be wise to check that `pPlayer` is non-null and to error out if you can't.  This may need to extend the lua command playSound(...) to return a _nil_ + _error message_ in that event.\r\n\r\n_Also, we might need to consider a mechanism to destroy 'spare' QMediaPlayers afterwards, or what happens if a user's script erroneously creates _lots_ of them in a (broken) loop?  It might be feasible (but more effort) to arrange for a one-shot timer to be coupled to a 'signal' that the the media has finished playing (or failed with an error) and to destroy the instance when the time-out has elapsed...?_ ","created_at":"2016-12-03T17:06:35Z","updated_at":"2016-12-03T17:06:35Z","html_url":"https://github.com/Mudlet/Mudlet/pull/354#discussion_r90760850","pull_request_url":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354","_links":{"self":{"href":"https://api.github.com/repos/Mudlet/Mudlet/pulls/comments/90760850"},"html":{"href":"https://github.com/Mudlet/Mudlet/pull/354#discussion_r90760850"},"pull_request":{"href":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354"}}},"pull_request":{"url":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354","id":95606955,"html_url":"https://github.com/Mudlet/Mudlet/pull/354","diff_url":"https://github.com/Mudlet/Mudlet/pull/354.diff","patch_url":"https://github.com/Mudlet/Mudlet/pull/354.patch","issue_url":"https://api.github.com/repos/Mudlet/Mudlet/issues/354","number":354,"state":"open","locked":false,"title":"(release_30) Fix linked libraries in src.pro for Windows","user":{"login":"Nyyrazzilyss","id":11463043,"avatar_url":"https://avatars.githubusercontent.com/u/11463043?v=3","gravatar_id":"","url":"https://api.github.com/users/Nyyrazzilyss","html_url":"https://github.com/Nyyrazzilyss","followers_url":"https://api.github.com/users/Nyyrazzilyss/followers","following_url":"https://api.github.com/users/Nyyrazzilyss/following{/other_user}","gists_url":"https://api.github.com/users/Nyyrazzilyss/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyyrazzilyss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyyrazzilyss/subscriptions","organizations_url":"https://api.github.com/users/Nyyrazzilyss/orgs","repos_url":"https://api.github.com/users/Nyyrazzilyss/repos","events_url":"https://api.github.com/users/Nyyrazzilyss/events{/privacy}","received_events_url":"https://api.github.com/users/Nyyrazzilyss/received_events","type":"User","site_admin":false},"body":"This corrects the libraries linked in src.pro for Windows so SQL\r\nfunctions work properly. It also removes reference to external\r\nlibraries/includes.","created_at":"2016-11-29T00:57:59Z","updated_at":"2016-12-03T17:06:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22245d1f4cc8d967f04683303104d0563bd82092","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354/commits","review_comments_url":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354/comments","review_comment_url":"https://api.github.com/repos/Mudlet/Mudlet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mudlet/Mudlet/issues/354/comments","statuses_url":"https://api.github.com/repos/Mudlet/Mudlet/statuses/f1fbf32979c3352562178b21d52ed8951569e0d9","head":{"label":"Nyyrazzilyss:release_30","ref":"release_30","sha":"f1fbf32979c3352562178b21d52ed8951569e0d9","user":{"login":"Nyyrazzilyss","id":11463043,"avatar_url":"https://avatars.githubusercontent.com/u/11463043?v=3","gravatar_id":"","url":"https://api.github.com/users/Nyyrazzilyss","html_url":"https://github.com/Nyyrazzilyss","followers_url":"https://api.github.com/users/Nyyrazzilyss/followers","following_url":"https://api.github.com/users/Nyyrazzilyss/following{/other_user}","gists_url":"https://api.github.com/users/Nyyrazzilyss/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyyrazzilyss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyyrazzilyss/subscriptions","organizations_url":"https://api.github.com/users/Nyyrazzilyss/orgs","repos_url":"https://api.github.com/users/Nyyrazzilyss/repos","events_url":"https://api.github.com/users/Nyyrazzilyss/events{/privacy}","received_events_url":"https://api.github.com/users/Nyyrazzilyss/received_events","type":"User","site_admin":false},"repo":{"id":75023599,"name":"Mudlet","full_name":"Nyyrazzilyss/Mudlet","owner":{"login":"Nyyrazzilyss","id":11463043,"avatar_url":"https://avatars.githubusercontent.com/u/11463043?v=3","gravatar_id":"","url":"https://api.github.com/users/Nyyrazzilyss","html_url":"https://github.com/Nyyrazzilyss","followers_url":"https://api.github.com/users/Nyyrazzilyss/followers","following_url":"https://api.github.com/users/Nyyrazzilyss/following{/other_user}","gists_url":"https://api.github.com/users/Nyyrazzilyss/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyyrazzilyss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyyrazzilyss/subscriptions","organizations_url":"https://api.github.com/users/Nyyrazzilyss/orgs","repos_url":"https://api.github.com/users/Nyyrazzilyss/repos","events_url":"https://api.github.com/users/Nyyrazzilyss/events{/privacy}","received_events_url":"https://api.github.com/users/Nyyrazzilyss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nyyrazzilyss/Mudlet","description":"A modern open source MUD client with a graphical user inteface and full built in Lua scripting support for all major platforms.","fork":true,"url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet","forks_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/forks","keys_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/teams","hooks_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/hooks","issue_events_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/issues/events{/number}","events_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/events","assignees_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/assignees{/user}","branches_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/branches{/branch}","tags_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/tags","blobs_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/statuses/{sha}","languages_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/languages","stargazers_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/stargazers","contributors_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/contributors","subscribers_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/subscribers","subscription_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/subscription","commits_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/contents/{+path}","compare_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/merges","archive_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/downloads","issues_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/issues{/number}","pulls_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/pulls{/number}","milestones_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/milestones{/number}","notifications_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/labels{/name}","releases_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/releases{/id}","deployments_url":"https://api.github.com/repos/Nyyrazzilyss/Mudlet/deployments","created_at":"2016-11-28T23:32:33Z","updated_at":"2016-11-28T23:32:36Z","pushed_at":"2016-12-02T23:27:30Z","git_url":"git://github.com/Nyyrazzilyss/Mudlet.git","ssh_url":"git@github.com:Nyyrazzilyss/Mudlet.git","clone_url":"https://github.com/Nyyrazzilyss/Mudlet.git","svn_url":"https://github.com/Nyyrazzilyss/Mudlet","homepage":null,"size":20427,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"development"}},"base":{"label":"Mudlet:release_30","ref":"release_30","sha":"a11a73ad618f568ea604660e8a3f2ee267e47181","user":{"login":"Mudlet","id":6158612,"avatar_url":"https://avatars.githubusercontent.com/u/6158612?v=3","gravatar_id":"","url":"https://api.github.com/users/Mudlet","html_url":"https://github.com/Mudlet","followers_url":"https://api.github.com/users/Mudlet/followers","following_url":"https://api.github.com/users/Mudlet/following{/other_user}","gists_url":"https://api.github.com/users/Mudlet/gists{/gist_id}","starred_url":"https://api.github.com/users/Mudlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mudlet/subscriptions","organizations_url":"https://api.github.com/users/Mudlet/orgs","repos_url":"https://api.github.com/users/Mudlet/repos","events_url":"https://api.github.com/users/Mudlet/events{/privacy}","received_events_url":"https://api.github.com/users/Mudlet/received_events","type":"Organization","site_admin":false},"repo":{"id":15108812,"name":"Mudlet","full_name":"Mudlet/Mudlet","owner":{"login":"Mudlet","id":6158612,"avatar_url":"https://avatars.githubusercontent.com/u/6158612?v=3","gravatar_id":"","url":"https://api.github.com/users/Mudlet","html_url":"https://github.com/Mudlet","followers_url":"https://api.github.com/users/Mudlet/followers","following_url":"https://api.github.com/users/Mudlet/following{/other_user}","gists_url":"https://api.github.com/users/Mudlet/gists{/gist_id}","starred_url":"https://api.github.com/users/Mudlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mudlet/subscriptions","organizations_url":"https://api.github.com/users/Mudlet/orgs","repos_url":"https://api.github.com/users/Mudlet/repos","events_url":"https://api.github.com/users/Mudlet/events{/privacy}","received_events_url":"https://api.github.com/users/Mudlet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mudlet/Mudlet","description":"A modern open source MUD client with a graphical user inteface and full built in Lua scripting support for all major platforms.","fork":false,"url":"https://api.github.com/repos/Mudlet/Mudlet","forks_url":"https://api.github.com/repos/Mudlet/Mudlet/forks","keys_url":"https://api.github.com/repos/Mudlet/Mudlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mudlet/Mudlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mudlet/Mudlet/teams","hooks_url":"https://api.github.com/repos/Mudlet/Mudlet/hooks","issue_events_url":"https://api.github.com/repos/Mudlet/Mudlet/issues/events{/number}","events_url":"https://api.github.com/repos/Mudlet/Mudlet/events","assignees_url":"https://api.github.com/repos/Mudlet/Mudlet/assignees{/user}","branches_url":"https://api.github.com/repos/Mudlet/Mudlet/branches{/branch}","tags_url":"https://api.github.com/repos/Mudlet/Mudlet/tags","blobs_url":"https://api.github.com/repos/Mudlet/Mudlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mudlet/Mudlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mudlet/Mudlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mudlet/Mudlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mudlet/Mudlet/statuses/{sha}","languages_url":"https://api.github.com/repos/Mudlet/Mudlet/languages","stargazers_url":"https://api.github.com/repos/Mudlet/Mudlet/stargazers","contributors_url":"https://api.github.com/repos/Mudlet/Mudlet/contributors","subscribers_url":"https://api.github.com/repos/Mudlet/Mudlet/subscribers","subscription_url":"https://api.github.com/repos/Mudlet/Mudlet/subscription","commits_url":"https://api.github.com/repos/Mudlet/Mudlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mudlet/Mudlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mudlet/Mudlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mudlet/Mudlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mudlet/Mudlet/contents/{+path}","compare_url":"https://api.github.com/repos/Mudlet/Mudlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mudlet/Mudlet/merges","archive_url":"https://api.github.com/repos/Mudlet/Mudlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mudlet/Mudlet/downloads","issues_url":"https://api.github.com/repos/Mudlet/Mudlet/issues{/number}","pulls_url":"https://api.github.com/repos/Mudlet/Mudlet/pulls{/number}","milestones_url":"https://api.github.com/repos/Mudlet/Mudlet/milestones{/number}","notifications_url":"https://api.github.com/repos/Mudlet/Mudlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mudlet/Mudlet/labels{/name}","releases_url":"https://api.github.com/repos/Mudlet/Mudlet/releases{/id}","deployments_url":"https://api.github.com/repos/Mudlet/Mudlet/deployments","created_at":"2013-12-11T14:04:21Z","updated_at":"2016-11-30T11:45:26Z","pushed_at":"2016-12-02T23:27:30Z","git_url":"git://github.com/Mudlet/Mudlet.git","ssh_url":"git@github.com:Mudlet/Mudlet.git","clone_url":"https://github.com/Mudlet/Mudlet.git","svn_url":"https://github.com/Mudlet/Mudlet","homepage":null,"size":22041,"stargazers_count":69,"watchers_count":69,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":15,"forks":38,"open_issues":15,"watchers":69,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354"},"html":{"href":"https://github.com/Mudlet/Mudlet/pull/354"},"issue":{"href":"https://api.github.com/repos/Mudlet/Mudlet/issues/354"},"comments":{"href":"https://api.github.com/repos/Mudlet/Mudlet/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/Mudlet/Mudlet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mudlet/Mudlet/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/Mudlet/Mudlet/statuses/f1fbf32979c3352562178b21d52ed8951569e0d9"}}}}
{"actor":{"display_login":"SlySven"}}