| 54 | }; |
| 55 | |
| 56 | DspNetwork::DspNetwork(hise::ProcessorWithScriptingContent* p, ValueTree data_, bool poly, ExternalDataHolder* dataHolder_) : |
| 57 | ConstScriptingObject(p, 2), |
| 58 | ControlledObject(p->getMainController_()), |
| 59 | data(data_), |
| 60 | isPoly(poly), |
| 61 | polyHandler(poly), |
| 62 | faustManager(*this), |
| 63 | #if HISE_INCLUDE_SNEX |
| 64 | codeManager(*this), |
| 65 | #endif |
| 66 | parentHolder(dynamic_cast<Holder*>(p)), |
| 67 | projectNodeHolder(*this) |
| 68 | { |
| 69 | jassert(data.getType() == PropertyIds::Network); |
| 70 | |
| 71 | tempoSyncer.publicModValue = &networkModValue; |
| 72 | |
| 73 | auto mc_ = p->getMainController_(); |
| 74 | |
| 75 | addPostInitFunction([mc_, this]() |
| 76 | { |
| 77 | if(auto rm = dynamic_cast<scriptnode::routing::GlobalRoutingManager*>(mc_->getGlobalRoutingManager())) |
| 78 | { |
| 79 | tempoSyncer.additionalEventStorage = &rm->additionalEventStorage; |
| 80 | return true; |
| 81 | } |
| 82 | |
| 83 | return false; |
| 84 | }); |
| 85 | |
| 86 | polyHandler.setTempoSyncer(&tempoSyncer); |
| 87 | getScriptProcessor()->getMainController_()->addTempoListener(&tempoSyncer); |
| 88 | |
| 89 | if(!data.hasProperty(PropertyIds::AllowCompilation)) |
| 90 | data.setProperty(PropertyIds::AllowCompilation, false, nullptr); |
| 91 | |
| 92 | if(!data.hasProperty(PropertyIds::AllowPolyphonic)) |
| 93 | data.setProperty(PropertyIds::AllowPolyphonic, isPoly, nullptr); |
| 94 | |
| 95 | if(!data.hasProperty(PropertyIds::CompileChannelAmount)) |
| 96 | data.setProperty(PropertyIds::CompileChannelAmount, 2, nullptr); |
| 97 | |
| 98 | if (!data.hasProperty(PropertyIds::HasTail)) |
| 99 | data.setProperty(PropertyIds::HasTail, true, nullptr); |
| 100 | |
| 101 | if(!data.hasProperty(PropertyIds::SuspendOnSilence)) |
| 102 | data.setProperty(PropertyIds::SuspendOnSilence, false, nullptr); |
| 103 | |
| 104 | hasTailProperty.referTo(data, PropertyIds::HasTail, &um, true); |
| 105 | canBeSuspendedProperty.referTo(data, PropertyIds::SuspendOnSilence, &um, false); |
| 106 | |
| 107 | if (!data.hasProperty(ExpansionIds::Version)) |
| 108 | { |
| 109 | data.setProperty(ExpansionIds::Version, "0.0.0", nullptr); |
| 110 | } |
| 111 | |
| 112 | if (dataHolder_ != nullptr) |
| 113 | setExternalDataHolder(dataHolder_); |
nothing calls this directly
no test coverage detected