Changeset 393
- Timestamp:
- 04/14/07 18:55:43 (1 year ago)
- Files:
-
- trunk/LaserLine_2.0/Src/MainController.m (modified) (2 diffs)
- trunk/LaserLine_2.0/Src/TimelineController.h (modified) (1 diff)
- trunk/LaserLine_2.0/Src/TimelineController.m (modified) (1 diff)
- trunk/UI_Elements/CocoaTimeline/CocoaTimeline.xcodeproj/project.pbxproj (modified) (1 diff)
- trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLClip.h (modified) (2 diffs)
- trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLClip.m (modified) (1 diff)
- trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLView.h (modified) (2 diffs)
- trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLView.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/LaserLine_2.0/Src/MainController.m
r392 r393 41 41 42 42 43 LZTrack *track = [timelineController addTrack]; 44 LZLayer *layer = [timelineController addLayerToTrack:track]; 43 LZTrack *track = [[timelineController addTrack] model]; 45 44 output = [[OutputController alloc] init]; 46 [output setupDeviceWithTrack: layerfrequency:1/24.];45 [output setupDeviceWithTrack:[[track layers] objectAtIndex:0] frequency:1/24.]; 47 46 [[output frameNotificationCenter] addObserver:[[[LZDisplayDevice alloc] initWithView:renderView] autorelease]]; 48 47 } … … 129 128 130 129 - (void)addSequence:(LZSequenceableElement *)sequenceElement withLength:(NSTimeInterval)time { 131 //TODO Clean this up so it doesn't need to be at index 0, should be able to put where ever user wants 132 LZTrack *track = [[timelineController tracks] objectAtIndex:0]; 133 LZLayer *layer = [[timelineController layersInTrack:track] objectAtIndex:0]; 130 // Very ghetto 131 TLTrack *viewTrack = [[timelineController tracks] objectAtIndex:0]; 132 LZTrack *track = [viewTrack model]; 133 LZLayer *layer = [[track layers] objectAtIndex:0]; 134 134 if([layer count] > 0) 135 135 [layer removeElement:[layer elementAtIndex:0]]; 136 [layer appendElement:sequenceElement withLength:time];136 [timelineController addSequence:sequenceElement withLength:time toTrack:viewTrack]; 137 137 } 138 138 trunk/LaserLine_2.0/Src/TimelineController.h
r392 r393 2 2 #import <Timeline/Timeline.h> 3 3 4 @class LZ Timeline, LZTrack, LZLayer;4 @class LZSequenceableElement; 5 5 6 6 @interface TimelineController : NSObject { 7 7 IBOutlet TLView *timelineView; 8 LZTimeline *timeline;9 8 } 10 - ( LZTimeline*)timeline;11 - ( LZTrack *)addTrack;9 - (TLView *)timeline; 10 - (TLTrack *)addTrack; 12 11 - (NSArray *)tracks; 13 - (LZLayer *)addLayerToTrack:(LZTrack *)track; 14 - (NSArray *)layersInTrack:(LZTrack *)track; 12 - (void)addSequence:(LZSequenceableElement *)sequence withLength:(NSTimeInterval)time toTrack:(TLTrack *)track; 15 13 @end trunk/LaserLine_2.0/Src/TimelineController.m
r392 r393 6 6 7 7 @implementation TimelineController 8 - (id)init { 9 self = [super init]; 10 if(self) { 11 timeline = [[LZTimeline alloc] init]; 12 } 13 return self; 8 - (void)awakeFromNib { 9 [timelineView setModel:[[[LZTimeline alloc] init] autorelease]]; 14 10 } 15 11 16 - ( LZTimeline*)timeline {17 return timeline ;12 - (TLView *)timeline { 13 return timelineView; 18 14 } 19 15 20 - ( LZTrack *)addTrack {16 - (TLTrack *)addTrack { 21 17 LZTrack *track = [LZTrack track]; 22 [timeline addTrack:track]; 18 [[timelineView model] addTrack:track]; 19 [track addLayer:[LZLayer layer]]; //So we always have a layer 23 20 TLTrack *viewTrack = [timelineView addTrackWithDelegate:self withName:@"Test"]; 24 21 [viewTrack setModel:track]; 25 return track;22 return viewTrack; 26 23 } 27 24 28 25 - (NSArray *)tracks { 29 return [timeline tracks];26 return [timelineView allTracks]; 30 27 } 31 28 32 //TODO Add a layer type to TLView (Timeline) 33 - (LZLayer *)addLayerToTrack:(LZTrack *)track { 34 LZLayer *layer = [LZLayer layer]; 35 [track addLayer:layer]; 36 return layer; 29 - (void)addSequence:(LZSequenceableElement *)sequence withLength:(NSTimeInterval)time toTrack:(TLTrack *)track { 30 LZLayer *layer = [[[track model] layers] objectAtIndex:0]; 31 [layer appendElement:sequence withLength:time]; 32 33 //TODO make a NSTimeInterval to TLTime utility function 34 TLTime newTime; 35 newTime.length = time; 36 newTime.position = 0; 37 newTime.start = 0; 38 newTime.end = newTime.length; 39 [track addClipWithTime:newTime image:nil title:@"" identifier:nil]; 37 40 } 38 41 39 - (NSArray *)layersInTrack:(LZTrack *)track { 40 return [track layers]; 42 /* Delegates */ 43 44 - (void)clipDidStartPlaying:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInClip:(float)timeInClip atTimeInTrack:(float)timeInTrack { 45 } 46 47 - (void)clipDidStopPlaying:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInClip:(float)timeInClip atTimeInTrack:(float)timeInTrack { 48 } 49 50 - (void)userMovedPositionToClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInClip:(float)timeInClip atTimeInTrack:(float)timeInTrack { 51 } 52 53 - (void)userAddedClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInTrack:(float)timeInTrack { 54 } 55 56 - (void)userMovedClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack atTimeInTrack:(float)timeInTrack { 57 } 58 59 - (void)userResizedClip:(TLClip *)aClip inTrack:(TLTrack *)aTrack { 60 } 61 62 - (BOOL)shouldClipMove:(TLClip *)aClip inTrack:(TLTrack *)aTrack by:(float)length { 63 return YES; 64 } 65 66 - (BOOL)shouldClipResizeFromBeg:(TLClip *)aClip inTrack:(TLTrack *)aTrack by:(float)length { 67 return YES; 68 } 69 70 - (BOOL)shouldClipResizeFromEnd:(TLClip *)aClip inTrack:(TLTrack *)aTrack by:(float)length { 71 return YES; 72 } 73 74 - (void)didAddTrack:(TLTrack *)aTrack { 41 75 } 42 76 @end trunk/UI_Elements/CocoaTimeline/CocoaTimeline.xcodeproj/project.pbxproj
r390 r393 99 99 32CA4F630368D1EE00C91783 /* CocoaTimeline_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoaTimeline_Prefix.pch; sourceTree = "<group>"; }; 100 100 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 101 8D1107320486CEB800E47090 /* CocoaTimeline.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = CocoaTimeline.app; sourceTree = BUILT_PRODUCTS_DIR; };101 8D1107320486CEB800E47090 /* CocoaTimeline.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CocoaTimeline.app; sourceTree = BUILT_PRODUCTS_DIR; }; 102 102 C4184E960B910043006DB017 /* TLClip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLClip.h; sourceTree = "<group>"; }; 103 103 C4184E970B910043006DB017 /* TLClip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TLClip.m; sourceTree = "<group>"; }; trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLClip.h
r283 r393 34 34 id identifier; 35 35 NSString *uuid; 36 37 // Model info 38 id model; 36 39 } 37 40 … … 63 66 - (NSString*)title; 64 67 - (id)identifier; 68 - (id)model; 69 - (void)setModel:(id)aValue; 65 70 66 71 @end trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLClip.m
r298 r393 367 367 } 368 368 369 - (id)model 370 { 371 return model; 372 } 373 374 - (void)setModel:(id)aValue 375 { 376 id oldModel = model; 377 model = [aValue retain]; 378 [oldModel release]; 379 } 369 380 @end trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLView.h
r283 r393 29 29 NSMutableArray *tracks; 30 30 TLTrack *selectedTrack; 31 32 //Model 33 id model; 31 34 32 35 //AHHHH … … 69 72 - (TLSlider *)getTimeSlider; 70 73 - (float)framesPerSecond; 74 - (id)model; 75 - (void)setModel:(id)aValue; 71 76 72 77 @end trunk/UI_Elements/CocoaTimeline/src/TimeLine/TLView.m
r283 r393 399 399 } 400 400 401 - (id)model 402 { 403 return model; 404 } 405 406 - (void)setModel:(id)aValue 407 { 408 id oldModel = model; 409 model = [aValue retain]; 410 [oldModel release]; 411 } 401 412 @end
