Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start of adding multis for other devices #249

Open
wants to merge 2 commits into
base: desktop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion VortexEngine/src/Patterns/Multi/BackStrobePattern.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "BackStrobePattern.h"

#include "../../VortexEngine.h"

BackStrobePattern::BackStrobePattern(VortexEngine &engine, const PatternArgs &args) :
CompoundPattern(engine, args),
m_stepSpeed(0),
Expand Down Expand Up @@ -41,6 +43,23 @@ void BackStrobePattern::init()
}

void BackStrobePattern::play()
{
switch (m_engine.leds().ledCount()) {
case 28:
playOrbit();
break;
default:
playNormal();
break;
}
}

void BackStrobePattern::playOrbit()
{
// orbit version
}

void BackStrobePattern::playNormal()
{
if (m_stepTimer.alarm() == 0) {
// switch which patterns are displayed
Expand All @@ -52,4 +71,4 @@ void BackStrobePattern::play()
m_switch ? &m_secondPatternArgs : &m_firstPatternArgs);
}
CompoundPattern::play();
}
}
3 changes: 3 additions & 0 deletions VortexEngine/src/Patterns/Multi/BackStrobePattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class BackStrobePattern : public CompoundPattern
virtual void play() override;

private:
void playOrbit();
void playNormal();

// the speed for the step timer in x100 ms chunks, so a value of 10
// will be 1000ms
uint8_t m_stepSpeed;
Expand Down