-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmanager.h
More file actions
43 lines (40 loc) · 1.52 KB
/
manager.h
File metadata and controls
43 lines (40 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __MANAGER_H
#define __MANAGER_H
#include "animation.h"
#include "clean.h"
//---------------------------------------------- Shuffle the animation in the random order --------------------------------
class shuffle {
public:
shuffle(uint8_t a_size);
uint8_t next(void);
private:
void randomize(void);
uint8_t *index; // The array of animations, allocated by new()
uint8_t num_anim; // The active animation number
uint8_t curr;
};
// --------------------------------------------- The sequence manager -----------------------------------------------------
class MANAGER : public shuffle {
public:
MANAGER(animation* a[], uint8_t a_size, clr* c[], uint8_t clr_size);
void init(void);
void show(void);
void menu(void) { stp_period --; if (stp_period < 1) stp_period = 1; }
void menu_l(void) { initClear(); }
void incr(void) { stp_period ++; if (stp_period > 20) stp_period = 20; }
private:
void initClear(void);
bool isClean(void);
animation** anims;
clr** clearance;
uint8_t num_clr;
uint32_t stp;
uint16_t stp_period = 0;
uint16_t clr_stp_period = 0;
uint32_t next = 0; // The time for the next animation, ms
uint8_t aIndex = 0; // Current animation index
animation* a = 0;
clr* c = 0;
bool do_clear; // Whether cleaning the strip
};
#endif