Mercurial > hg > wabletios
diff scanpath.mm @ 8:4ea605899aca
Hide controls for supernatant.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 14 May 2013 10:34:32 +0100 |
parents | 085d80989ba7 |
children | 0e03760cf2d9 |
line wrap: on
line diff
--- a/scanpath.mm Wed Feb 06 13:48:49 2013 +0000 +++ b/scanpath.mm Tue May 14 10:34:32 2013 +0100 @@ -80,7 +80,7 @@ int rightsampnum = 0; float sampscale = 0.0, prevsampscale = 0.0, interp = 0.0; - ofSetColor(0, 0, 0); + ofSetColor(256, 0, 0); double step = double(numElements)/width; // how much we are stepping thru wave per pixel for(int i = 0; i < width; i++){ @@ -156,6 +156,26 @@ } //---------------------------------------------------------------- +Lump * ScanPath::getLump(int index){ + if(index < pathElements.size()){ + return pathElements[index].eLump; + }else{ + cerr << "bad scanpath::getLump index\n"; + return NULL; + } + +} +//---------------------------------------------------------------- +Spring * ScanPath::getSpring(int index){ + if(index < pathElements.size()){ + return pathElements[index].eSpring; + }else{ + cerr << "bad scanpath::getSpring index\n"; + return NULL; + } +} + +//---------------------------------------------------------------- void ScanPath::updateWavetables(){ // swap old , new double * temp; @@ -182,7 +202,7 @@ for(int i = 0; i < numElements; i++){ // double check - wavetableUpdate[i] = pathElements[i].eLump->scanRadialDisplacement(); + wavetableUpdate[i] = pathElements[i].eLump->scanDisplacement(); } @@ -386,4 +406,18 @@ return sample; } -//---------------------------------------------------------------- \ No newline at end of file +//---------------------------------------------------------------- + +Json::Value ScanPath::convertToJsonForSaving(){ + Json::Value jscanpath; + jscanpath["numElements"] = numElements; + // shiit. pointers mean nothing. the lups won't know which index they are. + return jscanpath; +} + +//---------------------------------------------------------------- + +//---------------------------------------------------------------- + +//---------------------------------------------------------------- +