From a1947656968793e29bf231006b6aa0450d4e6754 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 20 May 2021 13:54:31 +0200 Subject: [PATCH] Rename EventHandler to Vst2EventHandler --- docs/architecture.md | 4 ++-- src/common/communication/vst2.h | 29 +++++++++++++++-------------- src/common/communication/vst3.h | 6 +++--- src/plugin/bridges/vst2.h | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index d7ccfb1c..40ece5b1 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -134,8 +134,8 @@ over: below) are already in fairly easily serializable format, we use the `*DataConverter` classes to read and write payload data depending on the opcode (or to make a best guess estimate if we're dealing with some unknown - undocumented function), and we then `EventHandler::send_event()`, - `EventHandler::receive_events()`, and `passthrough_event()` to pass through + undocumented function), and we then `Vst2EventHandler::send_event()`, + `Vst2EventHandler::receive_events()`, and `passthrough_event()` to pass through these function calls. - For callbacks made by the Windows plugin using the provided `audioMaster()` function we do exactly the same as the above, but the other way around. diff --git a/src/common/communication/vst2.h b/src/common/communication/vst2.h index 051fd174..9d899ff6 100644 --- a/src/common/communication/vst2.h +++ b/src/common/communication/vst2.h @@ -97,17 +97,18 @@ class DefaultDataConverter { * - Aside from that the listening side will have a second thread asynchronously * listening for new connections on the socket endpoint. * - * The `EventHandler::send_event()` method is used to send events. If the socket - * is currently being written to, we'll first create a new socket connection as - * described above. Similarly, the `EventHandler::receive_events()` method first - * sets up asynchronous listeners for the socket endpoint, and then block and - * handle events until the main socket is closed. + * The `Vst2EventHandler::send_event()` method is used to send events. If the + * socket is currently being written to, we'll first create a new socket + * connection as described above. Similarly, the + * `Vst2EventHandler::receive_events()` method first sets up asynchronous + * listeners for the socket endpoint, and then block and handle events until the + * main socket is closed. * * @tparam Thread The thread implementation to use. On the Linux side this * should be `std::jthread` and on the Wine side this should be `Win32Thread`. */ template -class EventHandler : public AdHocSocketHandler { +class Vst2EventHandler : public AdHocSocketHandler { public: /** * Sets up a single main socket for this type of events. The sockets won't @@ -123,9 +124,9 @@ class EventHandler : public AdHocSocketHandler { * * @see Sockets::connect */ - EventHandler(boost::asio::io_context& io_context, - boost::asio::local::stream_protocol::endpoint endpoint, - bool listen) + Vst2EventHandler(boost::asio::io_context& io_context, + boost::asio::local::stream_protocol::endpoint endpoint, + bool listen) : AdHocSocketHandler(io_context, endpoint, listen) {} /** @@ -148,7 +149,7 @@ class EventHandler : public AdHocSocketHandler { * this is for sending `dispatch()` events or host callbacks. Optional * since it doesn't have to be done on both sides. * - * @relates EventHandler::receive_events + * @relates Vst2EventHandler::receive_events * @relates passthrough_event */ template @@ -220,7 +221,7 @@ class EventHandler : public AdHocSocketHandler { * @param callback The function used to generate a response out of an event. * See the definition of `F` for more information. * - * @relates EventHandler::send_event + * @relates Vst2EventHandler::send_event * @relates passthrough_event */ template F> @@ -341,12 +342,12 @@ class Vst2Sockets : public Sockets { * The socket that forwards all `dispatcher()` calls from the VST host to * the plugin. */ - EventHandler host_vst_dispatch; + Vst2EventHandler host_vst_dispatch; /** * The socket that forwards all `audioMaster()` calls from the Windows VST * plugin to the host. */ - EventHandler vst_host_callback; + Vst2EventHandler vst_host_callback; /** * Used for both `getParameter` and `setParameter` since they mostly * overlap. @@ -384,7 +385,7 @@ class Vst2Sockets : public Sockets { * @return The result of the operation. If necessary the `DataConverter` will * unmarshall the payload again and write it back. * - * @relates EventHandler::receive_events + * @relates Vst2EventHandler::receive_events */ template < invocable_returning F> diff --git a/src/common/communication/vst3.h b/src/common/communication/vst3.h index 964b911a..51f5376b 100644 --- a/src/common/communication/vst3.h +++ b/src/common/communication/vst3.h @@ -29,7 +29,7 @@ * request of type `T`, where `T` is in `{Control,Callback}Request`, should be * answered with an object of type `T::Response`. * - * See the docstrings on `EventHandler` and `AdHocSocketHandler` for more + * See the docstrings on `Vst2EventHandler` and `AdHocSocketHandler` for more * information on how this works internally and why it works the way it does. * * @note The name of this class is not to be confused with VST3's `IMessage` as @@ -475,7 +475,7 @@ class Vst3Sockets : public Sockets { /** * For sending messages from the host to the plugin. After we have a better * idea of what our communication model looks like we'll probably want to - * provide an abstraction similar to `EventHandler`. For optimization + * provide an abstraction similar to `Vst2EventHandler`. For optimization * reasons calls to `IAudioProcessor` or `IComponent` are handled using the * dedicated sockets in `audio_processor_sockets`. * @@ -487,7 +487,7 @@ class Vst3Sockets : public Sockets { /** * For sending callbacks from the plugin back to the host. After we have a * better idea of what our communication model looks like we'll probably - * want to provide an abstraction similar to `EventHandler`. + * want to provide an abstraction similar to `Vst2EventHandler`. */ Vst3MessageHandler vst_host_callback; diff --git a/src/plugin/bridges/vst2.h b/src/plugin/bridges/vst2.h index db10f6e5..d46b2d1d 100644 --- a/src/plugin/bridges/vst2.h +++ b/src/plugin/bridges/vst2.h @@ -138,7 +138,7 @@ class Vst2PluginBridge : PluginBridge> { * A mutex to prevent multiple simultaneous calls to `getParameter()` and * `setParameter()`. This likely won't happen, but better safe than sorry. * For `dispatch()` and `audioMaster()` there's some more complex logic for - * this in `EventHandler`. + * this in `Vst2EventHandler`. */ std::mutex parameters_mutex;