Skip to content

Commit c74f24c

Browse files
committed
Support lv2:isLive
Signed-off-by: falkTX <[email protected]>
1 parent 0fa82d1 commit c74f24c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/effects.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ enum PluginHints {
242242
HINT_HAS_MIDI_INPUT = 1 << 3,
243243
HINT_HAS_STATE = 1 << 4,
244244
HINT_STATE_UNSAFE = 1 << 5, // state restore needs mutex protection
245+
HINT_IS_LIVE = 1 << 6, // needs to be always running, cannot have processing disabled
245246
};
246247

247248
enum TransportSyncMode {
@@ -484,6 +485,7 @@ typedef struct LILV_NODES_T {
484485
LilvNode *hmi_interface;
485486
LilvNode *input;
486487
LilvNode *integer;
488+
LilvNode *is_live;
487489
LilvNode *license_interface;
488490
LilvNode *logarithmic;
489491
LilvNode *maximum;
@@ -1795,8 +1797,9 @@ static int ProcessPlugin(jack_nframes_t nframes, void *arg)
17951797
if (arg == NULL) return 0;
17961798
effect = arg;
17971799

1798-
if (!g_processing_enabled || (
1799-
(effect->hints & HINT_STATE_UNSAFE) && pthread_mutex_trylock(&effect->state_restore_mutex) != 0))
1800+
if ((effect->hints & HINT_IS_LIVE) == 0 &&
1801+
(!g_processing_enabled || (
1802+
(effect->hints & HINT_STATE_UNSAFE) && pthread_mutex_trylock(&effect->state_restore_mutex) != 0)))
18001803
{
18011804
for (i = 0; i < effect->output_audio_ports_count; i++)
18021805
{
@@ -4273,6 +4276,7 @@ int effects_init(void* client)
42734276
g_lilv_nodes.input = lilv_new_uri(g_lv2_data, LILV_URI_INPUT_PORT);
42744277
g_lilv_nodes.integer = lilv_new_uri(g_lv2_data, LV2_CORE__integer);
42754278
g_lilv_nodes.license_interface = lilv_new_uri(g_lv2_data, MOD_LICENSE__interface);
4279+
g_lilv_nodes.is_live = lilv_new_uri(g_lv2_data, LV2_CORE__isLive);
42764280
g_lilv_nodes.logarithmic = lilv_new_uri(g_lv2_data, LV2_PORT_PROPS__logarithmic);
42774281
g_lilv_nodes.maximum = lilv_new_uri(g_lv2_data, LV2_CORE__maximum);
42784282
g_lilv_nodes.midiEvent = lilv_new_uri(g_lv2_data, LV2_MIDI__MidiEvent);
@@ -4632,6 +4636,7 @@ int effects_finish(int close_client)
46324636
lilv_node_free(g_lilv_nodes.integer);
46334637
lilv_node_free(g_lilv_nodes.license_interface);
46344638
lilv_node_free(g_lilv_nodes.logarithmic);
4639+
lilv_node_free(g_lilv_nodes.is_live);
46354640
lilv_node_free(g_lilv_nodes.maximum);
46364641
lilv_node_free(g_lilv_nodes.midiEvent);
46374642
lilv_node_free(g_lilv_nodes.minimum);
@@ -4822,6 +4827,10 @@ int effects_add(const char *uri, int instance, int activate)
48224827
effect->control_index = -1;
48234828
}
48244829

4830+
/* Query plugin features */
4831+
if (lilv_plugin_has_feature(effect->lilv_plugin, g_lilv_nodes.is_live))
4832+
effect->hints |= HINT_IS_LIVE;
4833+
48254834
/* Query plugin extensions/interfaces */
48264835
if (lilv_plugin_has_extension_data(effect->lilv_plugin, g_lilv_nodes.worker_interface))
48274836
{

src/monitor/monitor-client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ int jack_initialize(jack_client_t* client, const char* load_init)
399399
}
400400

401401
/* allocate monitor client */
402-
monitor_client_t *const mon = calloc(sizeof(monitor_client_t), 1);
402+
monitor_client_t *const mon = calloc(1, sizeof(monitor_client_t));
403403

404404
if (!mon)
405405
{

0 commit comments

Comments
 (0)