Changeset 66
- Timestamp:
- 03/07/05 02:52:30 (4 years ago)
- Files:
-
- branches/coreaudio-sound (copied) (copied from trunk)
- trunk/AudioSupport.java (deleted)
- branches/coreaudio-sound/ControlCurve.h (modified) (2 diffs)
- branches/coreaudio-sound/ControlCurve.m (modified) (6 diffs)
- trunk/Cubic.java (deleted)
- branches/coreaudio-sound/Cubic.m (modified) (1 diff)
- branches/coreaudio-sound/English.lproj/MainMenu.nib/info.nib (modified) (1 diff)
- branches/coreaudio-sound/English.lproj/MainMenu.nib/objects.nib (modified) (previous)
- branches/coreaudio-sound/LaserController.m (modified) (2 diffs)
- branches/coreaudio-sound/LaserLineCocoa.xcode/project.pbxproj (modified) (10 diffs)
- branches/coreaudio-sound/LaserView.m (modified) (2 diffs)
- branches/coreaudio-sound/RCPair.h (modified) (1 diff)
- branches/coreaudio-sound/RCPair.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/coreaudio-sound/ControlCurve.h
r64 r66 21 21 } 22 22 23 -(id)init WithAudioSupport:(id)anAudioSupport;23 -(id)init; 24 24 -(float)xPointAt:(int)i; 25 25 -(float)yPointAt:(int)i; … … 28 28 -(float)curvatureAt:(int)i :(float)u; 29 29 -(void)addBefore:(int)selected :(int)x :(int)y; 30 -(id)C; 30 31 -(int)numberOfPoints; 31 32 -(int)xlen; branches/coreaudio-sound/ControlCurve.m
r64 r66 10 10 #import <math.h> 11 11 12 @class AudioSupport; 13 12 14 static int EPSILON = 64; /* square of distance for picking */ 13 15 … … 16 18 @implementation ControlCurve 17 19 18 -(id)init WithAudioSupport:(id)anAudioSupport20 -(id)init 19 21 { 20 22 if(self = [super init]){ … … 26 28 yArray = [NSMutableArray array]; 27 29 C = [[RCPair alloc] initWithX:xArray andY:yArray]; 28 29 audioSupport = anAudioSupport;30 controlBridge = [[NSClassFromString(@"NatCubic") alloc] init]; // knows to look for Java class named @String31 [controlBridge updatePoints:[pts x] :[pts y]];32 [audioSupport initalize:controlBridge];//only run this once!33 30 } 34 31 … … 36 33 } 37 34 35 -(void)setAudioSupport:(id)anAudioSupport 36 { 37 audioSupport = anAudioSupport; 38 [audioSupport start]; 39 } 40 38 41 -(int)numberOfPoints 39 42 { … … 44 47 { 45 48 return selection; 49 } 50 51 -(id)C 52 { 53 return C; 46 54 } 47 55 … … 152 160 [controlBridge updatePoints:[pts x] :[pts y]]; 153 161 [controlBridge doCalcNaturalCubic]; 162 [audioSupport update:C]; 154 163 } 155 164 branches/coreaudio-sound/Cubic.m
r64 r66 45 45 return (6*d*u) + (2*c); 46 46 } 47 48 -(id)copy 49 { 50 return [[Cubic alloc] cubicWithA:a b:b c:c d:d]; 51 } 52 47 53 @end branches/coreaudio-sound/English.lproj/MainMenu.nib/info.nib
r60 r66 21 21 <array> 22 22 <integer>21</integer> 23 <integer>222</integer> 23 24 <integer>29</integer> 24 <integer>222</integer>25 25 </array> 26 26 <key>IBSystem Version</key> branches/coreaudio-sound/LaserController.m
r64 r66 53 53 - (IBAction)setAmplitudeValue:(id)sender 54 54 { 55 [[theLaserView getAudioSupport] updateSliderVals:(int)[amplitudeSlider intValue] :(int)[refreshRateSlider intValue]]; 56 // return [amplitudeSlider intValue]; 55 [[theLaserView getAudioSupport] setAmpVal:[sender doubleValue]]; 57 56 } 58 59 /*60 - (void) windowDidResize:(NSNotification *) note {61 NSWindow *sender = [note object]; // NSWindow62 [ theLaserView rescaleCanvasForWindow:[sender frame].size ]; // maybe should use view so nib has control63 }64 */65 57 66 58 - (IBAction)setRefreshRateValue:(id)sender 67 59 { 68 [[theLaserView getAudioSupport] updateSliderVals:(int)[amplitudeSlider intValue] :(int)[refreshRateSlider intValue]]; 69 // return [refreshRateSlider intValue]; 60 [[theLaserView getAudioSupport] setFreqVal:[sender doubleValue]]; 70 61 } 71 62 … … 150 141 -(void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem 151 142 { 152 static int laserAmpValue =0;153 static floatsineAmpValue = 0.0;143 static double laserAmpValue = 0.0; 144 static double sineAmpValue = 0.0; 154 145 if([[tabViewItem label] isEqualToString:@"Draw"]){ 155 146 [sinewaveController stop]; 156 [amplitudeSlider set IntValue:laserAmpValue];147 [amplitudeSlider setDoubleValue:laserAmpValue]; 157 148 [self setAmplitudeValue:amplitudeSlider]; 158 149 } else if([[tabViewItem label] isEqualToString:@"Sinewave"]){ 159 150 [sinewaveController start]; 160 151 laserAmpValue = [amplitudeSlider intValue]; 161 [amplitudeSlider set IntValue:0];152 [amplitudeSlider setDoubleValue:0]; 162 153 [self setAmplitudeValue:amplitudeSlider]; 163 154 } branches/coreaudio-sound/LaserLineCocoa.xcode/project.pbxproj
r64 r66 33 33 C9A317C207DA81DF0054D2BC, 34 34 C9A317C307DA81DF0054D2BC, 35 C9A317C507DA81DF0054D2BC, 35 36 C9A317C407DA81DF0054D2BC, 36 C 9A317C507DA81DF0054D2BC,37 C414DBEF07A49F8700DBBA9D, 37 38 C414DBEE07A49F8700DBBA9D, 38 C414DBEF07A49F8700DBBA9D,39 39 25B9E51707A3A339007D233C, 40 40 25B9E51807A3A339007D233C, 41 25B9E2D407A38DFE007D233C,42 41 25B9D53007A33652007D233C, 43 42 25B9D53107A33652007D233C, … … 48 47 25A8319707DB7B7900EB9BE0, 49 48 25A8319807DB7B7900EB9BE0, 50 25B9D50407A33592007D233C, 51 25146B7C07DB8F0000E0DAD3, 52 25146B7D07DB8F0000E0DAD3, 49 25146C5D07DBA2D500E0DAD3, 50 25146C5E07DBA2D500E0DAD3, 53 51 ); 54 52 isa = PBXGroup; … … 171 169 //253 172 170 //254 173 25146 B7C07DB8F0000E0DAD3 = {174 fileEncoding = 30;175 isa = PBXFileReference; 176 lastKnownFileType = sourcecode. java;177 path = Cubic.java;178 refType = 4; 179 sourceTree = "<group>"; 180 }; 181 25146 B7D07DB8F0000E0DAD3 = {182 fileEncoding = 30;183 isa = PBXFileReference; 184 lastKnownFileType = sourcecode. java;185 path = NatCubic.java;186 refType = 4; 187 sourceTree = "<group>"; 188 }; 189 25146 B7E07DB8F0000E0DAD3 = {190 fileRef = 25146 B7C07DB8F0000E0DAD3;191 isa = PBXBuildFile; 192 settings = { 193 }; 194 }; 195 25146 B7F07DB8F0000E0DAD3 = {196 fileRef = 25146 B7D07DB8F0000E0DAD3;171 25146C5D07DBA2D500E0DAD3 = { 172 fileEncoding = 4; 173 isa = PBXFileReference; 174 lastKnownFileType = sourcecode.c.h; 175 path = AudioSupport.h; 176 refType = 4; 177 sourceTree = "<group>"; 178 }; 179 25146C5E07DBA2D500E0DAD3 = { 180 fileEncoding = 4; 181 isa = PBXFileReference; 182 lastKnownFileType = sourcecode.c.objc; 183 path = AudioSupport.m; 184 refType = 4; 185 sourceTree = "<group>"; 186 }; 187 25146C5F07DBA2D500E0DAD3 = { 188 fileRef = 25146C5D07DBA2D500E0DAD3; 189 isa = PBXBuildFile; 190 settings = { 191 }; 192 }; 193 25146C6007DBA2D500E0DAD3 = { 194 fileRef = 25146C5E07DBA2D500E0DAD3; 197 195 isa = PBXBuildFile; 198 196 settings = { … … 283 281 }; 284 282 }; 285 25B9D50407A33592007D233C = {286 fileEncoding = 30;287 isa = PBXFileReference;288 lastKnownFileType = sourcecode.java;289 path = AudioSupport.java;290 refType = 4;291 sourceTree = "<group>";292 };293 25B9D50B07A33592007D233C = {294 fileRef = 25B9D50407A33592007D233C;295 isa = PBXBuildFile;296 settings = {297 JAVA_ARCHIVE_SUBDIR = "";298 };299 };300 283 25B9D51D07A335B0007D233C = { 301 284 fileEncoding = 30; … … 362 345 25B9D53307A33652007D233C = { 363 346 fileRef = 25B9D53107A33652007D233C; 364 isa = PBXBuildFile;365 settings = {366 };367 };368 25B9E2D407A38DFE007D233C = {369 fileEncoding = 4;370 isa = PBXFileReference;371 lastKnownFileType = sourcecode.c.h;372 path = LaserLine.h;373 refType = 4;374 sourceTree = "<group>";375 };376 25B9E2D507A38DFE007D233C = {377 fileRef = 25B9E2D407A38DFE007D233C;378 347 isa = PBXBuildFile; 379 348 settings = { … … 615 584 <string>$APP_PACKAGE/Contents/Resources/Java</string> 616 585 </dict> 617 <key>NSJavaNeeded</key>618 <string>YES</string>619 <key>NSJavaPath</key>620 <array>621 <string>LaserLine.jar</string>622 </array>623 <key>NSJavaRoot</key>624 <string>Contents/Resources/Java</string>625 586 <key>NSMainNibFile</key> 626 587 <string>MainMenu</string> … … 636 597 32DBCF7C0370BD5C00C91783, 637 598 25B9D53207A33652007D233C, 638 25B9E2D507A38DFE007D233C,639 599 25B9E51907A3A339007D233C, 640 600 C414DBF107A49F8700DBBA9D, … … 644 604 25A8316D07DB702200EB9BE0, 645 605 25A8319907DB7B7900EB9BE0, 606 25146C5F07DBA2D500E0DAD3, 646 607 ); 647 608 isa = PBXHeadersBuildPhase; … … 665 626 buildActionMask = 2147483647; 666 627 files = ( 667 25B9D50B07A33592007D233C,668 628 29B9732CFDCFA39411CA2CEA, 669 629 25B9D53307A33652007D233C, … … 675 635 25A8316C07DB702200EB9BE0, 676 636 25A8319A07DB7B7900EB9BE0, 677 25146B7E07DB8F0000E0DAD3, 678 25146B7F07DB8F0000E0DAD3, 637 25146C6007DBA2D500E0DAD3, 679 638 ); 680 639 isa = PBXSourcesBuildPhase; branches/coreaudio-sound/LaserView.m
r64 r66 28 28 originalWidth = [self frame].size.width; 29 29 30 audioSupport = [[NSClassFromString(@"AudioSupport") alloc] init]; // knows to look for Java class named @String 31 controlCurve = [[ControlCurve alloc] initWithAudioSupport:audioSupport]; 30 //audioSupport = [[NSClassFromString(@"JAudioSupport") alloc] init]; // knows to look for Java class named @String 31 controlCurve = [[ControlCurve alloc] init]; 32 audioSupport = [[AudioSupport alloc] initWithControlCurve:controlCurve]; 32 33 33 34 [[self window] makeFirstResponder:self]; … … 328 329 } 329 330 330 - (void)mouseUp:(NSEvent *)theEvent331 {332 //update sound333 334 [audioSupport UpdateNewerSound];335 }336 337 331 - (void)keyDown:(NSEvent *)theEvent 338 332 { branches/coreaudio-sound/RCPair.h
r64 r66 24 24 -(id)x; 25 25 -(id)y; 26 -( id)setX:(id)anObject;27 -( id)setY:(id)anObject;26 -(void)setX:(id)anObject; 27 -(void)setY:(id)anObject; 28 28 29 29 @end branches/coreaudio-sound/RCPair.m
r64 r66 69 69 } 70 70 71 -( id)setX:(id)anObject71 -(void)setX:(id)anObject 72 72 { 73 73 [key autorelease]; … … 75 75 } 76 76 77 -( id)setY:(id)anObject77 -(void)setY:(id)anObject 78 78 { 79 79 [value autorelease]; 80 80 value = [anObject retain]; 81 } 82 83 -(id)copy 84 { 85 return [[RCPair alloc] initWithKey:[key copy] andValue:[value copy]]; 81 86 } 82 87
