{"action":"created","issue":{"url":"https://api.github.com/repos/LMMS/lmms/issues/2536","repository_url":"https://api.github.com/repos/LMMS/lmms","labels_url":"https://api.github.com/repos/LMMS/lmms/issues/2536/labels{/name}","comments_url":"https://api.github.com/repos/LMMS/lmms/issues/2536/comments","events_url":"https://api.github.com/repos/LMMS/lmms/issues/2536/events","html_url":"https://github.com/LMMS/lmms/pull/2536","id":130169364,"number":2536,"title":"Separation of core code and GUI: Getting rid of the static calls into the Engine class","user":{"login":"michaelgregorius","id":9293269,"avatar_url":"https://avatars.githubusercontent.com/u/9293269?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelgregorius","html_url":"https://github.com/michaelgregorius","followers_url":"https://api.github.com/users/michaelgregorius/followers","following_url":"https://api.github.com/users/michaelgregorius/following{/other_user}","gists_url":"https://api.github.com/users/michaelgregorius/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelgregorius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelgregorius/subscriptions","organizations_url":"https://api.github.com/users/michaelgregorius/orgs","repos_url":"https://api.github.com/users/michaelgregorius/repos","events_url":"https://api.github.com/users/michaelgregorius/events{/privacy}","received_events_url":"https://api.github.com/users/michaelgregorius/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-31T19:07:27Z","updated_at":"2016-02-02T23:33:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/LMMS/lmms/pulls/2536","html_url":"https://github.com/LMMS/lmms/pull/2536","diff_url":"https://github.com/LMMS/lmms/pull/2536.diff","patch_url":"https://github.com/LMMS/lmms/pull/2536.patch"},"body":"As a means to separate the core classes from the GUI I have started to get rid of the static calls into the `Engine` class. To do so the following steps have been taken so far:\r\n* A new class/interface `EngineClient` has been introduced. Classes that need information from the `Engine` inherit from this class. `EngineClient` provides access to the `Engine` and provides convenience methods to access `Song`, `BBTrackContainer` and `ProjectJournal` (more might be added later if needed).\r\n* So far the classes `PianoRoll`, `AutomationEditor` and `Plugin` inherit from `EngineClient`.\r\n* The constructors of the GUI classes `PianoRoll` and `AutomationEditor` have been adjusted to take a pointer to the `Engine` as a parameter. Both classes now retrieve the information via the `EngineClient` interface, i.e. they contain no more calls to `Engine::getSong`, etc.\r\n* The factory method `lmms_plugin_main` for the plugins has been extended to also take a pointer to the `Engine`. The constructors of all plugins have been adjusted as well. This way all plugins should now be able to access the `Engine` using `EngineClient::getEngine` instead of calling `Engine::getSong`, `Engine::getMixer`, etc.\r\n\r\nPlease provide feedback whether I should continue with this path and whether there is a chance for these changes to be integrated. Thanks!"},"comment":{"url":"https://api.github.com/repos/LMMS/lmms/issues/comments/178885585","html_url":"https://github.com/LMMS/lmms/pull/2536#issuecomment-178885585","issue_url":"https://api.github.com/repos/LMMS/lmms/issues/2536","id":178885585,"user":{"login":"Wallacoloo","id":1210751,"avatar_url":"https://avatars.githubusercontent.com/u/1210751?v=3","gravatar_id":"","url":"https://api.github.com/users/Wallacoloo","html_url":"https://github.com/Wallacoloo","followers_url":"https://api.github.com/users/Wallacoloo/followers","following_url":"https://api.github.com/users/Wallacoloo/following{/other_user}","gists_url":"https://api.github.com/users/Wallacoloo/gists{/gist_id}","starred_url":"https://api.github.com/users/Wallacoloo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wallacoloo/subscriptions","organizations_url":"https://api.github.com/users/Wallacoloo/orgs","repos_url":"https://api.github.com/users/Wallacoloo/repos","events_url":"https://api.github.com/users/Wallacoloo/events{/privacy}","received_events_url":"https://api.github.com/users/Wallacoloo/received_events","type":"User","site_admin":false},"created_at":"2016-02-02T23:33:26Z","updated_at":"2016-02-02T23:33:26Z","body":"Looks great! I am very much in support of these changes. I left several comments (I apologize for any redundancies; I could have consolidated many of theme), but most of these are pretty trivial.\r\n\r\nMost possible errors raised in these changes should be caught at compile-time, so despite the large size, I honestly don't think this requires a great deal of testing."}}