#include <gapeunitgroup.h>
Inheritance diagram for GapeUnitGroup::
Public Slots | |
virtual void | receiveTick (const GapeFloat *values, int numValues) |
Pure virtual function that all subclasses of GapeUnit must define. More... | |
virtual void | addUnit (GapeUnit *u) |
Adds a new unit to the group. More... | |
virtual void | removeUnit (GapeUnit *u) |
Removes the unit from the group. More... | |
virtual int | getNumUnits () |
Returns the number of units in this group. More... | |
virtual GapeUnit* | getUnit (int index) |
Gets the unit at the specified place in the storage array. More... | |
virtual void | requestSolo (GapeUnit *requestingUnit) |
Requests that the parent mute all other units besides the one making the request. More... | |
virtual void | endSolo (GapeUnit *requestingUnit) |
Unmutes all other units in the group when the currently soloed unit ends its solo mode. More... | |
virtual void | addController (GapeController *c) |
Adds a controller for this unit. More... | |
virtual void | removeController (GapeController *c) |
Removes a controller for this unit. More... | |
Public Methods | |
GapeUnitGroup (GapeController *c=NULL, int capacity=GAPE_DEFAULT_GROUP_CAPACITY) | |
The constructor. More... | |
virtual | ~GapeUnitGroup () |
The destructor. | |
Protected Attributes | |
GapeUnit** | units |
int | numUnits |
int | currentCapacity |
This is not an abstract class and can be instantiated. It simply contains an array of GapeUnit*, and shifts them accordingly when units are added or removed. New units are put at the end. The receiveTick / emitTick chain is handled as follows: When GapeUnitGroup receives a tick, it calls recieveTick on the first unit in its array, whose emitTick is connected to the next unit's recieveTick, whose emitTick is connected to the next units receiveTick, etc... When the final unit emits a tick, this signal is hooked to the UnitGroup's emitTick signal, and so it emits the same tick. Thus, a GapeUnitGroup can be used like any other unit, and it will simply work like a serial chain of devices. This container will grow dynamically if more units than its capacity are created, so there is no need to worry about adding too many units for it to handle. All subclasses which override the array handling of this class should guarantee the same behavior. Keep in mind that a unit group deletes all of its children when it's deleted. When the group is empty or muted, the group just emits the same tick it recieves, bypassing it's array of units. GapeUnitGroups are useful when creating gui interfaces - for instance, it might help to have separate groups for sources, filters, and outputs. Subclasses of this might implement parallel ticking, or gain and frequency controls which control all of its children.
Definition at line 29 of file gapeunitgroup.h.
|
The constructor.
Definition at line 7 of file gapeunitgroup.cpp. |
|
Pure virtual function that all subclasses of GapeUnit must define. This function is the primary function in the GapeUnit environment. See class documentation for more info.
Reimplemented from GapeUnit. Definition at line 47 of file gapeunitgroup.h. Referenced by addUnit(), and removeUnit().
|
|
Adds a new unit to the group.
Definition at line 26 of file gapeunitgroup.cpp. |
|
Removes the unit from the group. Exits gracefully if it does not actually own the unit. Does NOT delete the unit!
Definition at line 52 of file gapeunitgroup.cpp. |
|
Returns the number of units in this group.
Definition at line 76 of file gapeunitgroup.h. |
|
Gets the unit at the specified place in the storage array. Returns NULL if no such unit/
Definition at line 140 of file gapeunitgroup.cpp. |
|
Requests that the parent mute all other units besides the one making the request.
Definition at line 149 of file gapeunitgroup.cpp. Referenced by GapeUnit::setSolo().
|
|
Unmutes all other units in the group when the currently soloed unit ends its solo mode.
Definition at line 158 of file gapeunitgroup.cpp. Referenced by GapeUnit::setSolo().
|
|
Adds a controller for this unit. Attaches the controller to all units which are contained by this group
Reimplemented from GapeUnit. Definition at line 124 of file gapeunitgroup.cpp. |
|
Removes a controller for this unit. Removes the controller from all contained units
Reimplemented from GapeUnit. Definition at line 132 of file gapeunitgroup.cpp. |