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