OSDN Git Service

74c6b0c49f9893346510405a18726065dd7e7c6f
[eliscolors/main.git] / ElisLayer.h
1 //
2 //  Copyright (c) 2009 Yanagi Asakura
3 //
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.
7 //
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:
11 //
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.
16 //
17 //  2. Altered source versions must be plainly marked as such, and must not be
18 //  misrepresented as being the original software.
19 //
20 //  3. This notice may not be removed or altered from any source
21 //  distribution.
22
23 //  ElisLayer.h
24 //  Elis Colors
25 //
26 //  Created by 柳 on 09/09/12.
27 //  Copyright 2009 __MyCompanyName__. All rights reserved.
28 //
29
30 #import <Cocoa/Cocoa.h>
31 #import "ElisBase.h"
32 #import "ElisMedia.h"
33 #import "ElisEffect.h"
34
35 // Elisの中核となるデータ構造。モデル。
36 // Old ElisのLayer+Trackに相当。
37
38 // 徐々に肥大化しつつある。どうしよう。
39
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 }
49
50 //@property (assign) QTTimeRange mapping; // マッピング情報。(QTTimeRange)
51 @property (assign) ElisMedia* media;
52 //@property CALayer* alayer;
53 //@property (assign) NSValue* offset;
54
55 - (void)changeMapping;
56 - (void)setAlayer:(CALayer *)layer;
57 - (int)trackNumber;
58 - (NSPoint)getPositionForTime:(QTTime)time;
59 - (BOOL)isInclude:(QTTime)time;
60 - (CIImage*)getEffectedImage:(CVTimeStamp*)timeStamp forTime:(QTTime)time;
61 - (void)play;
62 - (void)stop;
63 - (QTTimeRange)mapping;
64 - (CIImage*)getEffectedImageWithoutStamp:(QTTime)time;
65
66 - (BOOL)canChangeOffset:(float)df;
67 - (void)changeOffset:(float)df;
68 - (BOOL)canChangeMapping:(CGRect)rect;
69
70 - (CIImage*)applyEffects:(CIImage*)image forTime:(QTTime)time;
71 - (void)addEffect:(NSString*)name;
72 - (QTTime)convertToInnnerTime:(QTTime)globalTime;
73
74 - (void)createPropertyTableDataSource:(NSMutableArray*)t_effects
75                              property:(NSMutableArray*)t_propertyNames
76                                 value:(NSMutableArray*)t_valueNames;
77
78 - (void)setPositionY:(float)y forTime:(QTTime)time;
79 - (void)setPositionX:(float)x forTime:(QTTime)time;
80
81 - (QTTime)plusOffsetTime:(QTTime)time;
82 - (void)removePositionXKeyframe;
83 - (void)removePositionYKerframe;
84
85 - (float)duration;
86 - (id)initWithCoder:(NSCoder*)coder;
87 - (void)encodeWithCoder:(NSCoder*)encoder;
88 - (void)saveToEncoder:(NSCoder*)encoder;
89 - (void)loadFromDecoder:(NSCoder*)coder;
90
91
92 @end