MCPcopy Create free account
hub / github.com/audacity/audacity / Serve

Method Serve

libraries/lib-module-manager/PluginHost.cpp:126–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126bool PluginHost::Serve()
127{
128 std::unique_lock lck(mSync);
129 mRequestCondition.wait(lck, [this]{ return !mRunning || mRequest.has_value(); });
130
131 if(!mRunning)
132 return false;
133
134 if(mRequest)
135 {
136 if(mChannel)
137 detail::PutMessage(*mChannel, wxEmptyString);
138
139 std::optional<wxString> request;
140 mRequest.swap(request);
141
142 lck.unlock();
143
144 wxString providerId;
145 wxString pluginPath;
146 detail::PluginValidationResult result;
147 if(detail::ParseRequestString(*request, providerId, pluginPath))
148 Discover(result, providerId, pluginPath);
149 else
150 result.SetError("malformed request string");
151
152 XMLStringWriter xmlWriter;
153 result.WriteXML(xmlWriter);
154
155 lck.lock();
156 if(mChannel)
157 detail::PutMessage(*mChannel, xmlWriter);
158 }
159
160 return true;
161}
162
163
164void PluginHost::Stop() noexcept

Callers 1

OnInitMethod · 0.80

Calls 7

DiscoverFunction · 0.85
has_valueMethod · 0.80
unlockMethod · 0.80
swapMethod · 0.45
SetErrorMethod · 0.45
WriteXMLMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected