Changeset 66

Show
Ignore:
Timestamp:
03/07/05 02:52:30 (4 years ago)
Author:
rchin
Message:

core audio sound branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/coreaudio-sound/ControlCurve.h

    r64 r66  
    2121} 
    2222 
    23 -(id)initWithAudioSupport:(id)anAudioSupport
     23-(id)init
    2424-(float)xPointAt:(int)i; 
    2525-(float)yPointAt:(int)i; 
     
    2828-(float)curvatureAt:(int)i :(float)u; 
    2929-(void)addBefore:(int)selected :(int)x :(int)y; 
     30-(id)C; 
    3031-(int)numberOfPoints; 
    3132-(int)xlen; 
  • branches/coreaudio-sound/ControlCurve.m

    r64 r66  
    1010#import <math.h> 
    1111 
     12@class AudioSupport; 
     13 
    1214static int EPSILON = 64;  /* square of distance for picking */ 
    1315 
     
    1618@implementation ControlCurve 
    1719 
    18 -(id)initWithAudioSupport:(id)anAudioSupport 
     20-(id)init 
    1921{ 
    2022        if(self = [super init]){ 
     
    2628                yArray = [NSMutableArray array]; 
    2729                C = [[RCPair alloc] initWithX:xArray andY:yArray]; 
    28                  
    29                 audioSupport = anAudioSupport; 
    30                 controlBridge = [[NSClassFromString(@"NatCubic") alloc] init]; // knows to look for Java class named @String 
    31                 [controlBridge updatePoints:[pts x] :[pts y]]; 
    32                 [audioSupport initalize:controlBridge];//only run this once! 
    3330        } 
    3431         
     
    3633} 
    3734 
     35-(void)setAudioSupport:(id)anAudioSupport 
     36{ 
     37        audioSupport = anAudioSupport; 
     38        [audioSupport start]; 
     39} 
     40 
    3841-(int)numberOfPoints 
    3942{ 
     
    4447{ 
    4548        return selection; 
     49} 
     50 
     51-(id)C 
     52{ 
     53        return C; 
    4654} 
    4755 
     
    152160        [controlBridge updatePoints:[pts x] :[pts y]]; 
    153161        [controlBridge doCalcNaturalCubic]; 
     162        [audioSupport update:C]; 
    154163} 
    155164 
  • branches/coreaudio-sound/Cubic.m

    r64 r66  
    4545        return (6*d*u) + (2*c); 
    4646} 
     47 
     48-(id)copy 
     49{ 
     50        return [[Cubic alloc] cubicWithA:a b:b c:c d:d]; 
     51} 
     52 
    4753@end 
  • branches/coreaudio-sound/English.lproj/MainMenu.nib/info.nib

    r60 r66  
    2121        <array> 
    2222                <integer>21</integer> 
     23                <integer>222</integer> 
    2324                <integer>29</integer> 
    24                 <integer>222</integer> 
    2525        </array> 
    2626        <key>IBSystem Version</key> 
  • branches/coreaudio-sound/LaserController.m

    r64 r66  
    5353- (IBAction)setAmplitudeValue:(id)sender 
    5454{ 
    55         [[theLaserView getAudioSupport] updateSliderVals:(int)[amplitudeSlider intValue] :(int)[refreshRateSlider intValue]]; 
    56 //      return [amplitudeSlider intValue]; 
     55        [[theLaserView getAudioSupport] setAmpVal:[sender doubleValue]]; 
    5756} 
    58  
    59 /* 
    60 - (void) windowDidResize:(NSNotification *) note { 
    61     NSWindow *sender = [note object]; // NSWindow 
    62     [ theLaserView rescaleCanvasForWindow:[sender frame].size ]; // maybe should use view so nib has control 
    63 } 
    64 */ 
    6557 
    6658- (IBAction)setRefreshRateValue:(id)sender 
    6759{ 
    68         [[theLaserView getAudioSupport] updateSliderVals:(int)[amplitudeSlider intValue] :(int)[refreshRateSlider intValue]]; 
    69 //      return [refreshRateSlider intValue]; 
     60        [[theLaserView getAudioSupport] setFreqVal:[sender doubleValue]]; 
    7061} 
    7162 
     
    150141-(void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem 
    151142{ 
    152         static int laserAmpValue = 0; 
    153         static float sineAmpValue = 0.0; 
     143        static double laserAmpValue = 0.0; 
     144        static double sineAmpValue = 0.0; 
    154145        if([[tabViewItem label] isEqualToString:@"Draw"]){ 
    155146                [sinewaveController stop]; 
    156                 [amplitudeSlider setIntValue:laserAmpValue]; 
     147                [amplitudeSlider setDoubleValue:laserAmpValue]; 
    157148                [self setAmplitudeValue:amplitudeSlider]; 
    158149        } else if([[tabViewItem label] isEqualToString:@"Sinewave"]){ 
    159150                [sinewaveController start]; 
    160151                laserAmpValue = [amplitudeSlider intValue]; 
    161                 [amplitudeSlider setIntValue:0]; 
     152                [amplitudeSlider setDoubleValue:0]; 
    162153                [self setAmplitudeValue:amplitudeSlider]; 
    163154        } 
  • branches/coreaudio-sound/LaserLineCocoa.xcode/project.pbxproj

    r64 r66  
    3333                                C9A317C207DA81DF0054D2BC, 
    3434                                C9A317C307DA81DF0054D2BC, 
     35                                C9A317C507DA81DF0054D2BC, 
    3536                                C9A317C407DA81DF0054D2BC, 
    36                                 C9A317C507DA81DF0054D2BC
     37                                C414DBEF07A49F8700DBBA9D
    3738                                C414DBEE07A49F8700DBBA9D, 
    38                                 C414DBEF07A49F8700DBBA9D, 
    3939                                25B9E51707A3A339007D233C, 
    4040                                25B9E51807A3A339007D233C, 
    41                                 25B9E2D407A38DFE007D233C, 
    4241                                25B9D53007A33652007D233C, 
    4342                                25B9D53107A33652007D233C, 
     
    4847                                25A8319707DB7B7900EB9BE0, 
    4948                                25A8319807DB7B7900EB9BE0, 
    50                                 25B9D50407A33592007D233C, 
    51                                 25146B7C07DB8F0000E0DAD3, 
    52                                 25146B7D07DB8F0000E0DAD3, 
     49                                25146C5D07DBA2D500E0DAD3, 
     50                                25146C5E07DBA2D500E0DAD3, 
    5351                        ); 
    5452                        isa = PBXGroup; 
     
    171169//253 
    172170//254 
    173                 25146B7C07DB8F0000E0DAD3 = { 
    174                         fileEncoding = 30
    175                         isa = PBXFileReference; 
    176                         lastKnownFileType = sourcecode.java
    177                         path = Cubic.java
    178                         refType = 4; 
    179                         sourceTree = "<group>"; 
    180                 }; 
    181                 25146B7D07DB8F0000E0DAD3 = { 
    182                         fileEncoding = 30
    183                         isa = PBXFileReference; 
    184                         lastKnownFileType = sourcecode.java
    185                         path = NatCubic.java
    186                         refType = 4; 
    187                         sourceTree = "<group>"; 
    188                 }; 
    189                 25146B7E07DB8F0000E0DAD3 = { 
    190                         fileRef = 25146B7C07DB8F0000E0DAD3; 
    191                         isa = PBXBuildFile; 
    192                         settings = { 
    193                         }; 
    194                 }; 
    195                 25146B7F07DB8F0000E0DAD3 = { 
    196                         fileRef = 25146B7D07DB8F0000E0DAD3; 
     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; 
    197195                        isa = PBXBuildFile; 
    198196                        settings = { 
     
    283281                        }; 
    284282                }; 
    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                 }; 
    300283                25B9D51D07A335B0007D233C = { 
    301284                        fileEncoding = 30; 
     
    362345                25B9D53307A33652007D233C = { 
    363346                        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; 
    378347                        isa = PBXBuildFile; 
    379348                        settings = { 
     
    615584                <string>$APP_PACKAGE/Contents/Resources/Java</string> 
    616585        </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> 
    625586        <key>NSMainNibFile</key> 
    626587        <string>MainMenu</string> 
     
    636597                                32DBCF7C0370BD5C00C91783, 
    637598                                25B9D53207A33652007D233C, 
    638                                 25B9E2D507A38DFE007D233C, 
    639599                                25B9E51907A3A339007D233C, 
    640600                                C414DBF107A49F8700DBBA9D, 
     
    644604                                25A8316D07DB702200EB9BE0, 
    645605                                25A8319907DB7B7900EB9BE0, 
     606                                25146C5F07DBA2D500E0DAD3, 
    646607                        ); 
    647608                        isa = PBXHeadersBuildPhase; 
     
    665626                        buildActionMask = 2147483647; 
    666627                        files = ( 
    667                                 25B9D50B07A33592007D233C, 
    668628                                29B9732CFDCFA39411CA2CEA, 
    669629                                25B9D53307A33652007D233C, 
     
    675635                                25A8316C07DB702200EB9BE0, 
    676636                                25A8319A07DB7B7900EB9BE0, 
    677                                 25146B7E07DB8F0000E0DAD3, 
    678                                 25146B7F07DB8F0000E0DAD3, 
     637                                25146C6007DBA2D500E0DAD3, 
    679638                        ); 
    680639                        isa = PBXSourcesBuildPhase; 
  • branches/coreaudio-sound/LaserView.m

    r64 r66  
    2828        originalWidth = [self frame].size.width; 
    2929 
    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]; 
    3233 
    3334                [[self window] makeFirstResponder:self]; 
     
    328329} 
    329330 
    330 - (void)mouseUp:(NSEvent *)theEvent 
    331 { 
    332         //update sound 
    333          
    334         [audioSupport UpdateNewerSound]; 
    335 } 
    336  
    337331- (void)keyDown:(NSEvent *)theEvent 
    338332{ 
  • branches/coreaudio-sound/RCPair.h

    r64 r66  
    2424-(id)x; 
    2525-(id)y; 
    26 -(id)setX:(id)anObject; 
    27 -(id)setY:(id)anObject; 
     26-(void)setX:(id)anObject; 
     27-(void)setY:(id)anObject; 
    2828 
    2929@end 
  • branches/coreaudio-sound/RCPair.m

    r64 r66  
    6969} 
    7070 
    71 -(id)setX:(id)anObject 
     71-(void)setX:(id)anObject 
    7272{ 
    7373        [key autorelease]; 
     
    7575} 
    7676 
    77 -(id)setY:(id)anObject 
     77-(void)setY:(id)anObject 
    7878{ 
    7979        [value autorelease]; 
    8080        value = [anObject retain]; 
     81} 
     82 
     83-(id)copy 
     84{ 
     85        return [[RCPair alloc] initWithKey:[key copy] andValue:[value copy]]; 
    8186} 
    8287