46ComponentBase::ComponentBase ()
51ComponentBase::~ComponentBase ()
62 hostContext = context;
71 hostContext =
nullptr;
77 peerConnection->disconnect (
this);
78 peerConnection =
nullptr;
88 return kInvalidArgument;
94 peerConnection = other;
101 if (peerConnection && other == peerConnection)
103 peerConnection =
nullptr;
113 return kInvalidArgument;
115 if (FIDStringsEqual (message->
getMessageID (),
"TextMessage"))
117 TChar string[256] = {0};
141 if (message !=
nullptr &&
getPeer () !=
nullptr)
151 msg->setMessageID (
"TextMessage");
155 msg->getAttributes ()->setString (
"Text", tmp.
text16 ());
166 msg->setMessageID (messageID);
virtual int32 length() const
Return length of string.
FUnknownPtr - automatic interface conversion and smart pointer in one.
The basic interface of all interfaces.
const char8 * text8() const SMTG_OVERRIDE
Returns pointer to string of type char8.
const char16 * text16() const SMTG_OVERRIDE
Returns pointer to string of type char16.
String & remove(uint32 index=0, int32 n=-1)
Remove n characters from string starting at index (n=-1: until end)
tresult PLUGIN_API notify(IMessage *message) SMTG_OVERRIDE
Called when a message has been sent from the connection point to this.
IConnectionPoint * getPeer() const
Returns the peer for the messaging communication (you can only use IConnectionPoint::notify for commu...
IMessage * allocateMessage() const
Allocates a message instance (do not forget to release it).
tresult PLUGIN_API initialize(FUnknown *context) SMTG_OVERRIDE
The host passes a number of interfaces as context to initialize the plug-in class.
tresult PLUGIN_API terminate() SMTG_OVERRIDE
This function is called before the plug-in is unloaded and can be used for cleanups.
tresult sendTextMessage(const char8 *text) const
Sends a simple text message to the peer (max 255 characters).
virtual tresult receiveText(const char8 *text)
Receives a simple text message from the peer (max 255 characters).
tresult PLUGIN_API connect(IConnectionPoint *other) SMTG_OVERRIDE
Connects this instance with another connection point.
tresult sendMessage(IMessage *message) const
Sends the given message to the peer.
tresult sendMessageID(const char8 *messageID) const
Sends a message with a given ID without any other payload.
tresult PLUGIN_API disconnect(IConnectionPoint *other) SMTG_OVERRIDE
Disconnects a given connection point from this.
virtual tresult PLUGIN_API getString(AttrID id, TChar *string, uint32 sizeInBytes)=0
Gets string value (UTF16).
Connect a component with another one: Vst::IConnectionPoint.
virtual tresult PLUGIN_API notify(IMessage *message)=0
Called when a message has been sent from the connection point to this.
Private plug-in message: Vst::IMessage.
virtual IAttributeList *PLUGIN_API getAttributes()=0
Returns the attribute list associated to the message.
virtual FIDString PLUGIN_API getMessageID()=0
Returns the message ID (for example "TextMessage").
char16 TChar
UTF-16 character.
IMessage * allocateMessage(IHostApplication *host)
Helper to allocate a message.
IPtr< I > owned(I *p)
Assigning newly created object to an IPtr.