Skip to content
Browse files

Merge branch 'master' of github.com:pomplesiegel/TB2Tho

  • Loading branch information...
2 parents 8196104 + 45c002d commit 3d6b8aa688ff4c063257519ab46a759d8ed7dd3e @pomplesiegel committed
Showing with 18 additions and 15 deletions.
  1. +1 −0 TrashBox/AudioController.mm
  2. +11 −11 TrashBox/Draw2D.m
  3. +6 −4 TrashBox/en.lproj/ViewController.xib
View
1 TrashBox/AudioController.mm
@@ -269,6 +269,7 @@ -(void)setWhichEffect:(int)effectChoice
effectState.whichEffect = effectChoice;
}
+//Set the LUT pointer
-(void)setLUTPointer:(float*)pointer;
{
LUT = pointer;
View
22 TrashBox/Draw2D.m
@@ -10,7 +10,7 @@
//Buncha constants
#define datapoints 16//16
-#define granularity 2047//2520
+#define granularity 2048//2520
#define granularity2 15
#define totalpoints datapoints*granularity
#define averagepoints 9
@@ -41,10 +41,12 @@ @implementation Draw2D
- (void)toggleSmooth1:(bool)state
{
smoothing = state;
+ [self setNeedsDisplay];
}
- (void)toggleSmooth2:(bool)state
{
smoothing2 = state;
+ [self setNeedsDisplay];
}
//Gonna have to look in to this; empty if statement
@@ -224,10 +226,6 @@ - (void)drawRect:(CGRect)rect
points[count] = p2;
count++;
}
- pi.x = width;
- pi.y = graph[datapoints-1].y;
- points[count] = pi;
- count++;
//NSLog(@"Count = %d", count);
//post-splining smoothing
@@ -270,17 +268,19 @@ - (void)drawRect:(CGRect)rect
lut[shift16-i] = 0.0f;
}
else {
- lut[shift16+i] = (1 - y / height)*(MAXVAL-1);
- lut[shift16-i] = (y/height - 1)*MAXVAL;
+ lut[shift16+i] = (1 - y / height)*(MAXVAL-1) - 1024;
+ lut[shift16-i] = (y/height - 1)*MAXVAL + 1024;
}
}
- for(int i= count; count<shift16; count++) {
- lut[shift16+i] = 1.0f * (MAXVAL-1);
- lut[shift16-i] = -1.0f * MAXVAL;
- }
lut[0] = -1.0f * MAXVAL;
CGContextStrokePath(context);
+ //NSLog(@"Count: %d",count);
+ for(int i = 0; i < bits16/2048; i++) {
+ NSLog(@"fake: %f",lutfake[i*2048]);
+ NSLog(@"real: %f",lut[i*2048]);
+ }
+
[FFTview calcFFT];
}
View
10 TrashBox/en.lproj/ViewController.xib
@@ -221,7 +221,7 @@
<object class="IBUILabel" id="925813778">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{45, 828}, {262, 70}}</string>
+ <string key="NSFrame">{{45, 858}, {262, 70}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="187549990"/>
@@ -241,9 +241,10 @@
<object class="IBUISwitch" id="187549990">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{300, 849}, {94, 27}}</string>
+ <string key="NSFrame">{{300, 879}, {94, 27}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="28155622"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
@@ -255,6 +256,7 @@
<string key="NSFrame">{{437, 801}, {295, 175}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@@ -406,10 +408,10 @@
<reference ref="356398636"/>
<reference ref="15931400"/>
<reference ref="459598515"/>
- <reference ref="925813778"/>
<reference ref="352877114"/>
- <reference ref="187549990"/>
<reference ref="28155622"/>
+ <reference ref="925813778"/>
+ <reference ref="187549990"/>
</array>
<reference key="parent" ref="0"/>
</object>

0 comments on commit 3d6b8aa

Please sign in to comment.
Something went wrong with that request. Please try again.