]> git.sesse.net Git - ccbs/blob - bigscreen/rotatescreen.h
Adjust the fade time back to 0.5 again, after the "starting fade time" fix.
[ccbs] / bigscreen / rotatescreen.h
1 #ifndef _ROTATESCREEN_H
2 #define _ROTATESCREEN_H 1
3
4 #include <vector>
5 #include <time.h>
6 #include <sys/time.h>
7 #include "screen.h"
8
9 /* 
10  * Doesn't rotate the screens, but rotate _between_ them (ie. show
11  * one at a time). :-)
12  */
13 struct Subscreen {
14         unsigned char *buf;
15         GenericScreen *screen;
16 };
17
18 class RotateScreen : public GenericScreen {
19 private:
20         unsigned char *fadefrom_buf;
21         bool valid;
22         std::vector<Subscreen> subscreens;
23         unsigned current_screen;
24
25         struct timeval last_update, fade_started;
26         bool in_fade, fade_found_start_time, same_fade;
27
28         bool needs_update();
29         
30 public:
31         RotateScreen();
32         virtual ~RotateScreen();
33
34         bool check_invalidated();
35         void draw(unsigned char *buf);
36
37         void add_screen(GenericScreen *screen);
38 //      void remove_screen(GenericScreen *screen);
39 };
40
41 #endif /* !defined(_ROTATESCREEN_H) */