Download the file
  1. #ifndef MENU_H
  2. #define MENU_H
  3.  
  4. #include "screen.h"
  5. #include "rotary_handler.h"
  6. #include "hsphoto.h"
  7.  
  8. class Menu: public RotaryEncoderHandler {
  9. public:
  10. Menu(Screen * screens[], uint8_t nb_screens):
  11. screens(screens),
  12. nb_screens(nb_screens),
  13. current_screen(0),
  14. enabled(1)
  15. {}
  16.  
  17. void clockwise();
  18. void counter_clockwise();
  19. void click();
  20. void refresh();
  21. void enable() { enabled = 1; }
  22. void disable() { enabled = 0; }
  23. void on_timeout(uint8_t id);
  24.  
  25. private:
  26. Screen ** screens;
  27. uint8_t nb_screens;
  28. uint8_t current_screen;
  29. uint8_t enabled;
  30. };
  31.  
  32. #endif
  33. // vim:ft=arduino
  34.