{"action":"created","issue":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/6195","repository_url":"https://api.github.com/repos/openframeworks/openFrameworks","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/6195/labels{/name}","comments_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/6195/comments","events_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/6195/events","html_url":"https://github.com/openframeworks/openFrameworks/pull/6195","id":391147351,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4NzUwMjQy","number":6195,"title":"Add useful ofParameter constructor","user":{"login":"hiroMTB","id":193280,"node_id":"MDQ6VXNlcjE5MzI4MA==","avatar_url":"https://avatars1.githubusercontent.com/u/193280?v=4","gravatar_id":"","url":"https://api.github.com/users/hiroMTB","html_url":"https://github.com/hiroMTB","followers_url":"https://api.github.com/users/hiroMTB/followers","following_url":"https://api.github.com/users/hiroMTB/following{/other_user}","gists_url":"https://api.github.com/users/hiroMTB/gists{/gist_id}","starred_url":"https://api.github.com/users/hiroMTB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiroMTB/subscriptions","organizations_url":"https://api.github.com/users/hiroMTB/orgs","repos_url":"https://api.github.com/users/hiroMTB/repos","events_url":"https://api.github.com/users/hiroMTB/events{/privacy}","received_events_url":"https://api.github.com/users/hiroMTB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-12-14T15:08:23Z","updated_at":"2018-12-14T15:53:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/pulls/6195","html_url":"https://github.com/openframeworks/openFrameworks/pull/6195","diff_url":"https://github.com/openframeworks/openFrameworks/pull/6195.diff","patch_url":"https://github.com/openframeworks/openFrameworks/pull/6195.patch"},"body":"Right now we are able to initialize ofParameter like below in ofApp.h.\r\n```\r\nofParameter<int>  fps{\"FPS\", 0, 0, 120};\r\nofParameter<bool> bFullscreen{\"Fullscreen\", false};\r\nofParameterGroup  grp{\"general settings\", fps, bFullscreen};\r\n```\r\nThe first parameter (e.g. \"FPS\") is the name of parameter then initial value, min and max.\r\nThis is very useful because we can write in header file and reduce code in ofApp.cpp file.\r\nI'm using this often in my project since I found this syntax in Entropy project(for example [here](https://github.com/Entropy/Entropy/blob/master/Projects/EntropyRender/src/entropy/render/PostEffects.h)), \r\n\r\nIt would be nicer if we could initialize \"serializable\" variable as well in same manner. With this PR we can write this way and reduce .setSerializable(false) in ofApp.cpp to avoid saving parameter to xml (or json).\r\n\r\n```\r\nofParameter<int>  fps{\"FPS\", 0, 0, 120, false};\r\nofParameter<bool> bFullscreen{\"Fullscreen\", false, false};\r\nofParameterGroup  grp{\"general settings\", fps, bFullscreen};\r\n```\r\n\r\n*Same to ofReadOnlyParameter"},"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/comments/447366359","html_url":"https://github.com/openframeworks/openFrameworks/pull/6195#issuecomment-447366359","issue_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/6195","id":447366359,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzM2NjM1OQ==","user":{"login":"hiroMTB","id":193280,"node_id":"MDQ6VXNlcjE5MzI4MA==","avatar_url":"https://avatars1.githubusercontent.com/u/193280?v=4","gravatar_id":"","url":"https://api.github.com/users/hiroMTB","html_url":"https://github.com/hiroMTB","followers_url":"https://api.github.com/users/hiroMTB/followers","following_url":"https://api.github.com/users/hiroMTB/following{/other_user}","gists_url":"https://api.github.com/users/hiroMTB/gists{/gist_id}","starred_url":"https://api.github.com/users/hiroMTB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiroMTB/subscriptions","organizations_url":"https://api.github.com/users/hiroMTB/orgs","repos_url":"https://api.github.com/users/hiroMTB/repos","events_url":"https://api.github.com/users/hiroMTB/events{/privacy}","received_events_url":"https://api.github.com/users/hiroMTB/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T15:53:48Z","updated_at":"2018-12-14T15:53:48Z","author_association":"CONTRIBUTOR","body":"Or we could also have ofPrameterSettings as a struct? But it could be almost same with existing  Value class "}}
{"actor":{"display_login":"hiroMTB"}}