summaryrefslogtreecommitdiff
path: root/vfg/src/testApp.h
blob: 14a0fbfc7f0f9b6da45d89db8e90fe37f6a23fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#pragma once

#include "ofMain.h"
#include "ofxSprite.h"
#include "ofxGui.h"
#include "ofxFensterManager.h"

#include "music.h"
#include "Asterisk.h"
#include "Puppet.h"
#include "Tag.h";

/*
this library?

https://github.com/micknoise/Maximilian

Maximilian is an audio synthesis and signal processing library written in C++. It's cross-platform compatible with MacOS, Windows, Linux and IOS systems.  The main features are:

- sample playback, recording and looping
- read from WAV and OGG files.
- a selection of oscillators and filters
- enveloping
- multichannel mixing for 1, 2, 4 and 8 channel setups
- controller mapping functions
- effects including delay, distortion, chorus, flanging
- granular synthesis, including time and pitch stretching
- atom synthesis
- realtime music information retrieval functions: spectrum analysis, spectral features, octave analysis, and MFCCs
- example projects for Windows and MacOS, using command line and OpenFrameworks environments

transitions
break clap movements
practice mode
ramdisk for movies

the 2nd time you play , if you 'die' it doesn't trigger 'end of game', the music keeps playing and the tags keep coming up even when state is 'ready'

*/

#define GAME_STARTINGINTRO 1
#define GAME_INTRO 2
#define GAME_ENDINGINTRO 3
#define GAME_READY 4
#define GAME_STARTINGADVERT 5
#define GAME_ADVERT 6
#define GAME_ENDINGADVERT 7
#define GAME_STARTPLAYING 8
#define GAME_PRACTICE 9
#define GAME_PRACTICE2 10
#define GAME_PLAYING 11
#define GAME_ENDPLAYING 12
#define GAME_WALKON 13
#define GAME_ENDTITLE 14

class guiWindow;


class testApp : public ofxFensterListener{

	public:
		void setup();
		void update();
		void draw();
		void exit();

		void keyPressedEvent(ofKeyEventArgs &args);
		void keyPressed(int key, ofxFenster* win);
		void keyPressed  (int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);

		void drawBackgroundLayers();
		void activateGame();
		void activatePractice();
		void switchAnimals();
		void endGame();
		void hangUp();
		
		void queueWalkOff();
		void queueWalkOn();

		ofVideoPlayer intro;
		ofVideoPlayer advert;
		ofSoundPlayer backgroundmusic;

		ofVideoPlayer background;
		ofImage vignette;

		vector<song*> songs;
		song practiceSong;


		vector<Puppet> penguins;
		vector<Puppet> raccoons;

		//vector<vector<Puppet> > animals;

		//vector<Puppet> playanimals;

		vector<Puppet>* playanimal;
		vector<Tag*> tags;

		vector<Billboard*> logos;

		puppetSprite banner;
		puppetSprite wirebirds;

		Billboard* lyricspanel;

		Puppet testpenguin;
		int currentlevel;

		Asterisk game;

		bool showFPS;
		bool showVis;
		bool fullscreenoutput;

		int currentsong,nextsong,gamestate,segmentStartTime;

		float fadelength;

		guiWindow *guiWin;
		ofxPanel gui;
		ofxIntSlider tS;
		ofxParameter<int>threshStart;
		ofxIntSlider tE;
		ofxParameter<int> threshEnd;
		ofxIntSlider ts;
		ofxParameter<int> timescale;
		ofxIntSlider kT;
		ofxParameter<int> keyThresh;
		ofxFloatSlider bP;
		ofxParameter<float> birdpoint;
		ofxToggle showWire;

};

class guiWindow: public ofxFensterListener{
public:
	~guiWindow();
	testApp *parent;
	void setup();
	void setParent(testApp *p);
	void draw();
	void dragEvent(ofDragInfo dragInfo,ofxFenster* win);
	void windowMoved(int x, int y);
	string levelnames[14]={
		"STARTINGINTRO",
		"INTRO",
		"ENDINGINTRO",
		"READY",
		"STARTINGADVERT",
		"ADVERT",
		"ENDINGADVERT",
		"STARTPLAYING",
		"PRACTICE",
		"PRACTICE2",
		"PLAYING",
		"ENDPLAYING",
		"WALKON",
		"ENDTITLE"
		};
};