comparison SequenceController.h @ 36:146033869165

ISSR fixed colors for stages more repetitions
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 02 Dec 2014 13:25:48 +0000
parents 3b10a26da293
children 52dbd5b4cfa9
comparison
equal deleted inserted replaced
35:3b10a26da293 36:146033869165
11 11
12 #include <iostream> 12 #include <iostream>
13 #include "ofMain.h" 13 #include "ofMain.h"
14 #include "presetManager.h" 14 #include "presetManager.h"
15 #include "TrainingScoreManager.h" 15 #include "TrainingScoreManager.h"
16
16 #define MIN_TARGETS_IN_SEQUENCE 1 17 #define MIN_TARGETS_IN_SEQUENCE 1
18 #define NUM_REPETITIONS_AT_LEVEL 2
17 #define MAX_TARGETS_IN_SEQUENCE 7 19 #define MAX_TARGETS_IN_SEQUENCE 7
18 #define MIN_TEMPO 60 20 #define MIN_TEMPO 70
19 #define MAX_TEMPO 500 21 #define MAX_TEMPO 480
20 #define NUM_TEMPO_STEPS 15 22 #define TEMPO_RANDOM_AMOUNT
23 #define MAX_TIME 2800
24 #define MIN_TIME 200
25 #define NUM_TEMPO_STEPS 17
26
21 #define NUM_PRESETS 8 27 #define NUM_PRESETS 8
22 #define SPACER_BARS false 28 #define SPACER_BARS false
23 #define NO_GUIDES_LEVEL false 29 #define NO_GUIDES_LEVEL false
30
24 class AnimStep{ 31 class AnimStep{
25 32
26 33
27 public: 34 public:
28 35
36 MATCHING_MOVE, 43 MATCHING_MOVE,
37 MATCHING_LAST} 44 MATCHING_LAST}
38 stepType; 45 stepType;
39 46
40 stepType type; 47 stepType type;
41 48 int getTimeAllowed(){
49 return timeAllowedMs;
50 }
42 float getTimeBetweenTicks(){ 51 float getTimeBetweenTicks(){
43 return 1000* (60.0/tempo); 52 //return 1000* (60.0/tempo);
53 return timeAllowedMs/4.0;
54 }
55
56 void setTempoFromTime(){
57 tempo = 60.0 / (4* timeAllowedMs*1000.0);
58 }
59 void setTimeFromTempo(){
60 timeAllowedMs = 4*1000* (60.0/tempo);
44 } 61 }
45 int presetIndex; 62 int presetIndex;
46 Preset * currentTargetPreset; 63 Preset * currentTargetPreset;
47 Preset * nextTargetPreset; 64 Preset * nextTargetPreset;
48 int whichInSequence; 65 int whichInSequence;
49 bool isLastOfAll; 66 bool isLastOfAll;
50 67
51 int tempo; 68 int tempo;
69 int tempoLevel;
70 int timeAllowedMs;
52 int seqNumber; 71 int seqNumber;
53 int runNumber; 72 int runNumber;
54 int difficulty; 73 int difficulty;
55 bool isLastOfSeq; 74 bool isLastOfSeq;
56 bool isLastOfRun; 75 bool isLastOfRun;
105 void setAsPreviewPlayer(); 124 void setAsPreviewPlayer();
106 void setAsMatchingPreparer(); 125 void setAsMatchingPreparer();
107 void setAsMatchingInteraction(); 126 void setAsMatchingInteraction();
108 void setAsMatchingFeedback(); 127 void setAsMatchingFeedback();
109 128
110
111 float getTimeBetweenTicks(){
112 return 1000. * (60.0/tempo);
113 }
114
115 }; 129 };
116 130
117 class SequenceController{ 131 class SequenceController{
118 public: 132 public:
119 SequenceController(); 133 SequenceController();
136 int getRandomButNot(int max, vector<int> notThese); 150 int getRandomButNot(int max, vector<int> notThese);
137 protected: 151 protected:
138 vector<AnimStep> steps; 152 vector<AnimStep> steps;
139 vector<AnimStep>::iterator currentStep; 153 vector<AnimStep>::iterator currentStep;
140 float tempoInc; 154 float tempoInc;
155 int timeInc;
141 bool soundOnlyMode; 156 bool soundOnlyMode;
142 int totNumRuns; 157 int totNumRuns;
143 }; 158 };
144 159
145 #endif /* defined(__riftathon__SequenceGenerator__) */ 160 #endif /* defined(__riftathon__SequenceGenerator__) */