#pragma once #include "Screen.h" #include "Sequencer.h" #include "Player.h" class PlaybackScreen : public Screen { typedef Screen parent; typedef unsigned int MessageDisplayOffset; typedef BeatSequenceNoteInformation::BeatIndexMultiset BeatIndexMultiset; const MessageDisplayOffset messageDisplayShift = midi::Launchpad::height / 2; const midi::Launchpad::KeyCoordinate beatsHeight = midi::Launchpad::height - 1; Player::BeatIndex beatDisplayOffset; MessageDisplayOffset messageDisplayOffset; public: midi::Launchpad::KeyCoordinate beatDisplayWidth = midi::Launchpad::width - 1; PlaybackScreen(Sequencer& seq); void enable(); void beforeBeat(Player::BeatIndex beat); void afterBeat(Player::BeatIndex beat); protected: virtual void keyPressed(unsigned char x, unsigned char y); virtual void keyReleased(unsigned char x, unsigned char y); virtual void refresh(unsigned char x, unsigned char y); private: void toggleOnMessage(std::shared_ptr noteOnMessage_ptr, Player::BeatIndex beatIndex); midi::LaunchpadColor getBeatColor(std::shared_ptr noteOnMessage_ptr, BeatIndex beatIndex); static bool beatsInSequence(BeatIndex a, BeatIndex b, BeatIndex c); };