2 // Copyright (c) 2009 Yanagi Asakura
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it
10 // freely, subject to the following restrictions:
12 // 1. The origin of this software must not be misrepresented; you must not
13 // claim that you wrote the original software. If you use this software
14 // in a product, an acknowledgment in the product documentation would be
15 // appreciated but is not required.
17 // 2. Altered source versions must be plainly marked as such, and must not be
18 // misrepresented as being the original software.
20 // 3. This notice may not be removed or altered from any source
26 // Created by 柳 on 09/09/12.
27 // Copyright 2009 __MyCompanyName__. All rights reserved.
30 #import <Cocoa/Cocoa.h>
33 #import "ElisEffect.h"
35 // Elisの中核となるデータ構造。モデル。
36 // Old ElisのLayer+Trackに相当。
40 @interface ElisLayer : NSObject {
41 ElisMedia* media; // メディアオブジェクト
42 int trackNumber; // トラック番号。0から
43 QTTimeRange mapping; // プロジェクト上の配置情報
44 CALayer* alayer; // タイムラインで表示するレイヤー
45 QTTime offset; // 再生時間オフセット
46 NSMutableArray* effects; // エフェクトの配列
47 ElisKeyframe *pxKeyframe, *pyKeyframe; // Positionのキーフレーム
48 NSRect originSize; // 用意せざるをえない!
51 //@property (assign) QTTimeRange mapping; // マッピング情報。(QTTimeRange)
52 @property (assign) ElisMedia* media;
53 //@property CALayer* alayer;
54 //@property (assign) NSValue* offset;
56 - (void)changeMapping;
57 - (void)setAlayer:(CALayer *)layer;
59 - (NSPoint)getPositionForTime:(QTTime)time;
60 - (BOOL)isInclude:(QTTime)time;
61 - (CIImage*)getEffectedImage:(CVTimeStamp*)timeStamp forTime:(QTTime)time;
64 - (QTTimeRange)mapping;
65 - (CIImage*)getEffectedImageWithoutStamp:(QTTime)time;
67 - (BOOL)canChangeOffset:(float)df;
68 - (void)changeOffset:(float)df;
69 - (BOOL)canChangeMapping:(CGRect)rect;
71 - (CIImage*)applyEffects:(CIImage*)image forTime:(QTTime)time;
72 - (void)addEffect:(NSString*)name;
73 - (QTTime)convertToInnnerTime:(QTTime)globalTime;
75 - (void)createPropertyTableDataSource:(NSMutableArray*)t_effects
76 property:(NSMutableArray*)t_propertyNames
77 value:(NSMutableArray*)t_valueNames;
79 - (void)setPositionY:(float)y forTime:(QTTime)time;
80 - (void)setPositionX:(float)x forTime:(QTTime)time;
82 - (QTTime)plusOffsetTime:(QTTime)time;
83 - (void)removePositionXKeyframe;
84 - (void)removePositionYKerframe;
87 - (id)initWithCoder:(NSCoder*)coder;
88 - (void)encodeWithCoder:(NSCoder*)encoder;
89 - (void)saveToEncoder:(NSCoder*)encoder;
90 - (void)loadFromDecoder:(NSCoder*)coder;
94 - (void)setSpeed:(float)s;