{"id":13598811,"url":"https://github.com/2bbb/ofxPubSubOsc","last_synced_at":"2025-04-10T10:30:23.673Z","repository":{"id":31775455,"uuid":"35341797","full_name":"2bbb/ofxPubSubOsc","owner":"2bbb","description":"bind OSC messages and values with only writing tiny codes on setup once.","archived":false,"fork":false,"pushed_at":"2025-04-07T08:38:20.000Z","size":471,"stargazers_count":77,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-07T09:34:07.440Z","etag":null,"topics":["ofxaddons","ofxosc","openframeworks","openframeworks-addon","osc"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2bbb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["2bbb"]}},"created_at":"2015-05-09T19:18:40.000Z","updated_at":"2025-03-08T08:44:12.000Z","dependencies_parsed_at":"2025-02-12T11:32:13.340Z","dependency_job_id":"3deb2409-a8c8-4d24-87a9-9367d81fa68a","html_url":"https://github.com/2bbb/ofxPubSubOsc","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2bbb%2FofxPubSubOsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2bbb%2FofxPubSubOsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2bbb%2FofxPubSubOsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2bbb%2FofxPubSubOsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2bbb","download_url":"https://codeload.github.com/2bbb/ofxPubSubOsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ofxaddons","ofxosc","openframeworks","openframeworks-addon","osc"],"created_at":"2024-08-01T17:00:56.952Z","updated_at":"2025-04-10T10:30:23.359Z","avatar_url":"https://github.com/2bbb.png","language":"C++","readme":"# ofxPubSubOsc\n\neasy utility for publish/subscribe OSC message.\n\n## Dependencies\n\n* ofxOsc\n\n## Notice\n\n* this addon is tested with oF0.9.8~\n* if you use oF0.9.0~, then you can use `std::function\u003cvoid(ofxOscMessage \u0026)\u003e`! detail: [API Reference](API_Reference.md#API_lambda_callback)\n* **if you use oF~0.8.4, then you can use [branch:v0_1_x_oF084](../../tree/v0_1_x_oF084)**\n* if you have challange spirit, please use dev/vX.Y.Z branch.\n* if you want to join development ofxPubSubOsc, open the issue and post the PR for dev/vX.Y.Z.\n\n## TOC\n\n* [How to use](#HowToUse)\n* [Simple API Reference](#SimpleAPI)\n\t* [ofxSubscribeOsc](#SimpleAPI_ofxSubscribeOsc)\n\t* [ofxPublishOsc](#SimpleAPI_ofxPublishOsc)\n\t* [ofxRegisterPublishingOsc](#SimpleAPI_ofxRegisterPublishingOsc)\n* [Supported types](#SupportedTypes)\n\t* [Arithmetic](#SupportedTypes_Arithmetic)\n\t* [String](#SupportedTypes_String)\n\t* [openframeworks basic types](#SupportedTypes_ofBasic)\n\t* [ofParameter with supported types](#SupportedTypes_ofParameter)\n\t* [array/vector of supported types](#SupportedTypes_ArrayVector)\n\t* [Callback](#SupportedTypes_Callback)\n* [Update history](#UpdateHistory)\n* [License](#License)\n* [Author](#Author)\n* [Supporting Contributor](#SuppotingContributor)\n* [Special Thanks](#SpecialThanks)\n* [At the last](#AtTheLast)\n\n## \u003ca name=\"HowToUse\"\u003eHow to use\u003c/a\u003e\n\n```cpp\nclass ofApp : public ofBaseApp {\n\tint foo;\n\tofColor c;\n\tofPoint p;\npublic:\n\tvoid setup() {\n\t\tofxSubscribeOsc(9005, \"/foo\", foo);\n\t\tofxSubscribeOsc(9005, \"/color\", c);\n\t\tofxSubscribeOsc(9005, \"/p\", p);\n\t\t\n\t\tofxPublishOsc(\"localhost\", 9006, \"/fps\", \u0026ofGetFrameRate);\n\t\t\n\t\tofxSubscribeOsc(9005, \"/lambda\", [](const std::string \u0026str){\n\t\t\tofLogNotice() \u003c\u003c \"receive \" \u003c\u003c str;\n\t\t});\n\t\tofxSubscribeOsc(9005, \"/trigger_event\", [](){\n\t\t\tofLogNotice() \u003c\u003c \"receive trigger_event\";\n\t\t});\n\t}\n\t\n\tvoid update() {\n\t\t// do NOTHING about OSC on update!!!\n\t}\n\t\n\tvoid draw() {\n\t\tofSetColor(c);\n\t\tofDrawCircle(p, 5);\n\t}\n};\n\n```\n\n## \u003ca name=\"SimpleAPI\"\u003eSimple API Reference\u003c/a\u003e\n\n_API Reference is imperfect now._\n\n#### If you want to use advanced features, see [Advanced](API_Reference.md)\n\n### \u003ca name=\"SimpleAPI_ofxSubscribeOsc\"\u003eofxSubscribeOsc\u003c/a\u003e\n\n* void ofxSubscribeOsc(int _port_, const string \u0026_address_, [SupportedType](#SupportedTypes) \u0026_value_);\n\nbind a value to the argument(s) of OSC messages with an address pattern _address_ incoming to _port_.\n\n#### See [more ofxSubscribeOsc](API_Reference.md#API_ofxSubscribeOsc)\n\n* ofxUnsubscribeOsc(int _port_, const string \u0026_address_);\n\nunbind from OSC messages with an address pattern _address_ incoming to _port_.\n\n* ofxUnsubscribeOsc(int _port_);\n\nunbind from OSC messages with any address patterns incoming to _port_.\n\n* if you want to pick up OSCs which do not match the subscribed addresses, see [ofxSetLeadkedOscPicker](API_Reference.md#API_ofxSetLeadkedOscPicker)\n\n#### See [class ofxOscSubscriberManager](API_Reference.md#Advanced_ofxOscSubscriberManager), [class ofxOscSubscriber](API_Reference.md#Advanced_ofxOscSubscriber)\n\n### \u003ca name=\"SimpleAPI_ofxPublishOsc\"\u003eofxPublishOsc\u003c/a\u003e\n\n* void ofxPublishOsc(const string \u0026_ip_, int _port_, const string \u0026_address_, [SupportedType](#SupportedTypes) \u0026_value_, bool _whenValueIsChanged_ = **true**);\n\npublish _value_ as an OSC message with an address pattern _address_ to _ip:port_ every time the _value_ has changed. If _whenValueIsChanged_ is set to **false**, then the binded value is sent **every frame** after `App::update`.\n\n#### See [more ofxPublishOsc](API_Reference.md#API_ofxPublishOsc), [ofxPublishOscIf](API_Reference.md#API_ofxPublishOscIf)\n\n* void ofxUnpublishOsc(const string \u0026_ip_, int _port_, const string \u0026_address_);\n\nunbind a publisher sending OSC message with an address pattern _address_ to _ip:port_.\n\n* void ofxUnpublishOsc(const string \u0026_ip_, int _port_);\n\nunbind all the publishers sending to _ip:port_.\n\n#### See [class ofxOscPublisherManager](API_Reference.md#Advanced_ofxOscPublisherManager), [class ofxOscPublisher](API_Reference.md#Advanced_ofxOscPublisher)\n\n### \u003ca name=\"SimpleAPI_ofxRegisterPublishingOsc\"\u003eofxRegisterPublishingOsc\u003c/a\u003e\n\n* void ofxRegisterPublishingOsc(const string \u0026_ip_, int _port_, const string \u0026_address_, [SupportedType](#SupportedTypes) \u0026_value_)\n* void ofxPublishRegisteredOsc(const string \u0026_ip_, int _port_, const string \u0026_address_)\n\nregister value as an OSC message with an address pattern _address_ to _ip:port_. and publish when call `ofxPublishRegisteredOsc(ip, port, address)`.\n\n* void ofxUnregisterPublishingOsc(const string \u0026_ip_, int _port_, const string \u0026_address_)\n\nunregister OSC message with an address pattern _address_ to _ip:port_.\n\n* void ofxUnregisterPublishingOsc(const string \u0026_ip_, int _port_)\n\nunregister all the messages sending to _ip:port_.\n\n**NOTE**: registable type is same to `ofxPublishOsc`. see [more ofxPublishOsc](API_Reference.md#API_ofxPublishOsc).\n\n### \u003ca name=\"SimpleAPI_ofxSendOsc\"\u003eofxSendOsc\u003c/a\u003e\n\n* void ofxSendOsc(const string \u0026_ip_, int _port_, const string \u0026_address_, Arguments \u0026\u0026 ... arguments)\n\n## \u003ca name=\"SupportedTypes\"\u003eSupported types\u003c/a\u003e\n\n* Arithmetic is any type of Int32, Int64 or Float\n\n### \u003ca name=\"SupportedTypes_Arithmetic\"\u003eArithmetic (Int32, Int64, Float)\u003c/a\u003e\n* `bool` (published as _Int32_)\n* `unsigned char`, `char` (published as _Int32_)\n* `unsigned short`, `short` (published as _Int32_)\n* `unsigned int`, `int` (published as _Int32_ or _Int64_ (if `sizeof(int) == 8` then _Int64_))\n* `unsigned long`, `long` (published as _Int64_ or _Int64_ (if `sizeof(int) == 8` then _Int64_))\n* `unsigned long long`, `long long` (published as _Int64_)\n* `float` (published as _Float_)\n* `double` (published as _Float_)\n\n**NOTE**: `long double` is not guaranteed\n\n### \u003ca name=\"SupportedTypes_String\"\u003eString (String)\u003c/a\u003e\n* `string`\n\n### \u003ca name=\"SupportedTypes_ofBasic\"\u003eopenframeworks basic types\u003c/a\u003e\n\n#### Arithmetic\\[2\\]\n* `ofVec2f` (published as _Float_ \\* 2)\n\n#### Arithmetic\\[3\\]\n* `ofVec3f` (= `ofPoint`) (published as _Float_ \\* 3)\n\n#### Arithmetic\\[4\\]\n* `ofVec4f` (published as _Float_ \\* 4)\n* `ofColor` (published as _Int32_ \\* 4)\n* `ofShortColor` (published as _Int32_ \\* 4)\n* `ofFloatColor` (published as _Float_ \\* 4)\n* `ofQuaternion` (published as _Float_ \\* 4)\n* `ofRectangle` (published as _Float_ \\* 4)\n\n#### Arithmetic\\[9\\]\n* `ofMatrix3x3`  (published as _Float_ \\* 9)\n\n#### Arithmetic\\[16\\]\n* `ofMatrix4x4` (publish as _Float_ \\* 16)\n\n#### Blob\n* `ofBuffer`\n\n### \u003ca name=\"SupportedTypes_ofParameter\"\u003eofParameter with supported types\u003c/a\u003e\n\n* `ofParameter\u003cSupportedType\u003e`\n\n**NOTE**: we only support subscribing ofParameterGroup. See [How to subscribe ofParameterGroup](API_Reference.md#Advanced_how_to_subscribe_ofParameterGroup)\n\n### \u003ca name=\"SupportedTypes_ArrayVector\"\u003earray/vector of supported types\u003c/a\u003e\n\n* `SupportedType[size]`\n* `vector\u003cSupportedType\u003e`\n\nif you use `vector\u003cSomeType\u003e vec;`, when `vec` will be resized every receiving OSC messages.\n\n**NOTE**: do NOT use `vector\u003cvector\u003cSupportedType\u003e\u003e`, `vector\u003cSupportedType\u003e[size]`\n\n### \u003ca name=\"SupportedTypes_Callback\"\u003eCallback\u003c/a\u003e\n\n#### Subscribe\n\n* `std::function\u003cR(Arguments ...)\u003e`;\n* `std::function\u003cR(ofxOscMessage \u0026)\u003e`\n* pair of `U \u0026that`, `T (U::\\*callback)(Arguments ...)`;\n* pair of `U \\*that`, `T (U::\\*callback)(Arguments ...)`;\n\n`Arguments ...` are all of types we can use in \n\n#### Publish\n\n* `std::function\u003cT()\u003e`;\n* pair of `U \u0026that`, `T (U::\\*callback)()`;\n* pair of `U \\*that`, `T (U::\\*callback)()`;\n\n## \u003ca name=\"UpdateHistory\"\u003eUpdate history\u003c/a\u003e\n\n### 2021/09/30 [ver 0.3.3](../../releases/tag/v0_3_3)\n\n* fixed bug on ver 0.3.2  (issued by [hanasaan](https://github.com/hanasaan). thanks!!!)\n\n### 2021/09/26 ver 0.3.2 *[Deprecated!!]*\n\n* fixed constructor of ofxOscMessageEx\n* fixed some constness about notify, read\n\n### 2020/04/15 [ver 0.3.1](../../releases/tag/v0_3_1)\n* added ofxSubscribeAllOsc, ofxSubscribeAllOscForPort\n\n### 2018/05/08 [ver 0.3.0](../../releases/tag/v0_3_0)\n\n* refactor all for C++11\n* add `ofxSendOsc`\n* ofxSubscribeOsc got more flexible.\n  * multi arguments\n  * multi arguments callback\n* add `ofxOscMessageEx`\n\n### [Older update histories](Update_History.md)\n\n\n#### about Versioning\n\nofxPubSubOsc uses Mood Versioning. maybe, 1.0.0. will not come.\n\n## \u003ca name=\"License\"\u003eLicense\u003c/a\u003e\n\nMIT License.\n\n## \u003ca name=\"Author\"\u003eAuthor\u003c/a\u003e\n\n* ISHII 2bit [ISHII Tsuubito Program Office]\n* i[at]2bit.jp\n\n## \u003ca name=\"SuppotingContributor\"\u003eSupporting Contributor\u003c/a\u003e\n\n* [HIEDA Naoto](https://github.com/micuat)\n\n## \u003ca name=\"SpecialThanks\"\u003eSpecial Thanks\u003c/a\u003e\n\n* [HIGA Satoru](https://github.com/satoruhiga)\n* [SHIMIZU Motoi](https://github.com/motoishmz)\n* [IWATANI Nariaki](https://github.com/nariakiiwatani)\n* [USAMI Takuto](https://github.com/usm916)\n* [HORII Satoshi](https://github.com/satcy)\n* [TOMOTO Yusuke](https://github.com/yusuketomoto)\n* [HANAI Yuuya](https://github.com/hanasaan)\n* [musiko](https://github.com/musiko)\n* [TAESU Yuma](https://github.com/yumataesu)\n* [HAYASAKA Akira](https://github.com/Akira-Hayasaka)\n* [ASAI](https://github.com/asaiyuta)\n* [Aris Bezas](https://github.com/igoumeninja)\n* [moebiussurfing](https://github.com/moebiussurfing)\n\n## \u003ca name=\"AtTheLast\"\u003eAt the last\u003c/a\u003e\n\nPlease create a new issue if there is a problem.\n\nAnd please throw a pull request if you have a cool idea!!\n\nIf you get happy with using this addon, and you're rich, please donation for support continuous development.\n\nBitcoin: `17AbtW73aydfYH3epP8T3UDmmDCcXSGcaf`\n\n","funding_links":["https://github.com/sponsors/2bbb"],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2bbb%2FofxPubSubOsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2bbb%2FofxPubSubOsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2bbb%2FofxPubSubOsc/lists"}