Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
lv2_worker.h
1/*
2 Copyright 2007-2016 David Robillard <http://drobilla.net>
3
4 Permission to use, copy, modify, and/or distribute this software for any
5 purpose with or without fee is hereby granted, provided that the above
6 copyright notice and this permission notice appear in all copies.
7
8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
16 SPDX-License-Identifier: ISC
17*/
18
19#ifndef __PLUGINS_LV2_WORKER_H__
20#define __PLUGINS_LV2_WORKER_H__
21
22#include "lv2/worker/worker.h"
23#include "zix/ring.h"
24#include "zix/sem.h"
25#include "zix/thread.h"
26#include <lilv/lilv.h>
27
28typedef struct Lv2Plugin Lv2Plugin;
29
30typedef struct
31{
33 ZixRing * requests;
34 ZixRing * responses;
35 void * response;
36 ZixSem sem;
37 ZixThread thread;
38 const LV2_Worker_Interface * iface;
39 bool threaded;
40} Lv2Worker;
41
42void
43lv2_worker_init (
46 const LV2_Worker_Interface * iface,
47 bool threaded);
48
52void
53lv2_worker_finish (Lv2Worker * worker);
54
60LV2_Worker_Status
61lv2_worker_schedule (
62 LV2_Worker_Schedule_Handle handle,
63 uint32_t size,
64 const void * data);
65
72void
73lv2_worker_emit_responses (Lv2Worker * worker, LilvInstance * instance);
74
75#endif
LV2 plugin.
Definition lv2_plugin.h:141
Plugin * plugin
Base Plugin instance (parent).
Definition lv2_plugin.h:308
LilvInstance * instance
Plugin instance (shared library).
Definition lv2_plugin.h:221
Lv2Worker worker
Worker thread implementation.
Definition lv2_plugin.h:210
ZixRing * responses
Responses from the worker.
Definition lv2_worker.h:34
ZixThread thread
Worker thread.
Definition lv2_worker.h:37
void * response
Worker response buffer.
Definition lv2_worker.h:35
const LV2_Worker_Interface * iface
Plugin worker interface.
Definition lv2_worker.h:38
Lv2Plugin * plugin
Pointer back to the plugin.
Definition lv2_worker.h:32
ZixRing * requests
Requests to the worker.
Definition lv2_worker.h:33
ZixSem sem
Worker semaphore.
Definition lv2_worker.h:36
bool threaded
Run work in another thread.
Definition lv2_worker.h:39