Mercurial > hg > tweakathon2ios
view SequenceController.h @ 21:5cf2b80909fc
Hints and sliders show ok for training sequences.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 22 Oct 2014 18:12:12 +0100 |
parents | f83635861187 |
children | 8124f46eda65 |
line wrap: on
line source
// // SequenceGenerator.h // riftathon // // Created by Robert Tubb on 21/10/2014. // // #ifndef __riftathon__SequenceGenerator__ #define __riftathon__SequenceGenerator__ #include <iostream> #include "ofMain.h" #define MIN_TARGETS_IN_SEQUENCE 3 #define MAX_TARGETS_IN_SEQUENCE 5 #define MIN_TEMPO 120 #define MAX_TEMPO 250 #define NUM_TEMPO_STEPS 16 #define NUM_PRESETS 8 class Step{ public: typedef enum {COUNT_IN, PREVIEW_DISPLAY, PREVIEW_PLAY, MATCHING_INTERACTION, MATCHING_RESULT} stepTypes; Step(); // gui display bool showsTargetIcon; bool showsControlSettings; bool showsControlGuides; bool showsMatchResults; // gui input bool allowsCandidateControl; // sound bool playsTarget; bool playsCandidate; // control flow stepTypes type; bool isPreview; int seqNumber; int runNumber; bool isLastOfSeq; bool isLastOfRun; bool playsMetroClick; int tempo; // preset info int presetIndex; int numInSequence; bool isLastOfAll; void setAsPreviewShower(); void setAsPreviewPlayer(); void setAsMatchingPreparer(); void setAsMatchingReckoner(); float getTimeBetweenTicks(){ return 1000. * (60.0/tempo); } }; class SequenceController{ public: SequenceController(); Step getNextStep(); void setToStart(); void stepForward(); float getStartTickTime(); private: void generateSteps(); void generateCountIn(int countInLength); void generateARun(int run, int numInSequence); int getRandomButNot(int max, vector<int> notThese); protected: vector<Step> steps; vector<Step>::iterator currentStep; float tempoInc; }; #endif /* defined(__riftathon__SequenceGenerator__) */