Skip to content

Commit

Permalink
Fix broken modxy module
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Jul 30, 2023
1 parent 7f9f201 commit e35750d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/plugs/mapping_strategies/mod_xy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
more details.
"""

import plugins
from common.param import Param, PluginParameter
from common.util.api_fixes import PluginIndex
from control_surfaces import ModX, ModY
from control_surfaces import ControlShadow, ControlShadowEvent
Expand All @@ -33,8 +33,8 @@ def __init__(self, x_param: int, y_param: int) -> None:
* `y_param` (`int`): mod-y param-index
"""
self._x = x_param
self._y = y_param
self._x = Param(x_param)
self._y = Param(y_param)

def apply(self, shadow: DeviceShadow) -> None:
shadow.bindMatch(ModX, self.event, self.tick, (self._x,))
Expand All @@ -45,21 +45,21 @@ def event(
self,
control: ControlShadowEvent,
index: PluginIndex,
param_index: int,
param: type[PluginParameter],
*args,
) -> bool:
plugins.setParamValue(control.value, param_index, *index)
param(index).value = control.value
return True

@toPluginIndex()
def tick(
self,
control: ControlShadow,
index: PluginIndex,
param_index: int,
param: type[PluginParameter],
*args,
):
# Update value
control.value = plugins.getParamValue(param_index, *index)
control.value = param(index).value
# Update annotations
control.annotation = plugins.getParamName(param_index, *index)
control.annotation = param(index).name

0 comments on commit e35750d

Please sign in to comment.