ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
#include <src/ckb/kblight.h>
Public Types | |
typedef QList< KbAnim * > | AnimList |
Signals | |
void | didLoad () |
void | updated () |
void | frameDisplayed (const ColorMap &animatedColors, const QSet< QString > &indicatorList) |
Public Member Functions | |
KbLight (KbMode *parent, const KeyMap &keyMap) | |
KbLight (KbMode *parent, const KeyMap &keyMap, const KbLight &other) | |
~KbLight () | |
const KeyMap & | map () |
void | map (const KeyMap &map) |
const QColorMap & | colorMap () |
void | color (const QString &key, const QColor &newColor) |
void | color (const QColor &newColor) |
int | dimming () |
void | dimming (int newDimming) |
KbAnim * | addAnim (const AnimScript *base, const QStringList &keys, const QString &name, const QMap< QString, QVariant > &preset) |
KbAnim * | duplicateAnim (KbAnim *oldAnim) |
const AnimList & | animList () |
void | animList (const AnimList &newAnimList) |
KbAnim * | findAnim (const QUuid &guid) const |
int | findAnimIdx (const QUuid &guid) const |
void | previewAnim (const AnimScript *base, const QStringList &keys, const QMap< QString, QVariant > &preset) |
void | stopPreview () |
void | restartAnimation () |
void | animKeypress (const QString &key, bool down) |
void | open () |
bool | isStarted () |
void | close () |
void | resetIndicators () |
void | setIndicator (const char *name, QRgb argb) |
void | frameUpdate (QFile &cmd, bool monochrome=false) |
void | base (QFile &cmd, bool ignoreDim=false, bool monochrome=false) |
void | load (CkbSettings &settings) |
void | save (CkbSettings &settings) |
bool | needsSave () const |
Static Public Member Functions | |
static int | shareDimming () |
static void | shareDimming (int newShareDimming) |
Static Public Attributes | |
static const int | MAX_DIM = 3 |
Private Member Functions | |
void | rebuildBaseMap () |
void | printRGB (QFile &cmd, const ColorMap &animMap) |
Private Attributes | |
AnimList | _animList |
KbAnim * | _previewAnim |
KeyMap | _map |
QColorMap | _qColorMap |
ColorMap | _colorMap |
ColorMap | _animMap |
ColorMap | _lastFrameAnimMap |
ColorMap | _indicatorMap |
ColorMap | _lastFrameIndicatorMap |
QSet< QString > | _indicatorList |
quint64 | lastFrameSignal |
int | _dimming |
int | _lastFrameDimming |
bool | _start |
bool | _needsSave |
bool | _needsMapRefresh |
typedef QList<KbAnim*> KbLight::AnimList |
Definition at line 10 of file kblight.cpp.
References map().
Definition at line 16 of file kblight.cpp.
References _animList, and map().
KbLight::~KbLight | ( | ) |
KbAnim * KbLight::addAnim | ( | const AnimScript * | base, |
const QStringList & | keys, | ||
const QString & | name, | ||
const QMap< QString, QVariant > & | preset | ||
) |
Definition at line 100 of file kblight.cpp.
References _animList, _map, _needsSave, _start, anim, KbAnim::commitParams(), KbAnim::parameter(), KbAnim::stop(), stopPreview(), and KbAnim::trigger().
Referenced by KbAnimWidget::addAnim().
void KbLight::animKeypress | ( | const QString & | key, |
bool | down | ||
) |
Definition at line 189 of file kblight.cpp.
References _animList, _previewAnim, anim, KbAnim::keypress(), and KbAnim::keys().
Referenced by Kb::readNotify().
|
inline |
Definition at line 49 of file kblight.h.
References _animList.
Referenced by RebindWidget::applyChanges(), KbAnimWidget::duplicateAnim(), KbMode::newId(), KbAnimWidget::on_deleteButton_clicked(), KbAnimWidget::refreshList(), KbAnimWidget::reorderAnims(), and RebindWidget::setSelection().
|
inline |
void KbLight::base | ( | QFile & | cmd, |
bool | ignoreDim = false , |
||
bool | monochrome = false |
||
) |
Definition at line 378 of file kblight.cpp.
References _animMap, _colorMap, _dimming, close(), ColorMap::colorForName(), ColorMap::colors(), ColorMap::count(), MAX_DIM, monoRgb(), printRGB(), and rebuildBaseMap().
Referenced by Kb::hwSave().
void KbLight::close | ( | ) |
Definition at line 215 of file kblight.cpp.
References _animList, _start, activeLights, anim, KbAnim::stop(), and stopPreview().
Referenced by base(), Kb::frameUpdate(), Kb::hwSave(), and Kb::updateLayout().
void KbLight::color | ( | const QString & | key, |
const QColor & | newColor | ||
) |
Definition at line 49 of file kblight.cpp.
References _colorMap, _needsMapRefresh, _needsSave, _qColorMap, and ColorMap::colorForName().
Referenced by KbLightWidget::changeColor(), load(), printRGB(), Kb::readNotify(), rebuildBaseMap(), and KbLightWidget::toggleSidelight().
void KbLight::color | ( | const QColor & | newColor | ) |
Definition at line 62 of file kblight.cpp.
References _colorMap, _needsMapRefresh, _needsSave, _qColorMap, ColorMap::colors(), and ColorMap::count().
|
inline |
Definition at line 31 of file kblight.h.
References _qColorMap.
Referenced by KbLightWidget::changeColor(), KbLightWidget::newSelection(), KbLightWidget::toggleSidelight(), and KbLightWidget::updateLight().
|
signal |
Definition at line 162 of file moc_kblight.cpp.
Referenced by load().
|
inline |
Definition at line 39 of file kblight.h.
References _dimming.
Referenced by KeyAction::keyEvent(), KbLightWidget::on_brightnessBox_activated(), open(), shareDimming(), and KbLightWidget::updateLight().
void KbLight::dimming | ( | int | newDimming | ) |
Definition at line 92 of file kblight.cpp.
References _dimming, _needsSave, _shareDimming, shareDimming(), and updated().
Definition at line 148 of file kblight.cpp.
References _animList, _map, _needsSave, _start, anim, KbAnim::newId(), KbAnim::stop(), and KbAnim::trigger().
Referenced by KbAnimWidget::duplicateAnim().
|
inline |
Definition at line 51 of file kblight.h.
References _animList, anim, and KbAnim::guid().
Referenced by findAnimIdx(), and KeyAction::keyEvent().
|
inline |
Definition at line 52 of file kblight.h.
References _animList, and findAnim().
Referenced by RebindWidget::setSelection().
|
signal |
Definition at line 174 of file moc_kblight.cpp.
Referenced by frameUpdate().
void KbLight::frameUpdate | ( | QFile & | cmd, |
bool | monochrome = false |
||
) |
Definition at line 296 of file kblight.cpp.
References _animList, _animMap, _colorMap, _dimming, _indicatorList, _indicatorMap, _lastFrameAnimMap, _lastFrameDimming, _lastFrameIndicatorMap, _previewAnim, anim, KbAnim::blend(), ColorMap::colors(), ColorMap::count(), frameDisplayed(), lastFrameSignal, lToS(), monoRgb(), printRGB(), rebuildBaseMap(), and sToL().
Referenced by Kb::frameUpdate().
bool KbLight::isStarted | ( | ) |
Definition at line 169 of file kblight.cpp.
References _animList, _start, and KbAnim::isRunning().
Referenced by Kb::frameUpdate().
void KbLight::load | ( | CkbSettings & | settings | ) |
Definition at line 408 of file kblight.cpp.
References _animList, _dimming, _map, _needsMapRefresh, _needsSave, _qColorMap, anim, CkbSettings::childKeys(), color(), didLoad(), KeyMap::fromName(), KeyMap::fromStorage(), map(), MAX_DIM, and CkbSettings::value().
Referenced by KbMode::KbMode().
|
inline |
Definition at line 28 of file kblight.h.
References _map.
Referenced by KbLight(), KbMode::keyMap(), load(), map(), KbLightWidget::newSelection(), KbAnimWidget::on_keyButton_clicked(), and KbLightWidget::updateLight().
void KbLight::map | ( | const KeyMap & | map | ) |
Definition at line 25 of file kblight.cpp.
References _animList, _animMap, _colorMap, _indicatorMap, _map, _needsMapRefresh, _needsSave, _qColorMap, anim, ColorMap::init(), map(), KbAnim::map(), and updated().
bool KbLight::needsSave | ( | ) | const |
Definition at line 474 of file kblight.cpp.
References _animList, _needsSave, anim, and KbAnim::needsSave().
Referenced by KbMode::needsSave().
void KbLight::open | ( | ) |
Definition at line 200 of file kblight.cpp.
References _animList, _dimming, _previewAnim, _shareDimming, _start, activeLights, anim, dimming(), and KbAnim::trigger().
Referenced by Kb::frameUpdate().
void KbLight::previewAnim | ( | const AnimScript * | base, |
const QStringList & | keys, | ||
const QMap< QString, QVariant > & | preset | ||
) |
Definition at line 124 of file kblight.cpp.
References _map, _previewAnim, _start, anim, KbAnim::commitParams(), KbAnim::parameter(), KbAnim::reInit(), stopPreview(), and KbAnim::trigger().
Referenced by AnimAddDialog::on_presetBox_activated().
|
private |
Definition at line 223 of file kblight.cpp.
References color(), ColorMap::colors(), ColorMap::count(), and ColorMap::keyNames().
Referenced by base(), and frameUpdate().
|
private |
Definition at line 238 of file kblight.cpp.
References _colorMap, _needsMapRefresh, _qColorMap, color(), and ColorMap::colorForName().
Referenced by base(), and frameUpdate().
void KbLight::resetIndicators | ( | ) |
Definition at line 254 of file kblight.cpp.
References _indicatorList, _indicatorMap, and ColorMap::clear().
Referenced by KbPerf::applyIndicators().
void KbLight::restartAnimation | ( | ) |
Definition at line 179 of file kblight.cpp.
References _animList, _start, anim, KbAnim::stop(), stopPreview(), and KbAnim::trigger().
Referenced by KbLightWidget::on_animButton_clicked(), KbAnimWidget::on_deleteButton_clicked(), KbAnimWidget::on_keyButton_clicked(), and KbAnimWidget::on_propertyButton_clicked().
void KbLight::save | ( | CkbSettings & | settings | ) |
Definition at line 447 of file kblight.cpp.
References _animList, _dimming, _map, _needsSave, _qColorMap, anim, KbAnim::guid(), KeyMap::name(), KbAnim::save(), and CkbSettings::setValue().
Referenced by KbMode::save().
void KbLight::setIndicator | ( | const char * | name, |
QRgb | argb | ||
) |
Definition at line 259 of file kblight.cpp.
References _indicatorList, _indicatorMap, and ColorMap::colorForName().
Referenced by KbPerf::lightIndicator().
|
static |
Definition at line 78 of file kblight.cpp.
References _shareDimming.
Referenced by dimming(), ExtraSettingsWidget::ExtraSettingsWidget(), ExtraSettingsWidget::on_brightnessBox_clicked(), and ExtraSettingsWidget::pollUpdates().
|
static |
Definition at line 82 of file kblight.cpp.
References _shareDimming, activeLights, and dimming().
void KbLight::stopPreview | ( | ) |
Definition at line 143 of file kblight.cpp.
References _previewAnim.
Referenced by addAnim(), close(), AnimAddDialog::on_previewBox_clicked(), previewAnim(), restartAnimation(), and AnimAddDialog::~AnimAddDialog().
|
signal |
Definition at line 168 of file moc_kblight.cpp.
Referenced by dimming(), and map().
|
private |
Definition at line 89 of file kblight.h.
Referenced by addAnim(), animKeypress(), animList(), close(), duplicateAnim(), findAnim(), findAnimIdx(), frameUpdate(), isStarted(), KbLight(), load(), map(), needsSave(), open(), restartAnimation(), and save().
|
private |
Definition at line 93 of file kblight.h.
Referenced by base(), frameUpdate(), and map().
|
private |
Definition at line 93 of file kblight.h.
Referenced by base(), color(), frameUpdate(), map(), and rebuildBaseMap().
|
private |
|
private |
Definition at line 94 of file kblight.h.
Referenced by frameUpdate(), resetIndicators(), and setIndicator().
|
private |
Definition at line 93 of file kblight.h.
Referenced by frameUpdate(), map(), resetIndicators(), and setIndicator().
|
private |
Definition at line 93 of file kblight.h.
Referenced by frameUpdate().
|
private |
Definition at line 96 of file kblight.h.
Referenced by frameUpdate().
|
private |
Definition at line 93 of file kblight.h.
Referenced by frameUpdate().
|
private |
Definition at line 91 of file kblight.h.
Referenced by addAnim(), duplicateAnim(), load(), map(), previewAnim(), and save().
|
private |
|
private |
Definition at line 98 of file kblight.h.
Referenced by addAnim(), animList(), color(), dimming(), duplicateAnim(), load(), map(), needsSave(), and save().
|
private |
Definition at line 90 of file kblight.h.
Referenced by animKeypress(), frameUpdate(), open(), previewAnim(), and stopPreview().
|
private |
Definition at line 92 of file kblight.h.
Referenced by color(), colorMap(), load(), map(), rebuildBaseMap(), and save().
|
private |
Definition at line 97 of file kblight.h.
Referenced by addAnim(), close(), duplicateAnim(), isStarted(), open(), previewAnim(), and restartAnimation().
|
private |
Definition at line 95 of file kblight.h.
Referenced by frameUpdate().
|
static |
Definition at line 38 of file kblight.h.
Referenced by base(), ExtraSettingsWidget::ExtraSettingsWidget(), KeyAction::keyEvent(), and load().