Mercurial > hg > wabletios
comparison scanpath.h @ 0:c667dfe12d47
OK. Ther real deal.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Mon, 19 Nov 2012 13:00:42 +0000 |
parents | |
children | d346ddc50f70 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c667dfe12d47 |
---|---|
1 /* | |
2 * scanpath.h | |
3 * springstructure | |
4 * | |
5 * Created by Robert Tubb on 09/06/2011. | |
6 * Copyright 2011 __MyCompanyName__. All rights reserved. | |
7 * | |
8 */ | |
9 | |
10 #ifndef _SCANPATHH | |
11 #define _SCANPATHH | |
12 #include "lump.h" | |
13 #include "spring.h" | |
14 #include <vector> | |
15 | |
16 | |
17 class ScanPath{ | |
18 private: | |
19 int numElements; | |
20 int maxElements; | |
21 | |
22 bool audioAccessing; | |
23 bool updateAccessing; | |
24 | |
25 //Spring ** springPath; | |
26 // springpath - an array of pointers to the springs in the path | |
27 // lump path - ditto should be same number | |
28 Lump ** lumpPath; | |
29 Spring ** springPath; | |
30 | |
31 double * wavetableNew; | |
32 double * wavetableOld; | |
33 double * wavetableUpdate; | |
34 | |
35 double currentLength; | |
36 | |
37 double frameInterpolator; | |
38 double framesPerSample; | |
39 | |
40 | |
41 | |
42 | |
43 public: | |
44 enum scanModes {DISPLACEMENT,SPEED,SPRING_FORCE,YPOS}; | |
45 | |
46 scanModes scanMode; | |
47 double restLength; | |
48 | |
49 ScanPath(); | |
50 ~ScanPath(); | |
51 | |
52 | |
53 void inscribe(double ax,double ay); | |
54 void clear(); | |
55 | |
56 void draw(); | |
57 void drawCubic(); | |
58 | |
59 double getTotalLength(); | |
60 int howManyElements(); | |
61 | |
62 | |
63 void addSpring(); | |
64 void addLump(); | |
65 double getNextSample(); | |
66 double getNextSample(double aPhasor); | |
67 double getNextSampleCubic(double aPhasor); | |
68 // redone stuff | |
69 void initWavetables(); | |
70 void addElement(Lump* aLump, Spring * aSpring); | |
71 | |
72 void updateWavetables(); | |
73 | |
74 }; | |
75 | |
76 #endif |