PlaybackScreen.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "Screen.h"
  3. #include "Sequencer.h"
  4. #include "Player.h"
  5. class PlaybackScreen : public Screen
  6. {
  7. typedef Screen parent;
  8. typedef BeatSequence::BeatIndex BeatIndex;
  9. typedef BeatSequenceNoteInformation::BeatIndexMultiset BeatIndexMultiset;
  10. Player::BeatIndex beatDisplayOffset;
  11. public:
  12. midi::Launchpad::KeyCoordinate beatDisplayWidth = midi::Launchpad::width - 1;
  13. PlaybackScreen(Sequencer& seq);
  14. void enable();
  15. void beforeBeat(Player::BeatIndex beat);
  16. void afterBeat(Player::BeatIndex beat);
  17. protected:
  18. virtual void keyPressed(unsigned char x, unsigned char y);
  19. virtual void keyReleased(unsigned char x, unsigned char y);
  20. virtual void refresh(unsigned char x, unsigned char y);
  21. private:
  22. void toggleOnMessage(std::shared_ptr<midi::NoteOnMessage> noteOnMessage_ptr, Player::BeatIndex beatIndex);
  23. midi::LaunchpadColor getBeatColor(std::shared_ptr<midi::NoteOnMessage> noteOnMessage_ptr, BeatIndex beatIndex);
  24. static bool beatsInSequence(BeatIndex a, BeatIndex b, BeatIndex c);
  25. };