mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Rename CLAP mutual recursive send function
To adhere to the CLAP message sending naming convention.
This commit is contained in:
@@ -253,14 +253,16 @@ class ClapBridge : public HostBridge {
|
|||||||
* explanatio nof why this is needed.
|
* explanatio nof why this is needed.
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename T::Response send_mutually_recursive_message(const T& object) {
|
typename T::Response send_mutually_recursive_main_thread_message(
|
||||||
|
const T& object) {
|
||||||
if (main_context_.is_gui_thread()) {
|
if (main_context_.is_gui_thread()) {
|
||||||
return mutual_recursion_.fork(
|
return mutual_recursion_.fork(
|
||||||
[&]() { return send_main_thread_message(object); });
|
[&]() { return send_main_thread_message(object); });
|
||||||
} else {
|
} else {
|
||||||
logger_.log_trace([]() {
|
logger_.log_trace([]() {
|
||||||
return "'ClapBridge::send_mutually_recursive_message()' called "
|
return "'ClapBridge::send_mutually_recursive_main_thread_"
|
||||||
"from a non-GUI thread, sending the message directly";
|
"message()' called from a non-GUI thread, sending the "
|
||||||
|
"message directly";
|
||||||
});
|
});
|
||||||
send_main_thread_message(object);
|
send_main_thread_message(object);
|
||||||
}
|
}
|
||||||
@@ -268,13 +270,14 @@ class ClapBridge : public HostBridge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Crazy functions ask for crazy naming. This is the other part of
|
* Crazy functions ask for crazy naming. This is the other part of
|
||||||
* `send_mutually_recursive_message()`, for executing mutually recursive
|
* `send_mutually_recursive_main_thread_message()`, for executing mutually
|
||||||
* functions on the GUI thread. If another thread is currently calling that
|
* recursive functions on the GUI thread. If another thread is currently
|
||||||
* function (from the UI thread), then we'll execute `fn` from the UI thread
|
* calling that function (from the UI thread), then we'll execute `fn` from
|
||||||
* using the IO context started in the above function. Otherwise `f` will be
|
* the UI thread using the IO context started in the above function.
|
||||||
* run on the UI thread through `main_context_` as usual.
|
* Otherwise `f` will be run on the UI thread through `main_context_` as
|
||||||
|
* usual.
|
||||||
*
|
*
|
||||||
* @see ClapBridge::send_mutually_recursive_message
|
* @see ClapBridge::send_mutually_recursive_main_thread_message
|
||||||
*/
|
*/
|
||||||
template <std::invocable F>
|
template <std::invocable F>
|
||||||
std::invoke_result_t<F> do_mutual_recursion_on_gui_thread(F&& fn) {
|
std::invoke_result_t<F> do_mutual_recursion_on_gui_thread(F&& fn) {
|
||||||
@@ -417,8 +420,8 @@ class ClapBridge : public HostBridge {
|
|||||||
std::shared_mutex object_instances_mutex_;
|
std::shared_mutex object_instances_mutex_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in `send_mutually_recursive_message()` to be able to execute
|
* Used in `send_mutually_recursive_main_thread_message()` to be able to
|
||||||
* functions from that same calling thread (through
|
* execute functions from that same calling thread (through
|
||||||
* `do_mutual_recursion_on_gui_thread()` and
|
* `do_mutual_recursion_on_gui_thread()` and
|
||||||
* `do_mutual_recursion_on_off_thread()`) while we're waiting for a
|
* `do_mutual_recursion_on_off_thread()`) while we're waiting for a
|
||||||
* response.
|
* response.
|
||||||
|
|||||||
Reference in New Issue
Block a user