Changeset 360

Show
Ignore:
Timestamp:
04/07/07 23:30:21 (1 year ago)
Author:
cweider2
Message:

LaserLine: lotsa cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/LaserLine_2.0/LaserLine_2.0.xcodeproj/project.pbxproj

    r359 r360  
    1414                A80467100BA3B12100CADE97 /* LZAudioOutputDevice.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A804670E0BA3B12100CADE97 /* LZAudioOutputDevice.h */; }; 
    1515                A80467110BA3B12100CADE97 /* LZAudioOutputDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = A804670F0BA3B12100CADE97 /* LZAudioOutputDevice.m */; }; 
     16                A83D1CF20BAA1EA800E8271A /* LZFrameObject.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A83D1CF00BAA1EA800E8271A /* LZFrameObject.h */; }; 
     17                A83D1CF30BAA1EA800E8271A /* LZFrameObject.m in Sources */ = {isa = PBXBuildFile; fileRef = A83D1CF10BAA1EA800E8271A /* LZFrameObject.m */; }; 
    1618                A87BE21F0BA469B1002DEDDF /* LZSpirograph.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A87BE21D0BA469B1002DEDDF /* LZSpirograph.h */; }; 
    1719                A87BE2200BA469B1002DEDDF /* LZSpirograph.m in Sources */ = {isa = PBXBuildFile; fileRef = A87BE21E0BA469B1002DEDDF /* LZSpirograph.m */; }; 
     
    168170                                D42887110BAE259300F4F72D /* LZ3DTorus.h in CopyFiles */, 
    169171                                D461AECA0BB4C74900EEF5FB /* LZBeamEffect.h in CopyFiles */, 
     172                                A83D1CF20BAA1EA800E8271A /* LZFrameObject.h in CopyFiles */, 
    170173                        ); 
    171174                        runOnlyForDeploymentPostprocessing = 0; 
     
    186189                A804670E0BA3B12100CADE97 /* LZAudioOutputDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZAudioOutputDevice.h; sourceTree = "<group>"; }; 
    187190                A804670F0BA3B12100CADE97 /* LZAudioOutputDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZAudioOutputDevice.m; sourceTree = "<group>"; }; 
     191                A83D1CF00BAA1EA800E8271A /* LZFrameObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZFrameObject.h; sourceTree = "<group>"; }; 
     192                A83D1CF10BAA1EA800E8271A /* LZFrameObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZFrameObject.m; sourceTree = "<group>"; }; 
    188193                A87BE21D0BA469B1002DEDDF /* LZSpirograph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZSpirograph.h; sourceTree = "<group>"; }; 
    189194                A87BE21E0BA469B1002DEDDF /* LZSpirograph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZSpirograph.m; sourceTree = "<group>"; }; 
     
    214219                D2F8CDAF0BA18F6F00C463D4 /* LaserTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LaserTools.framework; path = ../Build/Debug/LaserTools.framework; sourceTree = SOURCE_ROOT; }; 
    215220                D2F8CDB00BA18F6F00C463D4 /* Timeline.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Timeline.framework; path = ../Build/Debug/Timeline.framework; sourceTree = SOURCE_ROOT; }; 
    216                 D2F8CE6B0BA1936500C463D4 /* Build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = "<group>"; }; 
     221                D2F8CE6B0BA1936500C463D4 /* Build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = Build.xcconfig; path = Src/Build.xcconfig; sourceTree = "<group>"; }; 
    217222                D428870F0BAE259300F4F72D /* LZ3DTorus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZ3DTorus.h; sourceTree = "<group>"; }; 
    218223                D42887100BAE259300F4F72D /* LZ3DTorus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZ3DTorus.m; sourceTree = "<group>"; }; 
     
    305310                        isa = PBXGroup; 
    306311                        children = ( 
    307                                 D2F8CE6B0BA1936500C463D4 /* Build.xcconfig */, 
     312                                F8A6D5790B784D9400652C81 /* MainController.h */, 
     313                                F8A6D57A0B784D9400652C81 /* MainController.m */, 
    308314                                A82FC5990B97ED0F00AA5CFD /* Interface */, 
    309315                                A82FC4FD0B97DB9B00AA5CFD /* FileImports */, 
     
    311317                                A8A2C5AE0B82B94100AE1703 /* OutputController */, 
    312318                                F8A6D5840B78592900652C81 /* ILDAlib */, 
    313                                 F8A6D5790B784D9400652C81 /* MainController.h */, 
    314                                 F8A6D57A0B784D9400652C81 /* MainController.m */, 
    315319                                A8A2C5AF0B82B96200AE1703 /* ThirdParty */, 
    316320                        ); 
     
    383387                                A8F4873D0B9A12AF00A1380A /* LaserLineDoc.icns */, 
    384388                                A8F4873E0B9A12AF00A1380A /* LaserLineApp.icns */, 
     389                                D2F8CE6B0BA1936500C463D4 /* Build.xcconfig */, 
    385390                                8D1107310486CEB800E47090 /* Info.plist */, 
    386391                                089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 
     
    455460                                F8835F1F0B9A3CFE00BDC3C1 /* LZPolyline.m */, 
    456461                                F8835F160B9A3CFE00BDC3C1 /* LZFilter.h */, 
     462                                A83D1CF00BAA1EA800E8271A /* LZFrameObject.h */, 
     463                                A83D1CF10BAA1EA800E8271A /* LZFrameObject.m */, 
    457464                                F8835F170B9A3CFE00BDC3C1 /* LZFilter.m */, 
    458465                                F8835F260B9A3CFE00BDC3C1 /* LZTimeRange.h */, 
     
    732739                                D42887120BAE259300F4F72D /* LZ3DTorus.m in Sources */, 
    733740                                D461AECB0BB4C74900EEF5FB /* LZBeamEffect.m in Sources */, 
     741                                A83D1CF30BAA1EA800E8271A /* LZFrameObject.m in Sources */, 
    734742                        ); 
    735743                        runOnlyForDeploymentPostprocessing = 0; 
  • trunk/LaserLine_2.0/Src/FileImports/FlashImport.m

    r353 r360  
    6969                } 
    7070                 
    71                 [frame addPolyline:polyline]; 
     71                [frame addFrameObject:polyline]; 
    7272                [frames addObject:frame]; 
    7373                 
  • trunk/LaserLine_2.0/Src/FileImports/ILDAImport.m

    r343 r360  
    5757                        } 
    5858                 
    59                 [frame setPolyline:polyline]; 
     59                [frame addFrameObject:polyline]; 
    6060                [frames addObject:frame]; 
    6161                 
  • trunk/LaserLine_2.0/Src/MainController.h

    r295 r360  
    22 
    33@class OutputController, TLView, LZTimeline, LZSplitView, LZControlView; 
    4 @class LZRenderedFrameView
     4@class LZRenderedFrameView, LZSequenceableElement, LZLayer
    55 
    66@interface MainController : NSObject { 
     
    99        IBOutlet LZSplitView *splitViewTop; 
    1010        IBOutlet LZControlView *controlView; 
     11         
    1112        IBOutlet LZRenderedFrameView *renderView; 
    1213         
    1314        LZTimeline *timeline; 
     15        LZLayer *layer; 
    1416        OutputController *output; 
    1517} 
     18 
     19 
     20- (void)addGenerator:(Class)generatorClass; 
     21- (IBAction)addAntiClock:(id)sender; 
     22- (IBAction)add3DTorus:(id)sender; 
     23- (IBAction)addBeamEffect:(id)sender; 
     24 
     25- (void)addSequence:(LZSequenceableElement *)sequenceElement withLength:(NSTimeInterval)time; 
    1626 
    1727//Temporary debug code 
  • trunk/LaserLine_2.0/Src/MainController.m

    r346 r360  
    11#import "MainController.h" 
     2 
    23#import <Timeline/TLTrack.h> 
    34#import <Timeline/TLClip.h> 
    45#import "ILDAImport.h" 
     6#import "FlashImport.h" 
    57#import "LZTrack.h" 
    68#import "LZTimeline.h" 
     
    2325        if(self) { 
    2426                timeline = [[LZTimeline alloc] init]; 
     27                layer = [[LZLayer alloc] initWithDuration:60]; 
     28                 
    2529                [timeline addTrack:[LZTrack track]]; 
     30                [[[timeline tracks] objectAtIndex:0] addLayer:layer]; 
     31                 
    2632                output = [[OutputController alloc] init]; 
     33                [output setupDeviceWithTrack:layer frequency:1/24.]; 
    2734        } 
    2835        return self; 
     
    3946         
    4047        //[self addAntiClock:self]; 
    41         [self add3DTorus:self]; 
     48        //[self add3DTorus:self]; 
    4249        //[self addBeamEffect:self]; 
    43  
     50        [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 
    4451} 
    4552 
     
    6168                return; 
    6269         
    63         TLTrack *track = [timelineView addTrackWithDelegate:self withName:@"Track 1"]; 
    64         assert(track != nil); 
    65          
    66         LZLayer *newLayer = [[LZLayer alloc] initWithDuration:[[animation elements] count]/24.]; 
    67         [newLayer insertElement:animation inTimeRange:LZMakeTimeRange(0,[[animation elements] count]/24.)]; 
    68         [[[timeline tracks] objectAtIndex:0] addLayer:newLayer]; 
    69          
    70          
    71         TLTime newTime; 
    72         newTime.length = 50; 
    73         newTime.position = 0; 
    74         newTime.start = 0; 
    75         newTime.end = 50; 
    76          
    77         [track addClipWithTime:newTime image:[NSImage imageNamed:@"movie"] title:@"ILDA Import" identifier:nil]; 
    78         [timelineView setNeedsDisplay:YES];//Is this necessary? I think timelineView sets this internally on clip add 
    79         [output setupDeviceWithTrack:newLayer frequency:1/24.]; 
    80         [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 
     70        [self addSequence:animation withLength:[[animation elements] count]/24.]; 
    8171} 
    8272 
    8373- (IBAction)importFlash:(id)sender { 
    84          
    8574        NSOpenPanel *openPanel = [NSOpenPanel openPanel]; 
    8675        int result = [openPanel runModalForDirectory:NSHomeDirectory() file:nil types:[NSArray arrayWithObject:@"swf"]]; 
     
    9180        if(animation == nil) 
    9281                return; 
    93         TLTrack *track = [timelineView addTrackWithDelegate:self withName:@"Track 1"]; 
    94         assert(track != nil); 
    9582         
    96         LZLayer *newLayer = [[LZLayer alloc] initWithDuration:[[animation elements] count]/24.]; 
    97         [newLayer insertElement:animation inTimeRange:LZMakeTimeRange(0,[[animation elements] count]/24.)]; 
    98         [[[timeline tracks] objectAtIndex:0] addLayer:newLayer]; 
    99          
    100         TLTime newTime; 
    101         newTime.length = 50; 
    102         newTime.position = 0; 
    103         newTime.start = 0; 
    104         newTime.end = 50; 
    105  
    106         [track addClipWithTime:newTime image:[NSImage imageNamed:@"movie"] title:@"Flash_Import" identifier:nil]; 
    107         [timelineView setNeedsDisplay:YES];//Is this necessary? I think timelineView sets this internally on clip add 
    108         [output setupDeviceWithTrack:newLayer frequency:1/24.]; 
    109         [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 
     83        [self addSequence:animation withLength:[[animation elements] count]/24.]; 
    11084} 
    11185 
    11286 
    11387- (IBAction)addAntiClock:(id)sender { 
    114         LZLayer *newLayer = [[LZLayer alloc] initWithDuration:60]; 
    115         [newLayer insertElement:[[[LZAnticlock alloc] init] autorelease] inTimeRange:LZMakeTimeRange(0,60)]; 
    116         [[[timeline tracks] objectAtIndex:0] addLayer:newLayer]; 
    117          
    118         [output setupDeviceWithTrack:newLayer frequency:1/24.]; 
    119         [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 
     88        [self addGenerator:[LZAnticlock class]]; 
    12089} 
    12190 
    12291- (IBAction)add3DTorus:(id)sender { 
    123         LZLayer *newLayer = [[LZLayer alloc] initWithDuration:60]; 
    124         [newLayer insertElement:[[[LZ3DTorus alloc] init] autorelease] inTimeRange:LZMakeTimeRange(0,60)]; 
    125         [[[timeline tracks] objectAtIndex:0] addLayer:newLayer]; 
    126          
    127         [output setupDeviceWithTrack:newLayer frequency:1/24.]; 
    128         [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 
     92        [self addGenerator:[LZ3DTorus class]]; 
    12993} 
    13094 
    13195- (IBAction)addBeamEffect:(id)sender { 
    132         LZLayer *newLayer = [[LZLayer alloc] initWithDuration:60]; 
    133         [newLayer insertElement:[[[LZBeamEffect alloc] init] autorelease] inTimeRange:LZMakeTimeRange(0,60)]; 
    134         [[[timeline tracks] objectAtIndex:0] addLayer:newLayer]; 
    135          
    136         [output setupDeviceWithTrack:newLayer frequency:1/24.]; 
    137         [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 
     96        [self addGenerator:[LZBeamEffect class]]; 
    13897} 
    13998 
     99- (void)addGenerator:(Class)generatorClass 
     100  { 
     101  [self addSequence:[[[generatorClass alloc] init] autorelease] withLength:60]; 
     102  } 
    140103 
    141 - (IBAction)playButtonPressed:(id)sender 
    142 
    143         if([sender state] == NSOnState) // Will Play 
    144         { 
    145          
    146         } 
    147         else if([sender state] == NSOffState) // Will Stop 
    148         { 
    149          
    150         }   
    151 
     104 
     105- (void)addSequence:(LZSequenceableElement *)sequenceElement withLength:(NSTimeInterval)time 
     106  { 
     107  [layer insertElement:sequenceElement inTimeRange:LZMakeTimeRange([layer duration], time)]; 
     108  } 
     109 
     110 
    152111 
    153112- (IBAction)stop:(id)sender { 
     
    155114} 
    156115 
    157 - (void)userMovedPositionToClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInClip:(float)timeInClip atTimeInTrack:(float)timeInTrack 
    158 { 
    159         //NSLog(@"User moved to Clip %@ in Track %@ at %f in the clip and we're at %f in the track", aClip, aTrack, [timeInClip floatValue], [timeInTrack floatValue]); 
    160 } 
    161  
    162 - (void)userAddedClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInTrack:(float)timeInTrack 
    163 { 
    164  
    165 } 
    166  
    167 - (void)userMovedClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInTrack:(float)timeInTrack 
    168 { 
    169  
    170 } 
    171  
    172 - (void)userResizedClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack 
    173 { 
    174  
    175 } 
    176  
    177 - (BOOL)shouldClipMove:(TLClip *)aClip inTrack:(TLTrack *)aTrack by:(float)length 
    178 { 
    179         return YES; 
    180 } 
    181  
    182 - (BOOL)shouldClipResizeFromBeg:(TLClip *)aClip inTrack:(TLTrack *)aTrack by:(float)length 
    183 { 
    184         return YES; 
    185 } 
    186  
    187 - (BOOL)shouldClipResizeFromEnd:(TLClip *)aClip inTrack:(TLTrack *)aTrack by:(float)length 
    188 { 
    189         return YES; 
    190 } 
    191  
    192 - (void)didAddTrack:(TLTrack *)aTrack 
    193 { 
    194  
    195 } 
    196  
    197 - (IBAction)pointSliderDidChange:(id)sender 
    198 { 
    199  
    200 } 
    201  
    202116@end 
  • trunk/LaserLine_2.0/Src/OutputController/CompositeSource.m

    r320 r360  
    2424 
    2525- (NSData *)frameAtTime:(NSTimeInterval)aTime { 
    26         RawFrame frame = [[sources objectAtIndex:0] renderAtTime:aTime]; 
    27         NSMutableData *appendedData = [[NSMutableData alloc] initWithBytes:frame.points length:frame.pointCount*sizeof(RawPoint)]; 
    28         free(frame.points); 
    29  
     26        RawFrame frame; 
     27        NSMutableData *appendedData = [[NSMutableData alloc] initWithCapacity:500*sizeof(RawPoint)];    //we'll plan on getting ~500 points 
     28         
    3029        NSEnumerator *enumerator = [sources objectEnumerator]; 
    3130        LZLayer *anObject; 
    32         [enumerator nextObject]; 
    33         while (anObject = (LZLayer *)[enumerator nextObject]) { 
     31        while (anObject = [enumerator nextObject]) { 
    3432                frame = [anObject renderAtTime:aTime]; 
    3533                [appendedData appendBytes:frame.points length:frame.pointCount*sizeof(RawPoint)]; 
  • trunk/LaserLine_2.0/Src/OutputController/RawTypes.c

    r337 r360  
    22 
    33const RawPoint NullRawPoint = {0, 0, 0, 0, 0, 0}; 
    4 const RawFrame NullRawFrame = {&NullRawPoint, 0}; 
     4const RawFrame NullRawFrame = {0x0, 0}; 
  • trunk/LaserLine_2.0/Src/Sequencing/Generators/LZ3DTorus.m

    r352 r360  
    7272                points[p].r = points[p].g = points[p].b = points[p].i = 0xFF; 
    7373        } 
    74  
    7574         
    7675        return frame; 
    77          
    7876} 
    7977@end 
  • trunk/LaserLine_2.0/Src/Sequencing/LZFrame.h

    r353 r360  
    44#import "LZPoint.h" 
    55#import "LZSequenceableElement.h" 
     6#import "LZFrameObject.h" 
    67 
    78@interface LZFrame : LZSequenceableElement 
     
    1516 
    1617- (LZPolyline *)polyline; 
    17 - (void)addPolyline:(LZPolyline *)polyline
     18- (void)addFrameObject:(LZFrameObject *)aFrameObject
    1819 
    1920- (RawFrame)renderAtPosition:(float)position; 
  • trunk/LaserLine_2.0/Src/Sequencing/LZFrame.m

    r353 r360  
    3636  } 
    3737 
    38 - (void)addPolyline:(LZPolyline *)aPolyline 
     38- (void)addFrameObject:(LZFrameObject *)aFrameObject 
    3939  { 
    40   [objects addObject:aPolyline]; 
     40  [objects addObject:aFrameObject]; 
    4141  } 
    4242 
     
    4646   
    4747  frame.pointCount = 0; 
    48   LZPolyline* object; 
     48  LZFrameObject* object; 
    4949  NSEnumerator *enumerator = [objects objectEnumerator]; 
    50   while(object = [enumerator nextObect])  
     50  while(object = [enumerator nextObject])  
    5151        { 
    5252        frame.pointCount += [object count]; 
     
    5656  unsigned i = 0; 
    5757  enumerator = [objects objectEnumerator]; 
    58   while(object = [enumerator nextObect])  
     58  while(object = [enumerator nextObject])  
    5959        { 
    6060        LZPoint *point; 
  • trunk/LaserLine_2.0/Src/Sequencing/LZLayer.h

    r320 r360  
    2424- (NSTimeInterval)duration; 
    2525 
    26  
    2726- (BOOL)timeRangeIsFree:(LZTimeRange)timeRange; 
    2827- (NSArray *)elementsInTimeRange:(LZTimeRange)timeRange; 
  • trunk/LaserLine_2.0/Src/Sequencing/LZPolyline.h

    r353 r360  
    88 
    99#import <Cocoa/Cocoa.h> 
    10 #import "LZPoint.h" 
     10#import "LZFrameObject.h" 
    1111 
    1212 
    13 @interface LZPolyline : NSObject 
     13@interface LZPolyline : LZFrameObject 
    1414        { 
    1515        NSMutableArray *pointArray; 
  • trunk/LaserLine_2.0/Src/Sequencing/LZSequenceableElement.m

    r320 r360  
    4747  for(i; i < [myFilters count]; i++) 
    4848        { 
    49       [[myFilters objectAtIndex:i] filter:rawFrame atProgression:progression]; 
     49//    [[myFilters objectAtIndex:i] filter:rawFrame atProgression:progression]; 
    5050        }  
    5151  }