Class LXClip

All Implemented Interfaces:
LXComponent.Renamable, LXLoopTask, LXPath, LXSerializable, LXBus.Listener, LXOscComponent, LXParameterListener
Direct Known Subclasses:
LXAbstractChannelClip, LXMasterClip

public abstract class LXClip extends LXRunnableComponent implements LXOscComponent, LXComponent.Renamable, LXBus.Listener
  • Field Details

  • Constructor Details

    • LXClip

      public LXClip(LX lx, LXBus bus, int index)
    • LXClip

      protected LXClip(LX lx, LXBus bus, int index, boolean registerListener)
  • Method Details

    • getPath

      public String getPath()
      Description copied from class: LXComponent
      Accessor for the path of this object. Returns the path this component was registered with. Some subclasses may override this if path structure is dynamic.
      Specified by:
      getPath in interface LXPath
      Overrides:
      getPath in class LXComponent
      Returns:
      path of this component relative to its parent
    • onTrigger

      public void onTrigger()
      Description copied from class: LXRunnableComponent
      Optional subclass method when trigger is fired, called before onReset and onStart
      Overrides:
      onTrigger in class LXRunnableComponent
    • onStop

      public void onStop()
      Description copied from class: LXRunnableComponent
      Optional subclass method when stop happens.
      Overrides:
      onStop in class LXRunnableComponent
    • 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 LXComponent
    • getLength

      public double getLength()
    • removeParameterLane

      public LXClip removeParameterLane(ParameterClipLane lane)
    • addListener

      public LXClip addListener(LXClip.Listener listener)
    • removeListener

      public LXClip removeListener(LXClip.Listener listener)
    • getCursor

      public double getCursor()
    • getBasis

      public double getBasis()
    • onParameterChanged

      public void onParameterChanged(LXParameter p)
      Description copied from class: LXComponent
      Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.
      Specified by:
      onParameterChanged in interface LXParameterListener
      Overrides:
      onParameterChanged in class LXRunnableComponent
      Parameters:
      p - Parameter that has a value change
    • onStartRecording

      protected void onStartRecording()
    • registerComponent

      protected void registerComponent(LXComponent component)
    • unregisterComponent

      protected void unregisterComponent(LXComponent component)
    • getIndex

      public int getIndex()
    • setIndex

      public LXClip setIndex(int index)
    • run

      protected void run(double deltaMs)
      Specified by:
      run in class LXRunnableComponent
    • effectAdded

      public void effectAdded(LXBus channel, LXEffect effect)
      Specified by:
      effectAdded in interface LXBus.Listener
    • effectRemoved

      public void effectRemoved(LXBus channel, LXEffect effect)
      Specified by:
      effectRemoved in interface LXBus.Listener
    • effectMoved

      public void effectMoved(LXBus channel, LXEffect effect)
      Specified by:
      effectMoved in interface LXBus.Listener
    • 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
    • loadLane

      protected void loadLane(LX lx, String laneType, JsonObject laneObj)
    • 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