]> Devoid-pointer.net GitWeb - KLGD_FF_plugin.git/commitdiff
Handle gain adjustment correctly for ticking effects or effects with an
authorMichal Malý <madcatxster@devoid-pointer.net>
Sun, 2 Aug 2015 00:00:19 +0000 (02:00 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sun, 2 Aug 2015 00:00:19 +0000 (02:00 +0200)
envelope when the device does not support gain natively

klgd_ff_plugin.c

index 9e01c91bd810182a100bec7c316155fd058d403b..d797529461691ec121e2d25419391795b3959c74 100644 (file)
@@ -338,7 +338,7 @@ static void ffpl_recalc_combined(struct klgd_plugin_private *priv, const unsigne
                        ffpl_ramp_to_x_y(eff, &_x, &_y, now);
                        break;
                default:
-                       printk(KERN_ERR "KLGDFF: Combinable effect handler tried to process an unccombinable effect! This should not happen!\n");
+                       printk(KERN_ERR "KLGDFF: Combinable effect handler tried to process an uncombinable effect! This should not happen!\n");
                        break;
                }
 
@@ -629,8 +629,10 @@ static void ffpl_set_gain_rq(struct input_dev *dev, u16 gain)
                if (eff->state != FFPL_STARTED)
                        continue;
 
-               eff->change = FFPL_TO_UPDATE;
-               eff->trigger = FFPL_TRIG_NOW;
+               if (eff->change == FFPL_DONT_TOUCH && eff->trigger != FFPL_TRIG_RECALC) {
+                       eff->change = FFPL_TO_UPDATE;
+                       eff->trigger = FFPL_TRIG_NOW;
+               }
        }
 
 out: