Skip to content

Commit 92fbabf

Browse files
committed
activate: use 1 effect at a time, for now
Signed-off-by: falkTX <falktx@falktx.com>
1 parent 09264f9 commit 92fbabf

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ The commands supported by mod-host are:
116116
e.g.: remove 0
117117
when instance_number is -1 all plugins will be removed
118118

119-
activate <instance_number> <instance_number_end> <activate_value>
120-
* toggle effects activated state
121-
e.g.: activate 0 0 1
119+
activate <instance_number> <activate_value>
120+
* toggle effect activated state
121+
e.g.: activate 0 1
122122
if activate_value = 1 activate effect
123123
if activate_value = 0 deactivate effect
124124

src/effects.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5984,6 +5984,7 @@ int effects_remove(int effect_id)
59845984
return SUCCESS;
59855985
}
59865986

5987+
#if 0
59875988
static void* effects_activate_thread(void* arg)
59885989
{
59895990
jack_client_t *jack_client = arg;
@@ -6003,20 +6004,23 @@ static void* effects_deactivate_thread(void* arg)
60036004

60046005
return NULL;
60056006
}
6007+
#endif
60066008

6007-
int effects_activate(int effect_id, int effect_id_end, int value)
6009+
int effects_activate(int effect_id, int value)
60086010
{
60096011
if (!InstanceExist(effect_id))
60106012
{
60116013
return ERR_INSTANCE_NON_EXISTS;
60126014
}
6015+
#if 0
60136016
if (effect_id > effect_id_end)
60146017
{
60156018
return ERR_INVALID_OPERATION;
60166019
}
60176020

60186021
if (effect_id == effect_id_end)
60196022
{
6023+
#endif
60206024
effect_t *effect = &g_effects[effect_id];
60216025

60226026
if (value)
@@ -6048,6 +6052,7 @@ int effects_activate(int effect_id, int effect_id_end, int value)
60486052
lilv_instance_deactivate(effect->lilv_instance);
60496053
}
60506054
}
6055+
#if 0
60516056
}
60526057
else
60536058
{
@@ -6102,6 +6107,7 @@ int effects_activate(int effect_id, int effect_id_end, int value)
61026107
}
61036108
}
61046109
}
6110+
#endif
61056111

61066112
return SUCCESS;
61076113
}

src/effects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int effects_init(void* client);
137137
int effects_finish(int close_client);
138138
int effects_add(const char *uri, int instance, int activate);
139139
int effects_remove(int effect_id);
140-
int effects_activate(int effect_id, int effect_id_end, int value);
140+
int effects_activate(int effect_id, int value);
141141
int effects_preset_load(int effect_id, const char *uri);
142142
int effects_preset_save(int effect_id, const char *dir, const char *file_name, const char *label);
143143
int effects_preset_show(const char *uri, char **state_str);

src/mod-host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void effects_remove_cb(proto_t *proto)
145145
static void effects_activate_cb(proto_t *proto)
146146
{
147147
int resp;
148-
resp = effects_activate(atoi(proto->list[1]), atoi(proto->list[2]), atoi(proto->list[3]));
148+
resp = effects_activate(atoi(proto->list[1]), atoi(proto->list[2]));
149149
protocol_response_int(resp, proto);
150150
}
151151

src/mod-host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
/* Protocol commands definition */
5454
#define EFFECT_ADD "add %s %i"
5555
#define EFFECT_REMOVE "remove %i"
56-
#define EFFECT_ACTIVATE "activate %i %i %i"
56+
#define EFFECT_ACTIVATE "activate %i %i"
5757
#define EFFECT_PRELOAD "preload %s %i"
5858
#define EFFECT_PRESET_LOAD "preset_load %i %s"
5959
#define EFFECT_PRESET_SAVE "preset_save %i %s %s %s"

0 commit comments

Comments
 (0)