Skip to content

Commit 7dd4698

Browse files
authored
Keep lilv instances always active, only deactivate jack clients (#92)
* Keep lilv instances always active, only deactivate jack clients Signed-off-by: falkTX <falktx@falktx.com> * Plugins always start activated (in lv2 sense) Signed-off-by: falkTX <falktx@falktx.com> --------- Signed-off-by: falkTX <falktx@falktx.com>
1 parent e50c17d commit 7dd4698

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

src/effects.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,13 +1147,11 @@ static int BufferSize(jack_nframes_t nframes, void* data)
11471147
options[4].type = 0;
11481148
options[4].value = NULL;
11491149

1150-
if (effect->activated)
1151-
lilv_instance_deactivate(effect->lilv_instance);
1150+
lilv_instance_deactivate(effect->lilv_instance);
11521151

11531152
effect->options_interface->set(effect->lilv_instance->lv2_handle, options);
11541153

1155-
if (effect->activated)
1156-
lilv_instance_activate(effect->lilv_instance);
1154+
lilv_instance_activate(effect->lilv_instance);
11571155
}
11581156
}
11591157
#ifdef HAVE_HYLIA
@@ -6025,10 +6023,10 @@ int effects_add(const char *uri, int instance, int activate)
60256023
jack_set_buffer_size_callback(jack_client, BufferSize, effect);
60266024
jack_set_freewheel_callback(jack_client, FreeWheelMode, effect);
60276025

6026+
lilv_instance_activate(lilv_instance);
6027+
60286028
if (activate)
60296029
{
6030-
lilv_instance_activate(lilv_instance);
6031-
60326030
/* Try activate the Jack client */
60336031
if (jack_activate(jack_client) != 0)
60346032
{
@@ -6472,9 +6470,7 @@ static void effects_remove_inner_loop(int effect_id)
64726470

64736471
if (effect->lilv_instance)
64746472
{
6475-
if (effect->activated)
6476-
lilv_instance_deactivate(effect->lilv_instance);
6477-
6473+
lilv_instance_deactivate(effect->lilv_instance);
64786474
lilv_instance_free(effect->lilv_instance);
64796475
}
64806476

@@ -6731,7 +6727,6 @@ int effects_activate(int effect_id, int value)
67316727
if (! effect->activated)
67326728
{
67336729
effect->activated = true;
6734-
lilv_instance_activate(effect->lilv_instance);
67356730

67366731
if (jack_activate(effect->jack_client) != 0)
67376732
{
@@ -6751,8 +6746,6 @@ int effects_activate(int effect_id, int value)
67516746
fprintf(stderr, "can't deactivate jack_client\n");
67526747
return ERR_JACK_CLIENT_DEACTIVATION;
67536748
}
6754-
6755-
lilv_instance_deactivate(effect->lilv_instance);
67566749
}
67576750
}
67586751

@@ -6765,8 +6758,6 @@ static void* effects_activate_thread(void* arg)
67656758

67666759
effect->activated = true;
67676760

6768-
lilv_instance_activate(effect->lilv_instance);
6769-
67706761
if (jack_activate(effect->jack_client) != 0)
67716762
fprintf(stderr, "can't activate jack_client\n");
67726763

@@ -6780,8 +6771,6 @@ static void* effects_deactivate_thread(void* arg)
67806771
if (jack_deactivate(effect->jack_client) != 0)
67816772
fprintf(stderr, "can't deactivate jack_client\n");
67826773

6783-
lilv_instance_deactivate(effect->lilv_instance);
6784-
67856774
effect->activated = false;
67866775

67876776
return NULL;

0 commit comments

Comments
 (0)