]> git.sesse.net Git - vlc/blob - projects/macosx/framework/Headers/Internal/VLCLibVLCBridging.h
8125d108f628e4caf253114a6fe680353a751134
[vlc] / projects / macosx / framework / Headers / Internal / VLCLibVLCBridging.h
1 /*****************************************************************************
2 * VLCLibVLCbridging.h: VLCKit.framework VLCLibVLCBridging (Private) 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 "VLCLibrary.h"
26 #import "VLCMediaListAspect.h"
27 #import "VLCStreamOutput.h"
28 #import "VLCMediaPlayer.h"
29
30 /* Utility functions */
31 /**
32  * \function catch_execption( ex )
33  * Utility function that catches a LibVLC generated exception by throwing a Cocoa based NSException.  
34  * \param ex LibVLC exception returned by LibVLC internal functions.
35  */
36 #define catch_exception( ex ) __catch_exception( (void *)(ex), __FUNCTION__, __FILE__, __LINE__ )
37 extern void __catch_exception( void * e, const char * function, const char * file, int line_number );
38
39 /**
40  * Bridges functionality between libvlc and VLCMediaList implementation.
41  */
42 @interface VLCMediaList (LibVLCBridging)
43 /* Factories */
44 /**
45  * Manufactures new object wrapped around specified media list.
46  * \param p_new_mlist LibVLC media list pointer.
47  * \return Newly create media list instance using specified media list 
48  * pointer.
49  */
50 + (id)mediaListWithLibVLCMediaList:(void *)p_new_mlist;
51
52 /* Initializers */
53 /**
54  * Initializes new object wrapped around specified media list.
55  * \param p_new_mlist LibVLC media list pointer.
56  * \return Newly create media list instance using specified media list
57  * pointer.
58  */
59 - (id)initWithLibVLCMediaList:(void *)p_new_mlist;
60
61 /* Properties */
62 @property (readonly) void * libVLCMediaList;    //< LibVLC media list pointer.
63 @end
64
65 /**
66  * Bridges functionality between libvlc and VLCMedia implementation.
67  */
68 @interface VLCMedia (LibVLCBridging)
69 /* Factories */
70 /**
71  * Manufactures new object wrapped around specified media descriptor.
72  * \param md LibVLC media descriptor pointer.
73  * \return Newly created media instance using specified descriptor.
74  */
75 + (id)mediaWithLibVLCMediaDescriptor:(void *)md;
76
77 /* Initializers */
78 /**
79  * Initializes new object wrapped around specified media descriptor.
80  * \param md LibVLC media descriptor pointer.
81  * \return Newly created media instance using specified descriptor.
82  */
83 - (id)initWithLibVLCMediaDescriptor:(void *)md;
84
85 + (id)mediaWithMedia:(VLCMedia *)media andLibVLCOptions:(NSDictionary *)options;
86
87 /**
88  * Returns the receiver's internal media descriptor pointer.
89  * \return The receiver's internal media descriptor pointer.
90  */
91 @property (readonly) void * libVLCMediaDescriptor;
92 @end
93
94 /**
95  * Bridges functionality between VLCMedia and VLCMediaPlayer
96  */
97 @interface VLCMediaPlayer (LibVLCBridging)
98
99 /* Properties */
100 @property (readonly) void * libVLCMediaPlayer;    //< LibVLC media list pointer.
101 @end
102
103 /**
104  * Bridges functionality between VLCMediaPlayer and LibVLC core
105  */
106 @interface VLCMedia (VLCMediaPlayerBridging)
107 /**
108  * Set's the length of the media object.  This value becomes available once the
109  * media object is being played.
110  * \param value
111  */
112 - (void)setLength:(VLCTime *)value;
113 @end
114
115 /**
116  * Bridges functionality between VLCLibrary and LibVLC core.
117  */
118 @interface VLCLibrary (VLCLibVLCBridging)
119 /**
120  * Shared singleton instance of libvlc library instance.
121  * \return libvlc pointer of library instance.
122  */
123 + (void *)sharedInstance;
124
125 /**
126  * Instance of libvlc library instance.
127  * \return libvlc pointer of library instance.
128  */
129 @property (readonly) void * instance;
130 @end
131
132 /**
133  * Bridges functionality between VLCMediaListAspect and libvlc.
134  */
135 @interface VLCMediaListAspect (VLCLibVLCBridging)
136 /* Factories */
137 /**
138  * Manufactures a new media list aspect object with libvlc media list view instance.
139  * \return Newly created media list aspect using specified libvlc media list view.
140  */
141 + (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
142
143 /**
144  * Manufactures a new media list aspect object with libvlc media list view instance.
145  * \return Newly created media list aspect using specified libvlc media list view.
146  */
147 + (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
148
149 /* Initializers */
150 /**
151  * Initializes a new media list aspect object with libvlc media list view instance.
152  * \return Newly created media list aspect using specified libvlc media list view.
153  */
154 - (id)initWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
155
156 /* Properties */
157 @property (readonly) libvlc_media_list_view_t * libVLCMediaListView; //< Libvlc pointer to media list view instance.
158 @end
159
160 /**
161  * Bridges functionality between VLCLibrary and VLCAudio.
162  */
163 @interface VLCLibrary (VLCAudioBridging)
164 /**
165  * Called by VLCAudio, each library has a singleton VLCaudio instance.  VLCAudio
166  * calls this function to let the VLCLibrary instance know how to get in touch 
167  * with the VLCAudio instance.  TODO: Each media player instance should have it's
168  * own audio instance...not each library instance.
169  */
170 - (void)setAudio:(VLCAudio *)value;
171 @end
172
173 /**
174  * Bridges functionality between VLCAudio and VLCLibrary.
175  */
176 @interface VLCAudio (VLCAudioBridging)
177 /* Initializers */
178 /**
179  * Initializes a new object using the specified library instance.
180  * \return Newly created audio object using specified VLCLibrary instance.
181  */
182 - (id)initWithLibrary:(VLCLibrary *)library;
183 @end
184
185 /**
186  * TODO: Documentation
187  */
188 @interface VLCStreamOutput (LibVLCBridge)
189 - (NSString *)representedLibVLCOptions;
190 @end