liblives
2.4.1-svn
|
class "effectKey". More...
#include <liblives.hpp>
Public Member Functions | |
effectKey () | |
Creates a new, invalid effect key. More... | |
bool | isValid () const |
Returns whether the effectKey is valid or not. More... | |
int | key () |
Return the (physical or virtual) key associated with this effectKey. More... | |
int | numModes () |
Return the number of modes for this effectKey slot. More... | |
int | numMappedModes () |
Return the number of mapped modes for this effectKey slot. More... | |
int | setCurrentMode (int mode) |
Set the current mode this effectKey. More... | |
int | currentMode () |
Get the current mode for this effectKey. More... | |
bool | setEnabled (bool setting) |
Enable an effect mapped to this effectKey, mode(). More... | |
bool | enabled () |
Return a value to indicate whether the effect mapped to this effectKey, mode() is active. More... | |
int | appendMapping (effect e) |
Map an effect to the next unused mode for the effectKey. More... | |
bool | removeMapping (int mode) |
Remove an effect from being mapped to this key. More... | |
effect | at (int mode) |
Returns the effect mapped to the key at the specified mode. More... | |
bool | operator== (const effectKey &other) |
Protected Member Functions | |
effectKey (livesApp *lives, int key) | |
class "effectKey".
Represents a single effect key slot. A valid livesApp will have a map of these (effectKeyMapping()) whose size() is equal to prefs::rteKeysVirtual().
lives::effectKey::effectKey | ( | ) |
Creates a new, invalid effect key.
int lives::effectKey::appendMapping | ( | effect | e | ) |
Map an effect to the next unused mode for the effectKey.
Will only work if the livesApp::status() is LIVES_STATUS_PLAYING or LIVES_STATUS_READY. The effectKey and the effect must share the same owner livesApp, and both must be valid.
e | the effect to append |
effect lives::effectKey::at | ( | int | mode | ) |
Returns the effect mapped to the key at the specified mode.
If the effectKey is invalid, or if no effect is mapped to the mode, an invalid effect is returned.
mode | the specified mode. |
int lives::effectKey::currentMode | ( | ) |
Get the current mode for this effectKey.
If the effectKey is invalid, the current mode is -1.
bool lives::effectKey::enabled | ( | ) |
Return a value to indicate whether the effect mapped to this effectKey, mode() is active.
If the effectKey is invalid, returns false.
bool lives::effectKey::isValid | ( | ) | const |
Returns whether the effectKey is valid or not.
An effect key is valid if it is owned by a valid livesApp, and the livesApp::status() is not LIVES_STATUS_NOTREADY, and the key value is in the range 1 <= key <= prefs::rteKeysVirtual.
int lives::effectKey::key | ( | ) |
Return the (physical or virtual) key associated with this effectKey.
Effects (apart from generators) are applied in ascending key order. Physical keys (1 - 9) can also be toggled from the keyboard by simultaneously holding down the ctrl key, provided livesApp::interactive() is true. If the effectKey is invalid, 0 is returned.
int lives::effectKey::numMappedModes | ( | ) |
Return the number of mapped modes for this effectKey slot.
Modes run from 0 to numModes() - 1. When numMappedModes() == numModes() for an effectKey, no more effects may be mapped to it until a mapping is erased. If the effectKey is invalid, 0 will be returned.
int lives::effectKey::numModes | ( | ) |
Return the number of modes for this effectKey slot.
Modes run from 0 to numModes() - 1. Effects can be mapped to modes in ascending order, but only one mode is the active mode for the effectKey. If the effectKey is invalid, 0 will be returned.
|
inline |
bool lives::effectKey::removeMapping | ( | int | mode | ) |
Remove an effect from being mapped to this key.
Will only work if the livesApp::status() is LIVES_STATUS_PLAYING or LIVES_STATUS_READY. If the effectKey is invalid, or if no effect is mapped to the mode, false is returned and nothing happens. If an effect is removed, effects mapped to higher mode numbers on the same effectKey will move down a mode to close the gap. Note: the currentMode() does not change unless this is the last mapped effect for this effectKey, so this may cause the currently enabled effect to change.
mode | the mode to remove the effect from. |
int lives::effectKey::setCurrentMode | ( | int | mode | ) |
Set the current mode this effectKey.
Only works if the effecKey is valid, a valid effect is mapped to the mode, and livesApp::status() is LIVES_STATUS_PLAYING or LIVES_STATUS_READY.
mode | the mode to switch to. |
bool lives::effectKey::setEnabled | ( | bool | setting | ) |
Enable an effect mapped to this effectKey, mode().
Only works if the effecKey is valid, a valid effect is mapped to the mode, and livesApp::status() is LIVES_STATUS_PLAYING or LIVES_STATUS_READY.
setting | the value to set to |