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 ElisKeyframe *volumeKeyframe;
49 NSRect originSize; // 用意せざるをえない!
52 //@property (assign) QTTimeRange mapping; // マッピング情報。(QTTimeRange)
53 @property (assign) ElisMedia* media;
54 //@property CALayer* alayer;
55 //@property (assign) NSValue* offset;
57 - (void)changeMapping;
58 - (void)setAlayer:(CALayer *)layer;
60 - (NSPoint)getPositionForTime:(QTTime)time;
61 - (BOOL)isInclude:(QTTime)time;
62 - (CIImage*)getEffectedImage:(CVTimeStamp*)timeStamp forTime:(QTTime)time;
65 - (QTTimeRange)mapping;
66 - (CIImage*)getEffectedImageWithoutStamp:(QTTime)time;
68 - (BOOL)canChangeOffset:(float)df;
69 - (void)changeOffset:(float)df;
70 - (BOOL)canChangeMapping:(CGRect)rect;
72 - (CIImage*)applyEffects:(CIImage*)image forTime:(QTTime)time;
73 - (void)addEffect:(NSString*)name;
74 - (QTTime)convertToInnnerTime:(QTTime)globalTime;
76 - (void)createPropertyTableDataSource:(NSMutableArray*)t_effects
77 property:(NSMutableArray*)t_propertyNames
78 value:(NSMutableArray*)t_valueNames;
80 - (void)setPositionY:(float)y forTime:(QTTime)time;
81 - (void)setPositionX:(float)x forTime:(QTTime)time;
83 - (QTTime)plusOffsetTime:(QTTime)time;
84 - (void)removePositionXKeyframe;
85 - (void)removePositionYKerframe;
88 - (id)initWithCoder:(NSCoder*)coder;
89 - (void)encodeWithCoder:(NSCoder*)encoder;
90 - (void)saveToEncoder:(NSCoder*)encoder;
91 - (void)loadFromDecoder:(NSCoder*)coder;
95 - (void)setSpeed:(float)s;
98 - (float)getVolumeForTime:(QTTime)time;
99 - (void)setVolume:(float)v forTime:(QTTime)time;
100 - (float)getVolumeForInnerTime:(QTTime)time;