OSDN Git Service

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