data.effects.cur = &eff->latest;
data.effects.old = &eff->active;
+ data.effects.repeat = eff->repeat;
ret = priv->control(dev, s, cmd, data);
if (!ret) {
eff->active = eff->latest;
enum ffpl_control_command cmd;
data.effects.old = NULL;
+ data.effects.repeat = eff->repeat;
if (priv->upload_when_started && eff->state == FFPL_UPLOADED) {
data.effects.cur = &eff->active;
if (eff->uploaded_to_device)
klgd_lock_plugins(self->plugins_lock);
- if (value)
+ if (value) {
eff->change = FFPL_TO_START;
- else
+ eff->repeat = value;
+ } else
eff->change = FFPL_TO_STOP;
klgd_unlock_plugins_sched(self->plugins_lock);
return klgd_append_cmd(s, c);
}
-static int klgdff_owr_start(struct klgd_command_stream *s, const struct ff_effect *effect, const struct ff_effect *old_effect)
+static int klgdff_owr_start(struct klgd_command_stream *s, const struct ff_effect *effect, const struct ff_effect *old_effect, const int repeat)
{
- char *text = kasprintf(GFP_KERNEL, "Overwriting effect to STARTED state, type %d, id %d, old type %d", effect->type, effect->id, old_effect->type);
+ char *text = kasprintf(GFP_KERNEL, "Overwriting effect to STARTED state, type %d, id %d, old type %d, repeat %d", effect->type, effect->id, old_effect->type, repeat);
size_t len = strlen(text);
struct klgd_command *c = klgd_alloc_cmd(len + 1);
return klgd_append_cmd(s, c);
}
-static int klgdff_start(struct klgd_command_stream *s, const struct ff_effect *effect)
+static int klgdff_start(struct klgd_command_stream *s, const struct ff_effect *effect, const int repeat)
{
- char *text = kasprintf(GFP_KERNEL, "Playing effect, type %d, id %d", effect->type, effect->id);
+ char *text = kasprintf(GFP_KERNEL, "Playing effect, type %d, id %d, repeat %d", effect->type, effect->id, repeat);
size_t len = strlen(text);
struct klgd_command *c = klgd_alloc_cmd(len + 1);
return klgdff_upload(s, data.effects.cur);
break;
case FFPL_UPL_TO_SRT:
- return klgdff_start(s, data.effects.cur);
+ return klgdff_start(s, data.effects.cur, data.effects.repeat);
break;
case FFPL_SRT_TO_UPL:
return klgdff_stop(s, data.effects.cur);
break;
/* "Direct" replacing commands */
case FFPL_OWR_TO_SRT:
- return klgdff_owr_start(s, data.effects.cur, data.effects.old);
+ return klgdff_owr_start(s, data.effects.cur, data.effects.old, data.effects.repeat);
break;
case FFPL_OWR_TO_UPL:
return klgdff_owr_upload(s, data.effects.cur, data.effects.old);