| 1234567891011121314151617181920212223242526272829303132333435363738394041 | 
							- #include <iostream>
 
- #include "LaunchpadScreen.h"
 
- struct DrawScreen : public midi::LaunchpadScreen
 
- {
 
-     virtual void keyPressed(unsigned char x, unsigned char y);
 
-     void all(unsigned short a, unsigned short b)
 
-     {
 
-         setColorAll(midi::LaunchpadColor(a, b));
 
-     }
 
- };
 
- midi::Launchpad l;
 
- DrawScreen s[8];
 
-     
 
- void DrawScreen::keyPressed(unsigned char x, unsigned char y)
 
- {
 
-     // std::cout << "(" << (int)x << ", " << (int)y << ")" << std::endl;
 
-     if(y == 8) {
 
-         std::cout << "switch to screen #" << (int)x << std::endl;
 
-         disable();
 
-         s[x].enable();
 
-     } else {
 
-         setColor(x, y, midi::LaunchpadColor(3 - getColor(x, y).red, 3 - getColor(x, y).green));
 
-     }
 
- }
 
- int main()
 
- {
 
-     for(int i=0; i<8; i++) {
 
-         s[i].setLaunchpad(l);
 
-         s[i].all(i % 4, (int)((float)i/4));
 
-     }
 
-     s[4].enable();
 
-     std::cin.ignore();
 
-     return 0;
 
- }
 
 
  |