forked from samiamwork/Movist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMMovieView.h
217 lines (165 loc) · 5.32 KB
/
MMovieView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
//
// Movist
//
// Copyright 2006 ~ 2008 Yong-Hoe Kim. All rights reserved.
// Yong-Hoe Kim <[email protected]>
//
// This file is part of Movist.
//
// Movist is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Movist is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#import "Movist.h"
#import <QuartzCore/QuartzCore.h>
@class MMovie;
@class MSubtitle;
@class MMovieOSD;
@class MMovieViewLayer;
@protocol MMovieLayer;
@interface MMovieView : NSView
{
CGDirectDisplayID _displayID;
NSSize _movieSize;
CGRect _movieRect;
CGRect _imageRect;
MMovieViewLayer* _rootLayer;
MMovie* _movie;
// subtitle
MSubtitle* _subtitle;
MMovieOSD* _subtitleOSD;
unsigned int _needsSubtitleDrawing; // bit-mask of subtitle-numbers
BOOL _subtitleVisible;
BOOL _subtitleInLBOX;
int _autoLetterBoxHeightMaxLines;
int _letterBoxHeightPrefs;
int _letterBoxHeight;
float _subtitleScreenMargin; // pixels
// icon, error, message
MMovieOSD* _iconOSD;
MMovieOSD* _errorOSD;
MMovieOSD* _messageOSD;
float _messageHideInterval;
NSTimer* _messageHideTimer;
// etc. options
int _fullScreenFill;
float _fullScreenUnderScan;
int _viewDragAction;
int _captureFormat;
BOOL _includeLetterBoxOnCapture;
// capture
NSImage* _captureImage;
NSString* _capturePath;
NSPoint _draggingPoint;
// fps calc.
float _currentFps;
double _lastFpsCheckTime;
double _fpsElapsedTime;
int _fpsFrameCount;
// drag & drop
unsigned int _dragAction;
BOOL _activateOnDragging;
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
- (void)redisplay;
- (MMovie*)movie;
- (float)currentFps;
- (void)setMovie:(MMovie*)movie;
// TODO: remove these. They're just here to ease the CoreAnimation conversion process
- (NSOpenGLContext*)openGLContext;
- (NSOpenGLPixelFormat*)pixelFormat;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovieView (Image)
- (CGDirectDisplayID)displayID;
- (CVReturn)updateImage:(const CVTimeStamp*)timeStamp;
- (void)drawImage;
- (BOOL)initCoreImage;
- (NSRect)movieRect;
- (void)updateMovieRect:(BOOL)display;
- (NSRect)calcMovieRectForBoundingRect:(NSRect)boundingRect;
- (int)fullScreenFill;
- (float)fullScreenUnderScan;
- (void)setFullScreenFill:(int)fill;
- (void)setFullScreenUnderScan:(float)underScan;
- (void)setFullScreenMovieSize:(NSSize)size;
- (NSRect)underScannedRect:(NSRect)rect;
- (float)brightness;
- (float)saturation;
- (float)contrast;
- (float)hue;
- (void)setBrightness:(float)brightness;
- (void)setSaturation:(float)saturation;
- (void)setContrast:(float)contrast;
- (void)setHue:(float)hue;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovieView (OSD)
- (BOOL)initOSD;
- (void)cleanupOSD;
- (void)drawOSD;
- (void)clearOSD;
- (void)updateOSDImageBaseWidth;
- (void)showLogo;
- (void)hideLogo;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovieView (Message)
- (void)setMessageWithURL:(NSURL*)url info:(NSString*)info;
- (void)setMessage:(NSString*)s;
- (void)invalidateMessageHideTimer;
- (float)messageHideInterval;
- (void)setMessageHideInterval:(float)interval;
- (void)setError:(NSError*)error info:(NSString*)info;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovieView (Subtitle)
- (MSubtitle*)subtitle;
- (void)addSubtitle:(MSubtitle*)subtitle;
- (void)removeSubtitle:(MSubtitle*)subtitle;
- (void)removeAllSubtitles;
- (BOOL)updateSubtitleOSD;
- (BOOL)subtitleVisible;
- (void)setSubtitleVisible:(BOOL)visible;
- (void)getSubtitleAttributes:(SubtitleAttributes*)attrs;
- (void)setSubtitleAttributes:(const SubtitleAttributes*)attrs;
- (void)updateIndexOfSubtitleInLBOX;
- (int)letterBoxHeight;
- (float)subtitleScreenMargin;
- (void)setAutoLetterBoxHeightMaxLines:(int)lines;
- (void)setLetterBoxHeight:(int)height;
- (void)updateLetterBoxHeight;
- (void)setSubtitleScreenMargin:(float)screenMargin;
- (float)prevSubtitleTime;
- (float)nextSubtitleTime;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovieView (Capture)
- (int)viewDragActionWithModifierFlags:(unsigned int)flags;
- (void)setViewDragAction:(int)action;
- (void)setCaptureFormat:(int)format;
- (void)setIncludeLetterBoxOnCapture:(BOOL)include;
- (void)copyCurrentImage:(BOOL)alternative;
- (void)saveCurrentImage:(BOOL)alternative;
- (IBAction)copy:(id)sender;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovieView (DragDrop)
- (void)setActivateOnDragging:(BOOL)activate;
@end