User Tools

Site Tools


components_js

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
components_js [2019/07/08 09:19]
swiftb0y added description for colored hotcues
components_js [2019/08/01 16:58] (current)
swiftb0y [ComponentContainer and Managing Layers]
Line 459: Line 459:
   * **forEachComponent**:​ Iterate over all Components in this ComponentContainer and perform an operation on them. The operation is a function provided as the first argument to ''​forEachComponent''​. The operation function takes each Component as its first argument. In the context of the operation function, ''​this''​ refers to the ComponentContainer. ''​forEachComponent''​ iterates recursively through the Components in any ComponentContainers and arrays that are properties of this ComponentContainer. If you do not want ''​forEachComponent''​ to operate recursively,​ pass ''​false''​ as the second argument to ''​forEachComponent''​.   * **forEachComponent**:​ Iterate over all Components in this ComponentContainer and perform an operation on them. The operation is a function provided as the first argument to ''​forEachComponent''​. The operation function takes each Component as its first argument. In the context of the operation function, ''​this''​ refers to the ComponentContainer. ''​forEachComponent''​ iterates recursively through the Components in any ComponentContainers and arrays that are properties of this ComponentContainer. If you do not want ''​forEachComponent''​ to operate recursively,​ pass ''​false''​ as the second argument to ''​forEachComponent''​.
   * **reconnectComponents**:​ Call each Component'​s ''​disconnect''​ method, optionally perform an operation on it, then call its ''​connect''​ and ''​trigger''​ methods to sync the state of the controller'​s LEDs. Arguments are the same as ''​forEachComponent''​.   * **reconnectComponents**:​ Call each Component'​s ''​disconnect''​ method, optionally perform an operation on it, then call its ''​connect''​ and ''​trigger''​ methods to sync the state of the controller'​s LEDs. Arguments are the same as ''​forEachComponent''​.
 +  * **shutdown**:​ Iterate over all Components and call their shutdown methods. The Button ​ is the only component with a predefined shutdown method. All other components have to be implemented manually.
  
 Typically, ''​reconnectComponents''​ is used to switch between layers. The callback passed to reconnectComponents can manipulate each Component'​s properties as appropriate for the new layer. Below is a basic example for switching between decks 1 and 3. This is a simple example that does not handle the complexities presented by EQs, QuickEffects,​ or EffectAssignmentButtons like [[#​Deck|Deck.setCurrentDeck]] does. Typically, ''​reconnectComponents''​ is used to switch between layers. The callback passed to reconnectComponents can manipulate each Component'​s properties as appropriate for the new layer. Below is a basic example for switching between decks 1 and 3. This is a simple example that does not handle the complexities presented by EQs, QuickEffects,​ or EffectAssignmentButtons like [[#​Deck|Deck.setCurrentDeck]] does.
components_js.txt ยท Last modified: 2019/08/01 16:58 by swiftb0y