| 2181 | } |
| 2182 | |
| 2183 | v3_result ctrl2view_notify(v3_message** const message) |
| 2184 | { |
| 2185 | DISTRHO_SAFE_ASSERT_RETURN(fConnectionFromCtrlToView != nullptr, V3_INTERNAL_ERR); |
| 2186 | |
| 2187 | const char* const msgid = v3_cpp_obj(message)->get_message_id(message); |
| 2188 | DISTRHO_SAFE_ASSERT_RETURN(msgid != nullptr, V3_INVALID_ARG); |
| 2189 | |
| 2190 | if (std::strcmp(msgid, "init") == 0) |
| 2191 | { |
| 2192 | fConnectedToUI = true; |
| 2193 | |
| 2194 | #if DPF_VST3_USES_SEPARATE_CONTROLLER |
| 2195 | fParameterValueChangesForUI[kVst3InternalParameterSampleRate] = false; |
| 2196 | sendParameterSetToUI(kVst3InternalParameterSampleRate, |
| 2197 | fCachedParameterValues[kVst3InternalParameterSampleRate]); |
| 2198 | #endif |
| 2199 | |
| 2200 | #if DISTRHO_PLUGIN_WANT_PROGRAMS |
| 2201 | fParameterValueChangesForUI[kVst3InternalParameterProgram] = false; |
| 2202 | sendParameterSetToUI(kVst3InternalParameterProgram, fCurrentProgram); |
| 2203 | #endif |
| 2204 | |
| 2205 | #if DISTRHO_PLUGIN_WANT_FULL_STATE |
| 2206 | // Update current state from plugin side |
| 2207 | for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) |
| 2208 | { |
| 2209 | const String& key(cit->first); |
| 2210 | fStateMap[key] = fPlugin.getStateValue(key); |
| 2211 | } |
| 2212 | #endif |
| 2213 | |
| 2214 | #if DISTRHO_PLUGIN_WANT_STATE |
| 2215 | // Set state |
| 2216 | for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) |
| 2217 | { |
| 2218 | const String& key(cit->first); |
| 2219 | const String& value(cit->second); |
| 2220 | |
| 2221 | sendStateSetToUI(key, value); |
| 2222 | } |
| 2223 | #endif |
| 2224 | |
| 2225 | for (uint32_t i=0; i<fParameterCount; ++i) |
| 2226 | { |
| 2227 | fParameterValueChangesForUI[kVst3InternalParameterBaseCount + i] = false; |
| 2228 | sendParameterSetToUI(kVst3InternalParameterCount + i, |
| 2229 | fCachedParameterValues[kVst3InternalParameterBaseCount + i]); |
| 2230 | } |
| 2231 | |
| 2232 | sendReadyToUI(); |
| 2233 | return V3_OK; |
| 2234 | } |
| 2235 | |
| 2236 | DISTRHO_SAFE_ASSERT_RETURN(fConnectedToUI, V3_INTERNAL_ERR); |
| 2237 | |
| 2238 | v3_attribute_list** const attrs = v3_cpp_obj(message)->get_attributes(message); |
| 2239 | DISTRHO_SAFE_ASSERT_RETURN(attrs != nullptr, V3_INVALID_ARG); |
| 2240 |
nothing calls this directly
no test coverage detected