sky.monome
Class SequencerGroup


java.lang.Object

  extended by sky.monome.Component

      extended by sky.monome.Container

          extended by sky.monome.AbstractGroup<LedButtonCouple>

              extended by sky.monome.SequencerGroup

All Implemented Interfaces:
SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>, LedStateModificationLayer, Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>

public class SequencerGroup
extends AbstractGroup<LedButtonCouple>
implements Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>, LedStateModificationLayer

Sequencer group. This class is a very basic implementation of the Sequencer.

Author:
PJ Skyman

Nested Class Summary
 
Nested classes/interfaces inherited from interface sky.monome.sequencer.Sequencer
Sequencer.SequencerOrientation
 
Field Summary
protected  int activeStepNumber
          Number of the currently active step in the sequence.
protected  int activeStepNumberPseudoCopyForSequencerEffect
          Copy of the number of the currently active step in the sequence.
protected  SynchronizedList<SequencerRadio.SequencerRadioGroup> buttonManagers
          List of button managers that manage each step of this sequencer.
protected  SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator
          Sequence iterator.
protected  long sequencerEffectTime
          Time duration of the sequencer effect, in milliseconds (short lightning that symbolizes the activation of a new step in the sequence).
protected  SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine
          Sequencer engine.
protected  Sequencer.SequencerOrientation sequencerOrientation
          Orientation of this sequencer page switcher.
protected  int stepsNumber
          Number of steps in the sequence.
protected  int stepsNumberPseudoCopyWhenChangingRealValue
          Copy of the number of steps in the sequence.
 
Fields inherited from class sky.monome.AbstractGroup
components
 
Fields inherited from class sky.monome.Container
height, width
 
Fields inherited from class sky.monome.Component
container, eventListenerList, lockObject, name, x, y
 
Fields inherited from interface sky.monome.sequencer.Sequencer
SEQUENCER_EFFECT_TIME
 
Constructor Summary
SequencerGroup(java.lang.String name, Container container, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
SequencerGroup(java.lang.String name, Container container, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
SequencerGroup(java.lang.String name, Container container, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator, SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
SequencerGroup(java.lang.String name, Container container, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
SequencerGroup(java.lang.String name, Container container, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory, SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
SequencerGroup(java.lang.String name, Container container, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
SequencerGroup(java.lang.String name, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional)
          Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number and the specified mode for radio groups.
SequencerGroup(java.lang.String name, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator)
          Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups and the specified sequence iterator.
SequencerGroup(java.lang.String name, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator, SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator and the specified sequencer engine.
SequencerGroup(java.lang.String name, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory)
          Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups and the specified sequence iterator factory.
SequencerGroup(java.lang.String name, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory, SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator factory and the specified sequencer engine.
SequencerGroup(java.lang.String name, int x, int y, int width, int height, Sequencer.SequencerOrientation sequencerOrientation, float tempo, int divisions, int stepsNumber, boolean optional, SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups and the specified sequencer engine.
 
Method Summary
protected  void addLedButtonCouple(LedButtonCouple ledButtonCouple)
          Adds the specified led/button couple to the list of led/button couples.
 void addSequencerListener(SequencerListener<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerListener)
          Adds the specified sequencer listener to the list of sequencer listeners.
 void fireStepChanged(SequencerGroup sequencerComponent, int activeStepNumber)
          Invoked when a step change occurs.
 int getActiveStepNumberInSequence()
          Returns the number of the active step in the sequence.
<T extends ButtonManager<?>>
T
getButtonManager(java.lang.Class<T> clazz, int number)
          Deprecated. Since this class implements an interface that is parametrized, it is recommended to use getButtonManager(int) instead.
 SequencerRadio.SequencerRadioGroup getButtonManager(int number)
          Returns the button manager of this sequencer component at the specified step number.
 SequencerRadio.SequencerRadioGroup[] getButtonManagers()
          Returns an array of all button managers of this sequencer component.
<T extends ButtonManager<?>>
T[]
getButtonManagers(java.lang.Class<T> clazz)
          Deprecated. Since this class implements an interface that is parametrized, it is recommended to use getButtonManagers() instead.
 LedButtonCouple[] getLedButtonCouples()
          Returns an array of all led/button couples.
 LedButtonCouple.LedState getLedStateToShow(LedButtonCouple ledButtonCouple)
          Returns the led state to show instead of the natural led state of the specified led/button couple.
 int getMaximumStepsNumberInSequence()
          Returns the maximum possible number of steps in the sequence.
 int getNotesNumberByStep()
          Returns the number of available notes by step in the sequence.
 SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> getSequenceIterator()
          Returns the sequence iterator used by this sequencer.
 long getSequencerEffectTime()
          Returns the sequencer effect time, in milliseconds.
 SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> getSequencerEngine()
          Returns the sequencer engine that is used by this sequencer.
 SequencerListener<SequencerGroup,SequencerRadio.SequencerRadioGroup>[] getSequencerListeners()
          Returns an array of all sequencer listeners.
 int getStepsNumberInSequence()
          Returns the number of steps in the sequence.
 void removeSequencerListener(SequencerListener<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerListener)
          Removes the specified sequencer listener from the list of sequencer listeners.
 void sequencingAction(SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)
          Invoked when this sequencer must iterate over the sequence.
 void setSequenceIterator(SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator)
          Sets the sequence iterator used by this sequencer.
 void setSequencerEffectTime(long sequencerEffectTime)
          Modifies the sequencer effect time, in milliseconds.
 void setStepsNumber(int stepsNumber)
          Modifies the number of steps to iterate over the sequence.
 java.lang.String toString()
          Returns a string representation of this sequencer group.
 
Methods inherited from class sky.monome.AbstractGroup
canHaveParentContainer, getAbsoluteX, getAbsoluteY, getBounds, getMonome, isVisible, notify, writeOn
 
Methods inherited from class sky.monome.Container
getHeight, getWidth
 
Methods inherited from class sky.monome.Component
getContainer, getLockObject, getName, getX, getY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buttonManagers


protected final SynchronizedList<SequencerRadio.SequencerRadioGroup> buttonManagers
List of button managers that manage each step of this sequencer.


activeStepNumber


protected int activeStepNumber
Number of the currently active step in the sequence.


activeStepNumberPseudoCopyForSequencerEffect


protected int activeStepNumberPseudoCopyForSequencerEffect
Copy of the number of the currently active step in the sequence. This copy is used for the sequencer lightning effect.


sequencerOrientation


protected final Sequencer.SequencerOrientation sequencerOrientation
Orientation of this sequencer page switcher.


stepsNumber


protected int stepsNumber
Number of steps in the sequence.


stepsNumberPseudoCopyWhenChangingRealValue


protected int stepsNumberPseudoCopyWhenChangingRealValue
Copy of the number of steps in the sequence. This copy is used when the user change the real value in live.


sequenceIterator


protected SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator
Sequence iterator.


sequencerEngine


protected final SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine
Sequencer engine.


sequencerEffectTime


protected long sequencerEffectTime
Time duration of the sequencer effect, in milliseconds (short lightning that symbolizes the activation of a new step in the sequence).

Since:
SkyMonome v1.3
Constructor Detail

SequencerGroup


@Deprecated

public SequencerGroup(java.lang.String name,

                                 Container container,

                                 int x,

                                 int y,

                                 int width,

                                 int height,

                                 Sequencer.SequencerOrientation sequencerOrientation,

                                 float tempo,

                                 int divisions,

                                 int stepsNumber,

                                 boolean optional)

               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, and contained by the specified container.

Parameters:
name - Name of this sequencer group.
container - Container that will contain this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.

SequencerGroup


public SequencerGroup(java.lang.String name,

                      int x,

                      int y,

                      int width,

                      int height,

                      Sequencer.SequencerOrientation sequencerOrientation,

                      float tempo,

                      int divisions,

                      int stepsNumber,

                      boolean optional)

               throws MonomeException
Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number and the specified mode for radio groups.

Parameters:
name - Name of this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.2

SequencerGroup


@Deprecated

public SequencerGroup(java.lang.String name,

                                 Container container,

                                 int x,

                                 int y,

                                 int width,

                                 int height,

                                 Sequencer.SequencerOrientation sequencerOrientation,

                                 float tempo,

                                 int divisions,

                                 int stepsNumber,

                                 boolean optional,

                                 SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator)

               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator, and contained by the specified container.

Parameters:
name - Name of this sequencer group.
container - Container that will contain this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIterator - Sequence iterator to use to iterate over the sequence.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.

SequencerGroup


public SequencerGroup(java.lang.String name,

                      int x,

                      int y,

                      int width,

                      int height,

                      Sequencer.SequencerOrientation sequencerOrientation,

                      float tempo,

                      int divisions,

                      int stepsNumber,

                      boolean optional,

                      SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator)

               throws MonomeException
Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups and the specified sequence iterator.

Parameters:
name - Name of this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIterator - Sequence iterator to use to iterate over the sequence.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.2

SequencerGroup


@Deprecated

public SequencerGroup(java.lang.String name,

                                 Container container,

                                 int x,

                                 int y,

                                 int width,

                                 int height,

                                 Sequencer.SequencerOrientation sequencerOrientation,

                                 float tempo,

                                 int divisions,

                                 int stepsNumber,

                                 boolean optional,

                                 SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequencer engine, and contained by the specified container.

Parameters:
name - Name of this sequencer group.
container - Container that will contain this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequencerEngine - Sequencer engine that will drive this sequencer group.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.

SequencerGroup


public SequencerGroup(java.lang.String name,

                      int x,

                      int y,

                      int width,

                      int height,

                      Sequencer.SequencerOrientation sequencerOrientation,

                      float tempo,

                      int divisions,

                      int stepsNumber,

                      boolean optional,

                      SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

               throws MonomeException
Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups and the specified sequencer engine.

Parameters:
name - Name of this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequencerEngine - Sequencer engine that will drive this sequencer group.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.2

SequencerGroup


@Deprecated

public SequencerGroup(java.lang.String name,

                                 Container container,

                                 int x,

                                 int y,

                                 int width,

                                 int height,

                                 Sequencer.SequencerOrientation sequencerOrientation,

                                 float tempo,

                                 int divisions,

                                 int stepsNumber,

                                 boolean optional,

                                 SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator,

                                 SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator, the specified sequencer engine, and contained by the specified container.

Parameters:
name - Name of this sequencer group.
container - Container that will contain this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIterator - Sequence iterator to use to iterate over the sequence.
sequencerEngine - Sequencer engine that will drive this sequencer group.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.

SequencerGroup


public SequencerGroup(java.lang.String name,

                      int x,

                      int y,

                      int width,

                      int height,

                      Sequencer.SequencerOrientation sequencerOrientation,

                      float tempo,

                      int divisions,

                      int stepsNumber,

                      boolean optional,

                      SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator,

                      SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

               throws MonomeException
Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator and the specified sequencer engine.

Parameters:
name - Name of this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIterator - Sequence iterator to use to iterate over the sequence.
sequencerEngine - Sequencer engine that will drive this sequencer group.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.2

SequencerGroup


@Deprecated

public SequencerGroup(java.lang.String name,

                                 Container container,

                                 int x,

                                 int y,

                                 int width,

                                 int height,

                                 Sequencer.SequencerOrientation sequencerOrientation,

                                 float tempo,

                                 int divisions,

                                 int stepsNumber,

                                 boolean optional,

                                 SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory)

               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator factory, and contained by the specified container.

Parameters:
name - Name of this sequencer group.
container - Container that will contain this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIteratorFactory - Factory for sequence iterator to use to iterate over the sequence.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.1

SequencerGroup


public SequencerGroup(java.lang.String name,

                      int x,

                      int y,

                      int width,

                      int height,

                      Sequencer.SequencerOrientation sequencerOrientation,

                      float tempo,

                      int divisions,

                      int stepsNumber,

                      boolean optional,

                      SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory)

               throws MonomeException
Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups and the specified sequence iterator factory.

Parameters:
name - Name of this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIteratorFactory - Factory for sequence iterator to use to iterate over the sequence.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.2

SequencerGroup


@Deprecated

public SequencerGroup(java.lang.String name,

                                 Container container,

                                 int x,

                                 int y,

                                 int width,

                                 int height,

                                 Sequencer.SequencerOrientation sequencerOrientation,

                                 float tempo,

                                 int divisions,

                                 int stepsNumber,

                                 boolean optional,

                                 SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory,

                                 SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator factory, the specified sequencer engine, and contained by the specified container.

Parameters:
name - Name of this sequencer group.
container - Container that will contain this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIteratorFactory - Factory for sequence iterator to use to iterate over the sequence.
sequencerEngine - Sequencer engine that will drive this sequencer group.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.1

SequencerGroup


public SequencerGroup(java.lang.String name,

                      int x,

                      int y,

                      int width,

                      int height,

                      Sequencer.SequencerOrientation sequencerOrientation,

                      float tempo,

                      int divisions,

                      int stepsNumber,

                      boolean optional,

                      SequenceIteratorFactory<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIteratorFactory,

                      SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

               throws MonomeException
Constructs a sequencer group with the specified name, specified coordinates and dimensions, the specified orientation, specified tempo and number of divisions by quarter note, the specified steps number, the specified mode for radio groups, the specified sequence iterator factory and the specified sequencer engine.

Parameters:
name - Name of this sequencer group.
x - X-coordinate of this sequencer group in the local context of its container.
y - Y-coordinate of this sequencer group in the local context of its container.
width - Width of this sequencer group.
height - Height of this sequencer group.
sequencerOrientation - Sequencer orientation to use with this sequencer group.
tempo - Tempo, in number of quarter notes by minute.
divisions - Number of divisions by quarter note.
stepsNumber - Number of steps to use in this sequencer group.
optional - Boolean that indicates if a Radio.RadioGroup or a OptionalRadio.OptionalRadioGroup is used to control the steps buttons.
sequenceIteratorFactory - Factory for sequence iterator to use to iterate over the sequence.
sequencerEngine - Sequencer engine that will drive this sequencer group.
Throws:
MonomeException - When the specified steps number is invalid, or when a led state can't be initialized.
Since:
SkyMonome v1.2
Method Detail

sequencingAction


public void sequencingAction(SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerEngine)

                      throws MonomeException
Invoked when this sequencer must iterate over the sequence.

Specified by:
sequencingAction in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
sequencerEngine - Sequencer engine that called this method.
Throws:
MonomeException - When a problem occurs in the iteration over the sequence.

getSequencerEffectTime


public long getSequencerEffectTime()
Returns the sequencer effect time, in milliseconds. The sequencer effect is the short lightning that symbolizes the activation of a new step in the sequence.

Specified by:
getSequencerEffectTime in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The sequencer effect time, in milliseconds.
Since:
SkyMonome v1.3

setSequencerEffectTime


public void setSequencerEffectTime(long sequencerEffectTime)
Modifies the sequencer effect time, in milliseconds. The sequencer effect is the short lightning that symbolizes the activation of a new step in the sequence.

Specified by:
setSequencerEffectTime in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
sequencerEffectTime - New sequencer effect time, in milliseconds. Please note that if this new time exceeds the time between two consecutive steps, so you may meet erratic behaviors.
Since:
SkyMonome v1.3

getSequencerEngine


public SequencerEngine<SequencerGroup,SequencerRadio.SequencerRadioGroup> getSequencerEngine()
Returns the sequencer engine that is used by this sequencer.

Specified by:
getSequencerEngine in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The sequencer engine that is used by this sequencer.
Since:
SkyMonome v1.3

getActiveStepNumberInSequence


public int getActiveStepNumberInSequence()
Returns the number of the active step in the sequence.

Specified by:
getActiveStepNumberInSequence in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The number of the active step in the sequence.

getStepsNumberInSequence


public int getStepsNumberInSequence()
Returns the number of steps in the sequence.

Specified by:
getStepsNumberInSequence in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The number of steps in the sequence.

getMaximumStepsNumberInSequence


public int getMaximumStepsNumberInSequence()
Returns the maximum possible number of steps in the sequence.

Specified by:
getMaximumStepsNumberInSequence in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The maximum possible number of steps in the sequence.
Since:
SkyMonome v1.1

getNotesNumberByStep


public int getNotesNumberByStep()
Returns the number of available notes by step in the sequence.

Specified by:
getNotesNumberByStep in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The number of available notes by step in the sequence.
Since:
SkyMonome v1.1

setStepsNumber


public void setStepsNumber(int stepsNumber)

                    throws MonomeException
Modifies the number of steps to iterate over the sequence.

Specified by:
setStepsNumber in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
stepsNumber - New number of steps to iterate over the sequence.
Throws:
MonomeException - When the new steps number is incorrect for this sequencer.

getButtonManagers


@Deprecated

public <T extends ButtonManager<?>> T[] getButtonManagers(java.lang.Class<T> clazz)
Deprecated. Since this class implements an interface that is parametrized, it is recommended to use getButtonManagers() instead.

Returns an array of all button managers of this sequencer group. Returned button managers are typed to the specified type.

Specified by:
getButtonManagers in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Type Parameters:
T - Desired type for button managers. It should be a subclass of ButtonManager.
Parameters:
clazz - Class object that specify the return type for button managers.
Returns:
An array of all button managers of this sequencer group.
Throws:
java.lang.ClassCastException - When button managers can't be typed to the specified type.

getButtonManagers


public SequencerRadio.SequencerRadioGroup[] getButtonManagers()
Returns an array of all button managers of this sequencer component. Returned button managers are typed to the type defined by the parametrization of this class.

Specified by:
getButtonManagers in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
An array of all button managers of this sequencer component.
Since:
SkyMonome v1.1

getButtonManager


@Deprecated

public <T extends ButtonManager<?>> T getButtonManager(java.lang.Class<T> clazz,

                                                                  int number)
Deprecated. Since this class implements an interface that is parametrized, it is recommended to use getButtonManager(int) instead.

Returns the button manager of this sequencer group at the specified step number. The returned button manager is typed to the specified type.

Specified by:
getButtonManager in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Type Parameters:
T - Desired type for the button manager. It should be a subclass of ButtonManager.
Parameters:
clazz - Class object that specify the return type for the button manager.
number - Number of the button manager needed.
Returns:
The button manager of this sequencer group at the specified step number.
Throws:
java.lang.ClassCastException - When the button manager can't be typed to the specified type.

getButtonManager


public SequencerRadio.SequencerRadioGroup getButtonManager(int number)
Returns the button manager of this sequencer component at the specified step number. The returned button manager is typed to the type defined by the parametrization of this class.

Specified by:
getButtonManager in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
number - Number of the button manager needed.
Returns:
The button manager of this sequencer component at the specified step number.
Since:
SkyMonome v1.1

getSequenceIterator


public SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> getSequenceIterator()
Returns the sequence iterator used by this sequencer.

Specified by:
getSequenceIterator in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
The sequence iterator used by this sequencer.
Since:
SkyMonome v1.1

setSequenceIterator


public void setSequenceIterator(SequenceIterator<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequenceIterator)
Sets the sequence iterator used by this sequencer.

Specified by:
setSequenceIterator in interface Sequencer<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
sequenceIterator - New sequence iterator to use in this sequencer.
Since:
SkyMonome v1.1

getLedButtonCouples


public LedButtonCouple[] getLedButtonCouples()
Returns an array of all led/button couples.

Returns:
An array of all led/button couples.

addLedButtonCouple


protected void addLedButtonCouple(LedButtonCouple ledButtonCouple)

                           throws MonomeException
Adds the specified led/button couple to the list of led/button couples.

Parameters:
ledButtonCouple - Led/button couple to add to the list of led/button couples.
Throws:
MonomeException - When a led/button couple has bounds already used by another led/button couple.

toString


public java.lang.String toString()
Returns a string representation of this sequencer group.

Specified by:
toString in class Component
Returns:
A string representation of this sequencer group.

getLedStateToShow


public LedButtonCouple.LedState getLedStateToShow(LedButtonCouple ledButtonCouple)
Returns the led state to show instead of the natural led state of the specified led/button couple.

Specified by:
getLedStateToShow in interface LedStateModificationLayer
Parameters:
ledButtonCouple - led/button couple which is the reference.
Returns:
The led state to show instead of the natural led state of the specified led/button couple.

addSequencerListener


public void addSequencerListener(SequencerListener<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerListener)
Adds the specified sequencer listener to the list of sequencer listeners.

Specified by:
addSequencerListener in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
sequencerListener - Sequencer listener to add to the list of sequencer listeners.

removeSequencerListener


public void removeSequencerListener(SequencerListener<SequencerGroup,SequencerRadio.SequencerRadioGroup> sequencerListener)
Removes the specified sequencer listener from the list of sequencer listeners.

Specified by:
removeSequencerListener in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
sequencerListener - Sequencer listener to remove from the list of sequencer listeners.

getSequencerListeners


public SequencerListener<SequencerGroup,SequencerRadio.SequencerRadioGroup>[] getSequencerListeners()
Returns an array of all sequencer listeners.

Specified by:
getSequencerListeners in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Returns:
An array of all sequencer listeners.

fireStepChanged


public void fireStepChanged(SequencerGroup sequencerComponent,

                            int activeStepNumber)
Invoked when a step change occurs.

Specified by:
fireStepChanged in interface SequencerComponent<SequencerGroup,SequencerRadio.SequencerRadioGroup>
Parameters:
sequencerComponent - Sequencer component that triggered the sequencer event.