From 046846c650c74228f126a16d32286eb770ea5cbb Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Oct 2018 14:57:08 +0200 Subject: [PATCH] Rearrange the file layout in preparation of becoming a monorepo Move the documentation to `doc/plugin/LEDEffects.md`, sources under `src/kaleidoscope/plugin/` (appropriately namespaced). This is in preparation of merging plugins into a single monorepo. Signed-off-by: Gergely Nagy --- README.md | 70 +----------------- doc/plugin/LEDEffects.md | 71 +++++++++++++++++++ TriColor.md => doc/plugin/TriColor.md | 0 src/Kaleidoscope-LEDEffects.h | 6 +- .../plugin}/Jukebox.cpp | 4 +- .../plugin}/Jukebox.h | 6 +- .../plugin}/Miami.cpp | 2 +- .../plugin}/Miami.h | 4 +- .../plugin}/TriColor.cpp | 2 + .../plugin}/TriColor.h | 2 + 10 files changed, 87 insertions(+), 80 deletions(-) create mode 100644 doc/plugin/LEDEffects.md rename TriColor.md => doc/plugin/TriColor.md (100%) rename src/{Kaleidoscope => kaleidoscope/plugin}/Jukebox.cpp (85%) rename src/{Kaleidoscope => kaleidoscope/plugin}/Jukebox.h (82%) rename src/{Kaleidoscope => kaleidoscope/plugin}/Miami.cpp (91%) rename src/{Kaleidoscope => kaleidoscope/plugin}/Miami.h (89%) rename src/{Kaleidoscope => kaleidoscope/plugin}/TriColor.cpp (98%) rename src/{Kaleidoscope => kaleidoscope/plugin}/TriColor.h (98%) diff --git a/README.md b/README.md index ea16b0f2..be3f5077 100644 --- a/README.md +++ b/README.md @@ -5,72 +5,4 @@ [travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-LEDEffects.svg?branch=master [travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-LEDEffects -The `LEDEffects` plugin provides a selection of LED effects, each of them fairly -simple, simple enough to not need a plugin of their own. - -## Using the plugin - -There are a number of different effects included in the package, all of them are -available once including the header, and one's free to choose any number of -them. - -```c++ -#include -#include - -KALEIDOSCOPE_INIT_PLUGINS(LEDControl, JukeBoxEffect); - -void setup(void) { - Kaleidoscope.setup(); -} -``` - -## Included effects - -All of these effects will scan the active layers, and apply effects based on -what keys are active on each position, thus, it needs no hints or configuration -to figure out our layout! - -### `MiamiEffect` - -Applies a color effect to the keyboard, inspired by the popular Miami keyset: - -![Miami](extras/MiamiEffect.png) - -Alphas, punctuation, numbers, the space bar, the numbers and the dot on the -keypad, and half the function keys will be in a cyan-ish color, the rest in -magenta. - -### `JukeboxEffect` - -Applies a color effect to the keyboard, inspired by the JukeBox keyset: - -![Jukebox](extras/JukeboxEffect.png) - -Alphas, punctuation, numbers, the space bar, the numbers and the dot on the -keypad, and half the function keys will be in a beige-ish color, the rest in -light green, except for the `Esc` key, which will be in red. - -An alternative color scheme exists under the `JukeboxAlternateEffect` name, -where the light green and red colors are swapped. - -## Plugin methods - -The plugin provides a single method on each of the included effect objects: - -### `.activate()` - -> When called, immediately activates the effect. Mostly useful in the `setup()` -> method of the Sketch, or in macros that are meant to switch to the selected -> effect, no matter where we are in the list. - -## Dependencies - -* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) - -## Further reading - -Starting from the [example][plugin:example] is the recommended way of getting -started with the plugin. - - [plugin:example]: https://github.com/keyboardio/Kaleidoscope-LEDEffects/blob/master/examples/LEDEffects/LEDEffects.ino +See [doc/plugin/LEDEffects.md](doc/plugin/LEDEffects.md) for documentation. diff --git a/doc/plugin/LEDEffects.md b/doc/plugin/LEDEffects.md new file mode 100644 index 00000000..5ad77a4d --- /dev/null +++ b/doc/plugin/LEDEffects.md @@ -0,0 +1,71 @@ +# Kaleidoscope-LEDEffects + +The `LEDEffects` plugin provides a selection of LED effects, each of them fairly +simple, simple enough to not need a plugin of their own. + +## Using the plugin + +There are a number of different effects included in the package, all of them are +available once including the header, and one's free to choose any number of +them. + +```c++ +#include +#include + +KALEIDOSCOPE_INIT_PLUGINS(LEDControl, JukeBoxEffect); + +void setup(void) { + Kaleidoscope.setup(); +} +``` + +## Included effects + +All of these effects will scan the active layers, and apply effects based on +what keys are active on each position, thus, it needs no hints or configuration +to figure out our layout! + +### `MiamiEffect` + +Applies a color effect to the keyboard, inspired by the popular Miami keyset: + +![Miami](extras/MiamiEffect.png) + +Alphas, punctuation, numbers, the space bar, the numbers and the dot on the +keypad, and half the function keys will be in a cyan-ish color, the rest in +magenta. + +### `JukeboxEffect` + +Applies a color effect to the keyboard, inspired by the JukeBox keyset: + +![Jukebox](extras/JukeboxEffect.png) + +Alphas, punctuation, numbers, the space bar, the numbers and the dot on the +keypad, and half the function keys will be in a beige-ish color, the rest in +light green, except for the `Esc` key, which will be in red. + +An alternative color scheme exists under the `JukeboxAlternateEffect` name, +where the light green and red colors are swapped. + +## Plugin methods + +The plugin provides a single method on each of the included effect objects: + +### `.activate()` + +> When called, immediately activates the effect. Mostly useful in the `setup()` +> method of the Sketch, or in macros that are meant to switch to the selected +> effect, no matter where we are in the list. + +## Dependencies + +* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) + +## Further reading + +Starting from the [example][plugin:example] is the recommended way of getting +started with the plugin. + + [plugin:example]: https://github.com/keyboardio/Kaleidoscope-LEDEffects/blob/master/examples/LEDEffects/LEDEffects.ino diff --git a/TriColor.md b/doc/plugin/TriColor.md similarity index 100% rename from TriColor.md rename to doc/plugin/TriColor.md diff --git a/src/Kaleidoscope-LEDEffects.h b/src/Kaleidoscope-LEDEffects.h index abc86147..b4a7ba2c 100644 --- a/src/Kaleidoscope-LEDEffects.h +++ b/src/Kaleidoscope-LEDEffects.h @@ -17,6 +17,6 @@ #pragma once -#include -#include -#include +#include +#include +#include diff --git a/src/Kaleidoscope/Jukebox.cpp b/src/kaleidoscope/plugin/Jukebox.cpp similarity index 85% rename from src/Kaleidoscope/Jukebox.cpp rename to src/kaleidoscope/plugin/Jukebox.cpp index b174ed09..33622d6b 100644 --- a/src/Kaleidoscope/Jukebox.cpp +++ b/src/kaleidoscope/plugin/Jukebox.cpp @@ -17,10 +17,10 @@ #include -kaleidoscope::TriColor JukeboxEffect(CRGB(0xc8, 0xe8, 0xee), /* TM */ +kaleidoscope::plugin::TriColor JukeboxEffect(CRGB(0xc8, 0xe8, 0xee), /* TM */ CRGB(0xc3, 0xee, 0x8c), /* VCO */ CRGB(0x21, 0x38, 0xd7)); /* RN */ -kaleidoscope::TriColor JukeboxAlternateEffect(CRGB(0xc8, 0xe8, 0xee), /* TM */ +kaleidoscope::plugin::TriColor JukeboxAlternateEffect(CRGB(0xc8, 0xe8, 0xee), /* TM */ CRGB(0x21, 0x38, 0xd7), /* RN */ CRGB(0xc3, 0xee, 0x8c)); /* VCO */ diff --git a/src/Kaleidoscope/Jukebox.h b/src/kaleidoscope/plugin/Jukebox.h similarity index 82% rename from src/Kaleidoscope/Jukebox.h rename to src/kaleidoscope/plugin/Jukebox.h index 76769893..4b250088 100644 --- a/src/Kaleidoscope/Jukebox.h +++ b/src/kaleidoscope/plugin/Jukebox.h @@ -17,7 +17,7 @@ #pragma once -#include +#include -extern kaleidoscope::TriColor JukeboxEffect; -extern kaleidoscope::TriColor JukeboxAlternateEffect; +extern kaleidoscope::plugin::TriColor JukeboxEffect; +extern kaleidoscope::plugin::TriColor JukeboxAlternateEffect; diff --git a/src/Kaleidoscope/Miami.cpp b/src/kaleidoscope/plugin/Miami.cpp similarity index 91% rename from src/Kaleidoscope/Miami.cpp rename to src/kaleidoscope/plugin/Miami.cpp index 4e6777f0..d25a1649 100644 --- a/src/Kaleidoscope/Miami.cpp +++ b/src/kaleidoscope/plugin/Miami.cpp @@ -17,5 +17,5 @@ #include -kaleidoscope::TriColor MiamiEffect(CRGB(0x4e, 0xd6, 0xd6), /* Cyan */ +kaleidoscope::plugin::TriColor MiamiEffect(CRGB(0x4e, 0xd6, 0xd6), /* Cyan */ CRGB(0xaf, 0x67, 0xfa)); /* Magenta */ diff --git a/src/Kaleidoscope/Miami.h b/src/kaleidoscope/plugin/Miami.h similarity index 89% rename from src/Kaleidoscope/Miami.h rename to src/kaleidoscope/plugin/Miami.h index add5bea1..08e6b342 100644 --- a/src/Kaleidoscope/Miami.h +++ b/src/kaleidoscope/plugin/Miami.h @@ -17,6 +17,6 @@ #pragma once -#include +#include -extern kaleidoscope::TriColor MiamiEffect; +extern kaleidoscope::plugin::TriColor MiamiEffect; diff --git a/src/Kaleidoscope/TriColor.cpp b/src/kaleidoscope/plugin/TriColor.cpp similarity index 98% rename from src/Kaleidoscope/TriColor.cpp rename to src/kaleidoscope/plugin/TriColor.cpp index c2779364..c13eb626 100644 --- a/src/Kaleidoscope/TriColor.cpp +++ b/src/kaleidoscope/plugin/TriColor.cpp @@ -18,6 +18,7 @@ #include namespace kaleidoscope { +namespace plugin { TriColor::TriColor(cRGB base_color, cRGB mod_color, cRGB esc_color) { base_color_ = base_color; @@ -58,3 +59,4 @@ void TriColor::update(void) { } } +} diff --git a/src/Kaleidoscope/TriColor.h b/src/kaleidoscope/plugin/TriColor.h similarity index 98% rename from src/Kaleidoscope/TriColor.h rename to src/kaleidoscope/plugin/TriColor.h index 6693608f..b4d62ef9 100644 --- a/src/Kaleidoscope/TriColor.h +++ b/src/kaleidoscope/plugin/TriColor.h @@ -21,6 +21,7 @@ #include namespace kaleidoscope { +namespace plugin { class TriColor : public LEDMode { public: TriColor(cRGB base_color, cRGB mod_color, cRGB esc_color); @@ -35,3 +36,4 @@ class TriColor : public LEDMode { cRGB esc_color_; }; } +}