1 /*****************************************************************************
2 * VLCLibVLCbridging.h: VLCKit.framework VLCLibVLCBridging (Private) header
3 *****************************************************************************
4 * Copyright (C) 2007 Pierre d'Herbemont
5 * Copyright (C) 2007 the VideoLAN team
8 * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
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.
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.
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 *****************************************************************************/
25 #import "VLCLibrary.h"
26 #import "VLCMediaListAspect.h"
27 #import "VLCStreamOutput.h"
29 /* Utility functions */
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.
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 );
39 * Bridges functionality between libvlc and VLCMediaList implementation.
41 @interface VLCMediaList (LibVLCBridging)
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
49 + (id)mediaListWithLibVLCMediaList:(void *)p_new_mlist;
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
58 - (id)initWithLibVLCMediaList:(void *)p_new_mlist;
61 @property (readonly) void * libVLCMediaList; //< LibVLC media list pointer.
65 * Bridges functionality between libvlc and VLCMedia implementation.
67 @interface VLCMedia (LibVLCBridging)
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.
74 + (id)mediaWithLibVLCMediaDescriptor:(void *)md;
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.
82 - (id)initWithLibVLCMediaDescriptor:(void *)md;
84 + (id)mediaWithMedia:(VLCMedia *)media andLibVLCOptions:(NSDictionary *)options;
87 * Returns the receiver's internal media descriptor pointer.
88 * \return The receiver's internal media descriptor pointer.
90 @property (readonly) void * libVLCMediaDescriptor;
94 * Bridges functionality between VLCMedia and VLCMediaPlayer
96 @interface VLCMedia (VLCMediaPlayerBridging)
98 * Set's the length of the media object. This value becomes available once the
99 * media object is being played.
102 - (void)setLength:(VLCTime *)value;
106 * Bridges functionality between VLCLibrary and LibVLC core.
108 @interface VLCLibrary (VLCLibVLCBridging)
110 * Shared singleton instance of libvlc library instance.
111 * \return libvlc pointer of library instance.
113 + (void *)sharedInstance;
116 * Instance of libvlc library instance.
117 * \return libvlc pointer of library instance.
119 @property (readonly) void * instance;
123 * Bridges functionality between VLCMediaListAspect and libvlc.
125 @interface VLCMediaListAspect (VLCLibVLCBridging)
128 * Manufactures a new media list aspect object with libvlc media list view instance.
129 * \return Newly created media list aspect using specified libvlc media list view.
131 + (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
134 * Manufactures a new media list aspect object with libvlc media list view instance.
135 * \return Newly created media list aspect using specified libvlc media list view.
137 + (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
141 * Initializes a new media list aspect object with libvlc media list view instance.
142 * \return Newly created media list aspect using specified libvlc media list view.
144 - (id)initWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
147 @property (readonly) libvlc_media_list_view_t * libVLCMediaListView; //< Libvlc pointer to media list view instance.
151 * Bridges functionality between VLCLibrary and VLCAudio.
153 @interface VLCLibrary (VLCAudioBridging)
155 * Called by VLCAudio, each library has a singleton VLCaudio instance. VLCAudio
156 * calls this function to let the VLCLibrary instance know how to get in touch
157 * with the VLCAudio instance. TODO: Each media player instance should have it's
158 * own audio instance...not each library instance.
160 - (void)setAudio:(VLCAudio *)value;
164 * Bridges functionality between VLCAudio and VLCLibrary.
166 @interface VLCAudio (VLCAudioBridging)
169 * Initializes a new object using the specified library instance.
170 * \return Newly created audio object using specified VLCLibrary instance.
172 - (id)initWithLibrary:(VLCLibrary *)library;
176 * TODO: Documentation
178 @interface VLCStreamOutput (LibVLCBridge)
179 - (NSString *)representedLibVLCOptions;