{"action":"created","issue":{"url":"https://api.github.com/repos/SFML/SFML/issues/1126","repository_url":"https://api.github.com/repos/SFML/SFML","labels_url":"https://api.github.com/repos/SFML/SFML/issues/1126/labels{/name}","comments_url":"https://api.github.com/repos/SFML/SFML/issues/1126/comments","events_url":"https://api.github.com/repos/SFML/SFML/issues/1126/events","html_url":"https://github.com/SFML/SFML/pull/1126","id":170069542,"number":1126,"title":"Add support for looping audio from positions other than the beginning.","user":{"login":"fmatthew5876","id":1198466,"avatar_url":"https://avatars.githubusercontent.com/u/1198466?v=3","gravatar_id":"","url":"https://api.github.com/users/fmatthew5876","html_url":"https://github.com/fmatthew5876","followers_url":"https://api.github.com/users/fmatthew5876/followers","following_url":"https://api.github.com/users/fmatthew5876/following{/other_user}","gists_url":"https://api.github.com/users/fmatthew5876/gists{/gist_id}","starred_url":"https://api.github.com/users/fmatthew5876/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmatthew5876/subscriptions","organizations_url":"https://api.github.com/users/fmatthew5876/orgs","repos_url":"https://api.github.com/users/fmatthew5876/repos","events_url":"https://api.github.com/users/fmatthew5876/events{/privacy}","received_events_url":"https://api.github.com/users/fmatthew5876/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SFML/SFML/labels/feature","name":"feature","color":"23BA35"},{"url":"https://api.github.com/repos/SFML/SFML/labels/m:sfml-audio","name":"m:sfml-audio","color":"cccccc"},{"url":"https://api.github.com/repos/SFML/SFML/labels/s:undecided","name":"s:undecided","color":"ffe20a"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-09T02:42:50Z","updated_at":"2016-10-01T18:20:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SFML/SFML/pulls/1126","html_url":"https://github.com/SFML/SFML/pull/1126","diff_url":"https://github.com/SFML/SFML/pull/1126.diff","patch_url":"https://github.com/SFML/SFML/pull/1126.patch"},"body":"A lot of game music has an intro that plays once before the main part of the song that loops. This simple patch add support for setting a loop offset so that when music (or sounds if you want) repeats, it will not repeat at the absolute beginning.\r\n\r\nNot sure if I met your exact standards with respect to the doxygen comments. Let me know if it needs to be changed.\r\n\r\nI tested this patch myself and it works fine. Complete test case is given below:\r\n\r\n\r\n```\r\n#include <SFML/Window.hpp>\r\n#include <SFML/Audio.hpp>\r\n\r\nint main() {\r\n        sf::Window window(sf::VideoMode(800, 600), \"Test\");\r\n\r\n        sf::Music music;\r\n        if(!music.openFromFile(\"mach.flac\")) {\r\n                throw std::string(\"FAILED!\");\r\n        }   \r\n        music.play();\r\n        music.setLoop(true);\r\n        music.setLoopOffset(sf::seconds(60));\r\n\r\n        while(window.isOpen()) {\r\n                sf::Event event;\r\n                while(window.pollEvent(event)) {\r\n                        if(event.type == sf::Event::Closed) {\r\n                                window.close();\r\n                        }   \r\n                }   \r\n\r\n        }   \r\n\r\n\r\n        return 0;\r\n}\r\n```\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/SFML/SFML/issues/comments/250928186","html_url":"https://github.com/SFML/SFML/pull/1126#issuecomment-250928186","issue_url":"https://api.github.com/repos/SFML/SFML/issues/1126","id":250928186,"user":{"login":"eXpl0it3r","id":920861,"avatar_url":"https://avatars.githubusercontent.com/u/920861?v=3","gravatar_id":"","url":"https://api.github.com/users/eXpl0it3r","html_url":"https://github.com/eXpl0it3r","followers_url":"https://api.github.com/users/eXpl0it3r/followers","following_url":"https://api.github.com/users/eXpl0it3r/following{/other_user}","gists_url":"https://api.github.com/users/eXpl0it3r/gists{/gist_id}","starred_url":"https://api.github.com/users/eXpl0it3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eXpl0it3r/subscriptions","organizations_url":"https://api.github.com/users/eXpl0it3r/orgs","repos_url":"https://api.github.com/users/eXpl0it3r/repos","events_url":"https://api.github.com/users/eXpl0it3r/events{/privacy}","received_events_url":"https://api.github.com/users/eXpl0it3r/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T18:20:12Z","updated_at":"2016-10-01T18:20:12Z","body":"SFMLBuildMaster: Build this please."}}
{"actor":{"display_login":"eXpl0it3r"}}