annotate scanpath.h @ 8:4ea605899aca

Hide controls for supernatant.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 14 May 2013 10:34:32 +0100
parents 5b659bc0b572
children 0e03760cf2d9
rev   line source
rt300@0 1 /*
rt300@0 2 * scanpath.h
rt300@0 3 * springstructure
rt300@0 4 *
rt300@0 5 * Created by Robert Tubb on 09/06/2011.
rt300@0 6 * Copyright 2011 __MyCompanyName__. All rights reserved.
rt300@0 7 *
rt300@0 8 */
rt300@0 9
rt300@0 10 #ifndef _SCANPATHH
rt300@0 11 #define _SCANPATHH
rt300@0 12 #include "lump.h"
rt300@0 13 #include "spring.h"
rt300@8 14 #include "json.h"
rt300@0 15 #include <vector>
rt300@3 16 struct Element{
rt300@3 17 Lump * eLump;
rt300@3 18 Spring * eSpring;
rt300@3 19 Element(Lump * aLump, Spring * aSpring){
rt300@3 20 eLump = aLump;
rt300@3 21 eSpring = aSpring;
rt300@3 22
rt300@3 23 };
rt300@3 24
rt300@3 25 };
rt300@0 26
rt300@0 27 class ScanPath{
rt300@0 28 private:
rt300@0 29 int numElements;
rt300@0 30 int maxElements;
rt300@0 31
rt300@0 32 bool audioAccessing;
rt300@0 33 bool updateAccessing;
rt300@0 34
rt300@6 35 bool bidirectional;
rt300@0 36 //Spring ** springPath;
rt300@0 37 // springpath - an array of pointers to the springs in the path
rt300@3 38 // lump path - ditto should be same number
rt300@3 39 vector<Element> pathElements;
rt300@3 40
rt300@0 41 double * wavetableNew;
rt300@0 42 double * wavetableOld;
rt300@0 43 double * wavetableUpdate;
rt300@0 44
rt300@0 45 double currentLength;
rt300@0 46
rt300@0 47 double frameInterpolator;
rt300@0 48 double framesPerSample;
rt300@0 49
rt300@0 50
rt300@0 51
rt300@0 52
rt300@0 53 public:
rt300@0 54 enum scanModes {DISPLACEMENT,SPEED,SPRING_FORCE,YPOS};
rt300@0 55
rt300@0 56 scanModes scanMode;
rt300@0 57 double restLength;
rt300@0 58
rt300@0 59 ScanPath();
rt300@0 60 ~ScanPath();
rt300@3 61 void init();
rt300@0 62
rt300@0 63 void inscribe(double ax,double ay);
rt300@0 64 void clear();
rt300@0 65
rt300@0 66 void draw();
rt300@0 67 void drawCubic();
rt300@0 68
rt300@0 69 double getTotalLength();
rt300@0 70 int howManyElements();
rt300@0 71
rt300@0 72
rt300@0 73 void addSpring();
rt300@0 74 void addLump();
rt300@0 75 double getNextSample();
rt300@0 76 double getNextSample(double aPhasor);
rt300@0 77 double getNextSampleCubic(double aPhasor);
rt300@0 78 // redone stuff
rt300@0 79 void initWavetables();
rt300@3 80 void addElement(Lump* const aLump, Spring * const aSpring);
rt300@8 81 Lump * getLump(int index);
rt300@8 82 Spring * getSpring(int index);
rt300@8 83
rt300@0 84 void updateWavetables();
rt300@0 85
rt300@8 86 Json::Value convertToJsonForSaving();
rt300@0 87 };
rt300@0 88
rt300@0 89 #endif