MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / set_parent_actor_addr

Method set_parent_actor_addr

src/module/src/module.cpp:82–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void Module::set_parent_actor_addr(caf::actor_addr addr) {
83
84
85 parent_actor_addr_ = addr;
86 if (!attribute_events_group_) {
87 attribute_events_group_ =
88 self()->home_system().spawn<broadcast::BroadcastActor>(self());
89 try {
90 auto prefs = global_store::GlobalStoreHelper(self()->home_system());
91 // only on init..
92 utility::JsonStore j;
93 auto a = caf::actor_cast<caf::event_based_actor *>(self());
94 if (a) {
95 join_broadcast(a, prefs.get_group(j));
96 } else {
97 auto b = caf::actor_cast<caf::blocking_actor *>(self());
98 if (b) {
99 join_broadcast(b, prefs.get_group(j));
100 }
101 }
102 update_attrs_from_preferences(j);
103
104 } catch (std::exception &e) {
105 spdlog::warn("{} {}", __PRETTY_FUNCTION__, e.what());
106 }
107 }
108
109 // we can't add hotkeys until the parent actor has been set. Subclasses of
110 // Module should define hotkeys in the virtual register_hotkeys() function
111}
112
113void Module::delete_attribute(const utility::Uuid &attribute_uuid) {
114 for (auto p = attributes_.begin(); p != attributes_.end(); ++p) {

Callers 2

IvyDataSourceActorMethod · 0.80
MediaHookActorMethod · 0.80

Calls 4

home_systemMethod · 0.80
get_groupMethod · 0.80
whatMethod · 0.80
GlobalStoreHelperClass · 0.50

Tested by

no test coverage detected