]> git.sesse.net Git - vlc/blob - extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
MacOSX/Framework: Very minor identation changes.
[vlc] / extras / MacOSX / Framework / Headers / Public / VLCMediaPlayer.h
1 /*****************************************************************************
2  * VLCMediaPlayer.h: VLC.framework VLCMediaPlayer header
3  *****************************************************************************
4  * Copyright (C) 2007 Pierre d'Herbemont
5  * Copyright (C) 2007 the VideoLAN team
6  * $Id$
7  *
8  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #import <Cocoa/Cocoa.h>
26 #import "VLCMedia.h"
27
28 /* Notification Messages */
29 extern NSString * VLCMediaPlayerTimeChanged;
30 extern NSString * VLCMediaPlayerStateChanged;
31
32 // TODO: Documentation
33 typedef enum VLCMediaPlayerState
34 {
35     VLCMediaPlayerStateStopped,        //< Player has stopped
36     VLCMediaPlayerStateOpening,        //< Stream is opening
37     VLCMediaPlayerStateBuffering,      //< Stream is buffering
38     VLCMediaPlayerStateEnded,          //< Stream has ended
39     VLCMediaPlayerStateError,          //< Player has generated an error
40     VLCMediaPlayerStatePlaying,        //< Stream is playing
41     VLCMediaPlayerStatePaused          //< Stream is paused
42 } VLCMediaPlayerState;
43
44 extern NSString *VLCMediaPlayerStateToString(VLCMediaPlayerState state);
45
46 /**
47  * Formal protocol declaration for playback delegates.  Allows playback messages
48  * to be trapped by delegated objects.
49  */
50 @protocol VLCMediaPlayerDelegate
51 - (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
52 - (void)mediaPlayerStateChanged:(NSNotification *)aNotification;
53 @end
54
55 // TODO: Should we use medialist_player or our own flavor of media player?
56 @interface VLCMediaPlayer : NSObject 
57 {
58     id delegate;            //< Object delegate
59     VLCVideoView *videoView;//< NSView instance where media is rendered to
60
61     void *instance;            //  Internal
62     VLCMedia *media;        //< Current media being played
63 }
64
65 /* Initializers */
66 - (id)initWithVideoView:(VLCVideoView *)aVideoView;
67
68 /* Properties */
69 - (void)setDelegate:(id)value;
70 - (id)delegate;
71
72 /* Video View Options */
73 // TODO: Should be it's own object?
74
75 // TODO: use VLCVideoView instead of NSView
76 - (void)setVideoView:(VLCVideoView *)value;
77 - (VLCVideoView *)videoView;
78
79 - (void)setFullscreen:(BOOL)value;
80 - (BOOL)fullscreen;
81
82 - (void)setVideoAspectRatio:(char *)value;
83 - (char *)videoAspectRatio;
84 - (void)setVideoSubTitles:(int)value;
85 - (int)videoSubTitles;
86
87 - (void)setVideoCropGeometry:(char *)value;
88 - (char *)videoCropGeometry;
89
90 - (void)setVideoTeleText:(int)value;
91 - (int)videoTeleText;
92
93 - (void)setRate:(int)value;
94 - (int)rate;
95
96 /* Video Information */
97 - (NSSize)videoSize;
98 - (BOOL)hasVideoOut;
99 - (float)framesPerSecond;
100
101 /**
102  * Sets the current position (or time) of the feed.
103  * \param value New time to set the current position to.  If time is [VLCTime nullTime], 0 is assumed.
104  */
105 - (void)setTime:(VLCTime *)value;
106
107 /** 
108  * Returns the current position (or time) of the feed.
109  * \return VLCTIme object with current time.
110  */
111 - (VLCTime *)time;
112
113 /* Audio Options */
114 - (void)setAudioTrack:(int)value;
115 - (int)audioTrack;
116
117 - (void)setAudioChannel:(int)value;
118 - (int)audioChannel;
119
120 /* Media Options */
121 - (void)setMedia:(VLCMedia *)value;
122 - (VLCMedia *)media;
123
124 /* Playback Operations */
125 /**
126  * Plays a media resource using the currently selected media controller (or 
127  * default controller.  If feed was paused then the feed resumes at the position 
128  * it was paused in.
129  * \return A Boolean determining whether the stream was played or not.
130  */
131 - (BOOL)play;
132
133 /**
134  * Toggle's the pause state of the feed.
135  */
136 - (void)pause;
137
138 /**
139  * Fast forwards through the feed at the standard 1x rate.
140  */
141 //- (void)fastForward;
142
143 /**
144  * Fast forwards through the feed at the rate specified.
145  * \param rate Rate at which the feed should be fast forwarded.
146  */
147 //- (void)fastForwardAtRate:(int)rate;
148
149 /**
150  * Rewinds through the feed at the standard 1x rate.
151  */
152 //- (void)rewind;
153
154 /**
155  * Rewinds through the feed at the rate specified.
156  * \param rate Rate at which the feed should be fast rewound.
157  */
158 //- (void)rewindAtRate:(int)rate;
159
160 /* Playback Information */
161 /**
162  * Playback state flag identifying that the stream is currently playing.
163  * \return TRUE if the feed is playing, FALSE if otherwise.
164  */
165 - (BOOL)isPlaying;
166
167 /**
168  * Playback state flag identifying wheather the stream will play.
169  * \return TRUE if the feed is ready for playback, FALSE if otherwise.
170  */
171 - (BOOL)willPlay;
172
173 /**
174  * Playback's current state.
175  * \see VLCMediaState
176  */
177 - (VLCMediaPlayerState)state;
178 @end