very, very simple WP with midi CC out

This commit is contained in:
Sebastian
2024-10-09 02:01:23 +02:00
commit 3d6fc151f1
126 changed files with 19539 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include <chrono>
#include <semaphore>
struct semaphore_pair_lock
{
std::binary_semaphore sem_cleanup{0};
std::binary_semaphore sem_needpost{0};
void prepare_release_client()
{
using namespace std::literals;
// FIXME if jack is not running we can skip this
this->sem_needpost.release();
this->sem_cleanup.try_acquire_for(1s);
}
void check_client_released()
{
if (!this->sem_needpost.try_acquire())
this->sem_cleanup.release();
}
};