mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 07:06:23 +01:00
VST3: use a dedicated connection list
This commit is contained in:
parent
1d6d4dc7b8
commit
debcda25b4
2 changed files with 19 additions and 11 deletions
|
|
@ -170,6 +170,8 @@ private:
|
|||
|
||||
boost::shared_ptr<ARDOUR::VST3PluginModule> _module;
|
||||
|
||||
std::vector <Vst::IConnectionPoint*> _connections;
|
||||
|
||||
FUID _fuid;
|
||||
IPluginFactory* _factory;
|
||||
Vst::IComponent* _component;
|
||||
|
|
|
|||
|
|
@ -1195,13 +1195,22 @@ VST3PI::disconnect_components ()
|
|||
tresult
|
||||
VST3PI::connect (Vst::IConnectionPoint* other)
|
||||
{
|
||||
return other ? kResultTrue : kInvalidArgument;
|
||||
if (!other) {
|
||||
return kInvalidArgument;
|
||||
}
|
||||
_connections.push_back (other);
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
tresult
|
||||
VST3PI::disconnect (Vst::IConnectionPoint* other)
|
||||
{
|
||||
return kResultTrue;
|
||||
std::vector <Vst::IConnectionPoint*>::const_iterator i = std::find (_connections.begin(), _connections.end(), other);
|
||||
if (i != _connections.end()) {
|
||||
_connections.erase (i);
|
||||
return kResultTrue;
|
||||
}
|
||||
return kInvalidArgument;
|
||||
}
|
||||
|
||||
tresult
|
||||
|
|
@ -1210,15 +1219,12 @@ VST3PI::notify (Vst::IMessage* msg)
|
|||
#ifndef NDEBUG
|
||||
std::cerr << "VST3PI::notify\n";
|
||||
#endif
|
||||
FUnknownPtr<Vst::IConnectionPoint> componentCP (_component);
|
||||
FUnknownPtr<Vst::IConnectionPoint> controllerCP (_controller);
|
||||
// XXX this bounces the message back..
|
||||
// we likely need a proxy here
|
||||
if (componentCP) {
|
||||
componentCP->notify (msg);
|
||||
}
|
||||
if (controllerCP) {
|
||||
controllerCP->notify (msg);
|
||||
for (std::vector <Vst::IConnectionPoint*>::const_iterator i = _connections.begin(); i != _connections.end(); ++i) {
|
||||
/* TODO delegate to GUI thread if available
|
||||
* see ./libs/pbd/pbd/event_loop.h ir->call_slot ()
|
||||
* and HostMessage()
|
||||
*/
|
||||
(*i)->notify (msg);
|
||||
}
|
||||
return kResultTrue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue