Class LXModulationEngine

All Implemented Interfaces:
LXLoopTask, LXPath, LXSerializable, LXOscComponent, LXParameterListener

public class LXModulationEngine extends LXModulatorComponent implements LXOscComponent
  • Field Details

  • Constructor Details

    • LXModulationEngine

      public LXModulationEngine(LX lx)
  • Method Details

    • isValidTarget

      public boolean isValidTarget(LXParameter target)
    • handleOscMessage

      public boolean handleOscMessage(OscMessage message, String[] parts, int index)
      Description copied from class: LXComponent
      Handles an OSC message sent to this component. By default this method handles registered components and parameters, but subclasses may override this method to handle different types of OSC messages.
      Specified by:
      handleOscMessage in interface LXOscComponent
      Overrides:
      handleOscMessage in class LXComponent
      Parameters:
      message - Full OSC message object
      parts - The OSC address pattern, broken into an array of parts
      index - Which index into the parts array corresponds to this component's children
      Returns:
      true if the OSC message was handled and should be considered consumed, false otherwise
    • addListener

      public LXModulationEngine addListener(LXModulationEngine.Listener listener)
    • removeListener

      public LXModulationEngine removeListener(LXModulationEngine.Listener listener)
    • addModulation

      public LXModulationEngine addModulation(LXCompoundModulation modulation)
    • removeModulation

      public LXModulationEngine removeModulation(LXCompoundModulation modulation)
    • addTrigger

      public LXModulationEngine addTrigger(LXTriggerModulation trigger)
    • removeTrigger

      public LXModulationEngine removeTrigger(LXTriggerModulation trigger)
    • findModulations

      public <T extends LXParameterModulation> List<T> findModulations(LXComponent component, List<T> modulations)
      Compiles all modulations that act upon any parameter or subcomponent of the given component, whether as source or target.
      Type Parameters:
      T - type of parameter modulation, could be compound or trigger
      Parameters:
      component - Component
      modulations - List of modulations that we're checking within
      Returns:
      All modulations acting in any way upon this component or its children
    • removeParameterModulations

      public LXModulationEngine removeParameterModulations(LXParameter parameter)
    • removeModulations

      public LXModulationEngine removeModulations(LXComponent component)
    • addModulator

      public <T extends LXModulator> T addModulator(T modulator, int index, JsonObject modulatorObj)
      Overrides:
      addModulator in class LXModulatorComponent
    • removeModulator

      public <T extends LXModulator> T removeModulator(T modulator)
      Overrides:
      removeModulator in class LXModulatorComponent
    • moveModulator

      public <T extends LXModulator> T moveModulator(T modulator, int index)
      Overrides:
      moveModulator in class LXModulatorComponent
    • getModulatorCount

      public int getModulatorCount(Class<? extends LXModulator> cls)
    • midiDispatch

      public void midiDispatch(LXShortMessage message)
      Dispatch a MIDI message to any modulators on this engine which are running and receive MIDI
      Parameters:
      message - Message
    • dispose

      public void dispose()
      Description copied from class: LXComponent
      Invoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally call super.dispose() at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.
      Overrides:
      dispose in class LXModulatorComponent
    • getLabel

      public String getLabel()
      Description copied from class: LXComponent
      Accessor for the user-facing label of this component. Objects that implement the LXComponent.Renamable interface may allow the user to change this value.
      Specified by:
      getLabel in interface LXPath
      Overrides:
      getLabel in class LXComponent
      Returns:
      Label for this component
    • save

      public void save(LX lx, JsonObject obj)
      Description copied from class: LXComponent
      Serializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to call super.save(lx, obj) at the appropriate time.
      Specified by:
      save in interface LXSerializable
      Overrides:
      save in class LXComponent
      Parameters:
      lx - LX instance
      obj - Object to serialize into
    • clear

      public void clear()
    • load

      public void load(LX lx, JsonObject obj)
      Description copied from class: LXComponent
      Loads the LX component. Restores the ID of the component, as well as its internal and user-facing parameters. Any explicitly registered children will be automatically loaded, so long as they are direct descendants. Dynamic arrays will not be automatically loaded, this is left to subclasses to implement.
      Specified by:
      load in interface LXSerializable
      Overrides:
      load in class LXComponent
      Parameters:
      lx - LX instance
      obj - Object to deserialize