mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 04:50:14 +02:00
Rename EventHandler to Vst2EventHandler
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 <typename Thread>
|
||||
class EventHandler : public AdHocSocketHandler<Thread> {
|
||||
class Vst2EventHandler : public AdHocSocketHandler<Thread> {
|
||||
public:
|
||||
/**
|
||||
* Sets up a single main socket for this type of events. The sockets won't
|
||||
@@ -123,9 +124,9 @@ class EventHandler : public AdHocSocketHandler<Thread> {
|
||||
*
|
||||
* @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<Thread>(io_context, endpoint, listen) {}
|
||||
|
||||
/**
|
||||
@@ -148,7 +149,7 @@ class EventHandler : public AdHocSocketHandler<Thread> {
|
||||
* 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 <typename D>
|
||||
@@ -220,7 +221,7 @@ class EventHandler : public AdHocSocketHandler<Thread> {
|
||||
* @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 <invocable_returning<EventResult, Event&, bool> F>
|
||||
@@ -341,12 +342,12 @@ class Vst2Sockets : public Sockets {
|
||||
* The socket that forwards all `dispatcher()` calls from the VST host to
|
||||
* the plugin.
|
||||
*/
|
||||
EventHandler<Thread> host_vst_dispatch;
|
||||
Vst2EventHandler<Thread> host_vst_dispatch;
|
||||
/**
|
||||
* The socket that forwards all `audioMaster()` calls from the Windows VST
|
||||
* plugin to the host.
|
||||
*/
|
||||
EventHandler<Thread> vst_host_callback;
|
||||
Vst2EventHandler<Thread> 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<intptr_t, AEffect*, int, int, intptr_t, void*, float> F>
|
||||
|
||||
@@ -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<Thread, CallbackRequest> vst_host_callback;
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class Vst2PluginBridge : PluginBridge<Vst2Sockets<std::jthread>> {
|
||||
* 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user