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