ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
#include <src/ckb/kbanim.h>
Public Types | |
enum | Mode { Normal, Add, Subtract, Multiply, Divide } |
Public Member Functions | |
KbAnim (QObject *parent, const KeyMap &map, const QUuid id, CkbSettings &settings) | |
void | save (CkbSettings &settings) |
bool | needsSave () const |
KbAnim (QObject *parent, const KeyMap &map, const QString &name, const QStringList &keys, const AnimScript *script) | |
KbAnim (QObject *parent, const KeyMap &map, const KbAnim &other) | |
const KeyMap & | map () |
void | map (const KeyMap &newMap) |
const QStringList & | keys () |
void | keys (const QStringList &newKeys) |
bool | hasParameter (const QString &name) const |
QVariant | parameter (const QString &name) const |
void | parameter (const QString &name, const QVariant &value) |
void | commitParams () |
void | resetParams () |
void | reInit () |
void | trigger (quint64 timestamp, bool ignoreParameter=false) |
void | keypress (const QString &key, bool pressed, quint64 timestamp) |
void | stop () |
bool | isActive () const |
bool | isRunning () const |
void | blend (ColorMap &animMap, quint64 timestamp) |
const QUuid & | guid () const |
void | newId () |
const QString & | name () const |
void | name (const QString &newName) |
float | opacity () const |
void | opacity (float newOpacity) |
Mode | mode () const |
void | mode (Mode newMode) |
const AnimScript * | script () const |
const QString & | scriptName () const |
Private Member Functions | |
QMap< QString, QVariant > | effectiveParams () |
void | updateParams () |
void | catchUp (quint64 timestamp) |
Private Attributes | |
AnimScript * | _script |
QUuid | _scriptGuid |
QString | _scriptName |
KeyMap | _map |
QStringList | _keys |
QMap< QString, QVariant > | _parameters |
QMap< QString, QVariant > | _tempParameters |
QString | repeatKey |
quint64 | repeatTime |
quint64 | kpRepeatTime |
quint64 | stopTime |
quint64 | kpStopTime |
int | repeatMsec |
int | kpRepeatMsec |
QUuid | _guid |
QString | _name |
float | _opacity |
Mode | _mode |
bool | _isActive |
bool | _isActiveKp |
bool | _needsSave |
enum KbAnim::Mode |
Enumerator | |
---|---|
Normal | |
Add | |
Subtract | |
Multiply | |
Divide |
Definition at line 17 of file kbanim.h.
KbAnim::KbAnim | ( | QObject * | parent, |
const KeyMap & | map, | ||
const QUuid | id, | ||
CkbSettings & | settings | ||
) |
Definition at line 8 of file kbanim.cpp.
References _guid, _keys, _map, _mode, _name, _opacity, _parameters, _script, _scriptGuid, _scriptName, CkbSettings::childKeys(), AnimScript::copy(), AnimScript::Param::defaultValue, KeyMap::fromStorage(), AnimScript::Param::INVALID, AnimScript::Param::LABEL, AnimScript::Param::name, AnimScript::name(), name(), Normal, AnimScript::param(), AnimScript::paramIterator(), reInit(), AnimScript::Param::type, and CkbSettings::value().
KbAnim::KbAnim | ( | QObject * | parent, |
const KeyMap & | map, | ||
const QString & | name, | ||
const QStringList & | keys, | ||
const AnimScript * | script | ||
) |
Definition at line 84 of file kbanim.cpp.
References _parameters, _script, _scriptGuid, _scriptName, AnimScript::Param::defaultValue, AnimScript::guid(), AnimScript::Param::LABEL, AnimScript::Param::name, AnimScript::name(), AnimScript::paramIterator(), reInit(), and AnimScript::Param::type.
Definition at line 104 of file kbanim.cpp.
References reInit().
void KbAnim::blend | ( | ColorMap & | animMap, |
quint64 | timestamp | ||
) |
Definition at line 365 of file kbanim.cpp.
References _mode, _opacity, _script, catchUp(), ColorMap::colors(), AnimScript::colors(), ColorMap::count(), AnimScript::frame(), and functions.
Referenced by KbLight::frameUpdate().
|
private |
Definition at line 166 of file kbanim.cpp.
References _isActive, _isActiveKp, _script, effectiveParams(), AnimScript::end(), AnimScript::keypress(), kpRepeatMsec, kpRepeatTime, kpStopTime, repeatKey, repeatMsec, repeatTime, AnimScript::retrigger(), and stopTime.
Referenced by blend(), keypress(), and trigger().
void KbAnim::commitParams | ( | ) |
Definition at line 121 of file kbanim.cpp.
References _needsSave, _parameters, _tempParameters, and effectiveParams().
Referenced by KbLight::addAnim(), KbAnimWidget::on_propertyButton_clicked(), and KbLight::previewAnim().
|
private |
Definition at line 138 of file kbanim.cpp.
References _parameters, and _tempParameters.
Referenced by catchUp(), commitParams(), keypress(), reInit(), trigger(), and updateParams().
|
inline |
Definition at line 71 of file kbanim.h.
References _guid.
Referenced by KbAnimWidget::addAnim(), RebindWidget::applyChanges(), KbLight::findAnim(), KbAnimWidget::on_deleteButton_clicked(), KbAnimWidget::refreshList(), and KbLight::save().
|
inline |
Definition at line 44 of file kbanim.h.
References _parameters.
Referenced by AnimSettingDialog::AnimSettingDialog().
|
inline |
Definition at line 63 of file kbanim.h.
References _isActive, and _isActiveKp.
Referenced by KeyAction::keyEvent(), and keypress().
bool KbAnim::isRunning | ( | ) | const |
Definition at line 325 of file kbanim.cpp.
References _script, and AnimScript::hasFrame().
Referenced by KbLight::isStarted().
void KbAnim::keypress | ( | const QString & | key, |
bool | pressed, | ||
quint64 | timestamp | ||
) |
Definition at line 250 of file kbanim.cpp.
References _isActive, _isActiveKp, _script, catchUp(), effectiveParams(), AnimScript::frame(), isActive(), AnimScript::keypress(), kpRepeatMsec, kpRepeatTime, kpStopTime, repeatKey, repeatMsec, repeatTime, stop(), AnimScript::stop(), and stopTime.
Referenced by KbLight::animKeypress().
|
inline |
Definition at line 40 of file kbanim.h.
References _keys.
Referenced by KbLight::animKeypress(), KbLightWidget::changeAnim(), KbAnimWidget::on_keyButton_clicked(), and KbAnimWidget::setCurrent().
void KbAnim::keys | ( | const QStringList & | newKeys | ) |
Definition at line 161 of file kbanim.cpp.
References _keys, and reInit().
|
inline |
Definition at line 37 of file kbanim.h.
References _map.
Referenced by KbLight::map().
void KbAnim::map | ( | const KeyMap & | newMap | ) |
Definition at line 156 of file kbanim.cpp.
References _map, and reInit().
|
inline |
Definition at line 77 of file kbanim.h.
References _mode.
Referenced by KbAnimWidget::on_blendBox_activated(), and KbAnimWidget::setCurrent().
|
inline |
|
inline |
Definition at line 73 of file kbanim.h.
References _name.
Referenced by KbAnimWidget::addAnim(), AnimSettingDialog::AnimSettingDialog(), KbAnim(), KbAnimWidget::on_animList_itemChanged(), KbAnimWidget::on_nameBox_textEdited(), parameter(), KbAnimWidget::refreshList(), KbAnimWidget::setCurrent(), and RebindWidget::setSelection().
|
inline |
|
inline |
Definition at line 29 of file kbanim.h.
References _needsSave.
Referenced by KbLight::needsSave().
|
inline |
Definition at line 72 of file kbanim.h.
References _guid, and _needsSave.
Referenced by KbLight::duplicateAnim(), and KbMode::newId().
|
inline |
Definition at line 75 of file kbanim.h.
References _opacity.
Referenced by KbAnimWidget::on_opacityBox_valueChanged(), and KbAnimWidget::setCurrent().
|
inline |
|
inline |
Definition at line 45 of file kbanim.h.
References _parameters.
Referenced by KbLight::addAnim(), AnimSettingDialog::AnimSettingDialog(), KbLight::previewAnim(), and AnimSettingDialog::updateParam().
void KbAnim::parameter | ( | const QString & | name, |
const QVariant & | value | ||
) |
Definition at line 114 of file kbanim.cpp.
References _script, _tempParameters, AnimScript::hasParam(), name(), and updateParams().
void KbAnim::reInit | ( | ) |
Definition at line 149 of file kbanim.cpp.
References _isActive, _isActiveKp, _keys, _map, _script, effectiveParams(), AnimScript::init(), and repeatKey.
Referenced by KbAnim(), keys(), map(), KbAnimWidget::on_propertyButton_clicked(), and KbLight::previewAnim().
void KbAnim::resetParams | ( | ) |
Definition at line 127 of file kbanim.cpp.
References _tempParameters, and updateParams().
Referenced by KbAnimWidget::on_propertyButton_clicked().
void KbAnim::save | ( | CkbSettings & | settings | ) |
Definition at line 64 of file kbanim.cpp.
References _guid, _keys, _mode, _name, _needsSave, _opacity, _parameters, _scriptGuid, _scriptName, CkbSettings::beginGroup(), CkbSettings::endGroup(), and CkbSettings::setValue().
Referenced by KbLight::save().
|
inline |
Definition at line 81 of file kbanim.h.
References _script.
Referenced by AnimSettingDialog::AnimSettingDialog(), KbAnimWidget::setCurrent(), and AnimSettingDialog::updateParam().
|
inline |
Definition at line 82 of file kbanim.h.
References _scriptName.
Referenced by AnimSettingDialog::AnimSettingDialog(), and KbAnimWidget::setCurrent().
void KbAnim::stop | ( | ) |
Definition at line 312 of file kbanim.cpp.
References _isActive, _isActiveKp, _script, AnimScript::end(), kpRepeatMsec, kpRepeatTime, kpStopTime, repeatKey, repeatMsec, repeatTime, and stopTime.
Referenced by KbLight::addAnim(), KbLight::close(), KbLight::duplicateAnim(), KeyAction::keyEvent(), keypress(), KbLight::restartAnimation(), and trigger().
void KbAnim::trigger | ( | quint64 | timestamp, |
bool | ignoreParameter = false |
||
) |
Definition at line 209 of file kbanim.cpp.
References _isActive, _script, catchUp(), effectiveParams(), AnimScript::frame(), repeatMsec, repeatTime, AnimScript::retrigger(), stop(), and stopTime.
Referenced by KbLight::addAnim(), KbLight::duplicateAnim(), KeyAction::keyEvent(), KbLight::open(), KbLight::previewAnim(), and KbLight::restartAnimation().
|
private |
Definition at line 132 of file kbanim.cpp.
References _script, effectiveParams(), AnimScript::parameters(), and repeatKey.
Referenced by parameter(), and resetParams().
|
private |
|
private |
Definition at line 114 of file kbanim.h.
Referenced by catchUp(), isActive(), keypress(), reInit(), stop(), and trigger().
|
private |
Definition at line 114 of file kbanim.h.
Referenced by catchUp(), isActive(), keypress(), reInit(), and stop().
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 115 of file kbanim.h.
Referenced by commitParams(), mode(), name(), needsSave(), newId(), opacity(), and save().
|
private |
|
private |
Definition at line 94 of file kbanim.h.
Referenced by commitParams(), effectiveParams(), hasParameter(), KbAnim(), parameter(), and save().
|
private |
Definition at line 86 of file kbanim.h.
Referenced by blend(), catchUp(), isRunning(), KbAnim(), keypress(), parameter(), reInit(), script(), stop(), trigger(), and updateParams().
|
private |
|
private |
Definition at line 89 of file kbanim.h.
Referenced by KbAnim(), save(), and scriptName().
|
private |
Definition at line 96 of file kbanim.h.
Referenced by commitParams(), effectiveParams(), parameter(), and resetParams().
|
private |
Definition at line 106 of file kbanim.h.
Referenced by catchUp(), keypress(), and stop().
|
private |
Definition at line 105 of file kbanim.h.
Referenced by catchUp(), keypress(), and stop().
|
private |
Definition at line 105 of file kbanim.h.
Referenced by catchUp(), keypress(), and stop().
|
private |
Definition at line 104 of file kbanim.h.
Referenced by catchUp(), keypress(), reInit(), stop(), and updateParams().
|
private |
|
private |
|
private |