Commit 592c1efc authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx/framework: Get rid of VLCMediaListAspect, and remove a bunch of exception.

parent cb9e605b
......@@ -23,7 +23,6 @@
*****************************************************************************/
#import "VLCLibrary.h"
#import "VLCMediaListAspect.h"
#import "VLCStreamOutput.h"
#import "VLCMediaPlayer.h"
......@@ -129,34 +128,6 @@ extern void __catch_exception( void * e, const char * function, const char * fil
@property (readonly) void * instance;
@end
/**
* Bridges functionality between VLCMediaListAspect and libvlc.
*/
@interface VLCMediaListAspect (VLCLibVLCBridging)
/* Factories */
/**
* Manufactures a new media list aspect object with libvlc media list view instance.
* \return Newly created media list aspect using specified libvlc media list view.
*/
+ (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
/**
* Manufactures a new media list aspect object with libvlc media list view instance.
* \return Newly created media list aspect using specified libvlc media list view.
*/
+ (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
/* Initializers */
/**
* Initializes a new media list aspect object with libvlc media list view instance.
* \return Newly created media list aspect using specified libvlc media list view.
*/
- (id)initWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
/* Properties */
@property (readonly) libvlc_media_list_view_t * libVLCMediaListView; //< Libvlc pointer to media list view instance.
@end
/**
* Bridges functionality between VLCLibrary and VLCAudio.
*/
......
......@@ -31,7 +31,6 @@
#import <VLCKit/VLCMediaLibrary.h>
#import <VLCKit/VLCMediaList.h>
#import <VLCKit/VLCMediaListPlayer.h>
#import <VLCKit/VLCMediaListAspect.h>
#import <VLCKit/VLCMediaDiscoverer.h>
#import <VLCKit/VLCMediaPlayer.h>
#import <VLCKit/VLCTime.h>
......
......@@ -30,7 +30,6 @@ extern NSString * VLCMediaListItemDeleted;
@class VLCMedia;
@class VLCMediaList;
@class VLCMediaListAspect;
/**
* TODO: Documentation VLCMediaListDelegate
......@@ -56,9 +55,6 @@ extern NSString * VLCMediaListItemDeleted;
id <VLCMediaListDelegate,NSObject> delegate; //< Delegate object
/* We need that private copy because of Cocoa Bindings, that need to be working on first thread */
NSMutableArray * cachedMedia; //< Private copy of media objects.
VLCMediaListAspect * flatAspect; //< TODO: Documentation VLCMediaList.flatAspect
VLCMediaListAspect * hierarchicalAspect; //< TODO: Documentation VLCMediaList.hierarchicalAspect
VLCMediaListAspect * hierarchicalNodeAspect; //< TODO: Documentation VLCMediaList.hierarchicalNodeAspect
}
/* Operations */
......@@ -113,19 +109,4 @@ extern NSString * VLCMediaListItemDeleted;
*/
@property (readonly) BOOL isReadOnly;
/* Media list aspect */
/**
* TODO: Documentation VLCMediaList.hierarchicalAspect
*/
@property (readonly) VLCMediaListAspect * hierarchicalAspect;
/**
* TODO: Documentation VLCMediaList.hierarchicalNodeAspect
*/
@property (readonly) VLCMediaListAspect * hierarchicalNodeAspect;
/**
* TODO: Documentation VLCMediaList.flatAspect
*/
@property (readonly) VLCMediaListAspect * flatAspect;
@end
/*****************************************************************************
* VLCMediaLisAspect.h: VLCKit.framework VLCMediaLisAspect header
*****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2007 the VideoLAN team
* $Id$
*
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "VLCMediaList.h"
@class VLCMedia;
@class VLCMediaList;
@interface VLCMediaListAspectNode : NSObject
{
VLCMedia * media;
VLCMediaListAspect * children;
}
@property (retain) VLCMedia * media;
@property (retain) VLCMediaListAspect * children;
- (BOOL)isLeaf;
@end
@interface VLCMediaListAspect : NSObject
{
void * p_mlv; //< Internal instance of media list view
NSMutableArray * cachedNode;
VLCMediaList * parentMediaList;
BOOL ownHisMediaList;
}
- (VLCMedia *)mediaAtIndex:(NSInteger)index;
- (VLCMediaListAspectNode *)nodeAtIndex:(NSInteger)index;
- (NSInteger)count;
- (VLCMediaList *)parentMediaList;
@end
......@@ -68,7 +68,7 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
value = VOLUME_MIN;
else if (value > VOLUME_MAX)
value = VOLUME_MAX;
libvlc_audio_set_volume([library instance], value, NULL);
libvlc_audio_set_volume([library instance], value);
}
- (void)volumeUp
......
......@@ -93,8 +93,7 @@ void __catch_exception( void * e, const char * function, const char * file, int
lib_vlc_params[paramNum] = [vlcParam cStringUsingEncoding:NSASCIIStringEncoding];
paramNum++;
}
instance = (void *)libvlc_new( sizeof(lib_vlc_params)/sizeof(lib_vlc_params[0]), lib_vlc_params, &ex );
catch_exception( &ex );
instance = (void *)libvlc_new( sizeof(lib_vlc_params)/sizeof(lib_vlc_params[0]), lib_vlc_params);
NSAssert(instance, @"libvlc failed to initialize");
// Assignment unneeded, as the audio unit will do it for us
......
......@@ -81,7 +81,6 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Initialize internals to defaults
cachedMedia = [[NSMutableArray alloc] init];
delegate = flatAspect = hierarchicalAspect = hierarchicalNodeAspect = nil;
[self initInternalMediaList];
}
return self;
......@@ -111,9 +110,6 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
libvlc_media_list_release( p_mlist );
[cachedMedia release];
[flatAspect release];
[hierarchicalAspect release];
[hierarchicalNodeAspect release];
[super dealloc];
}
......@@ -211,40 +207,6 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
return libvlc_media_list_is_readonly( p_mlist );
}
/* Media list aspect */
- (VLCMediaListAspect *)hierarchicalAspect
{
if( hierarchicalAspect )
return hierarchicalAspect;
libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_view(p_mlist);
hierarchicalAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv );
return hierarchicalAspect;
}
- (VLCMediaListAspect *)hierarchicalNodeAspect
{
if( hierarchicalNodeAspect )
return hierarchicalNodeAspect;
libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_node_view(p_mlist);
hierarchicalNodeAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv );
return hierarchicalNodeAspect;
}
- (VLCMediaListAspect *)flatAspect
{
if( flatAspect )
return flatAspect;
libvlc_media_list_view_t * p_mlv = libvlc_media_list_flat_view(p_mlist, NULL);
flatAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv );
return flatAspect;
}
@end
@implementation VLCMediaList (LibVLCBridging)
......
This diff is collapsed.
......@@ -37,10 +37,7 @@
{
_mediaPlayer = [[VLCMediaPlayer alloc] init];
libvlc_exception_t ex;
libvlc_exception_init(&ex);
instance = libvlc_media_list_player_new([VLCLibrary sharedInstance], &ex);
catch_exception(&ex);
instance = libvlc_media_list_player_new([VLCLibrary sharedInstance]);
libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer]);
}
return self;
......
......@@ -62,8 +62,6 @@
/* Begin PBXBuildFile section */
63014A7A1042ACE100534090 /* VLCMediaListPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 63014A781042ACE100534090 /* VLCMediaListPlayer.m */; };
63014B7E1042E64A00534090 /* VLCMediaListPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 63014B7D1042E64A00534090 /* VLCMediaListPlayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
6303C43A0CF45CAE0000ECC8 /* VLCMediaListAspect.m in Sources */ = {isa = PBXBuildFile; fileRef = 6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */; };
6303C43C0CF45CC30000ECC8 /* VLCMediaListAspect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */; settings = {ATTRIBUTES = (Public, ); }; };
63098FDC110E7159005F46AE /* VLCExtensionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 63098FDA110E7159005F46AE /* VLCExtensionsManager.m */; };
63099116110F0EC3005F46AE /* VLCExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 63099114110F0EC3005F46AE /* VLCExtension.m */; };
6309994B110FC791005F46AE /* VLCExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 63099949110FC791005F46AE /* VLCExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
......@@ -141,8 +139,6 @@
63014A781042ACE100534090 /* VLCMediaListPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCMediaListPlayer.m; sourceTree = "<group>"; };
63014B7D1042E64A00534090 /* VLCMediaListPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCMediaListPlayer.h; path = Public/VLCMediaListPlayer.h; sourceTree = "<group>"; };
63030CC70CCA652C0088ECD1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = "<group>"; };
6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCMediaListAspect.m; sourceTree = "<group>"; };
6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCMediaListAspect.h; path = Public/VLCMediaListAspect.h; sourceTree = "<group>"; };
63098FDA110E7159005F46AE /* VLCExtensionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCExtensionsManager.m; sourceTree = "<group>"; };
63099114110F0EC3005F46AE /* VLCExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCExtension.m; sourceTree = "<group>"; };
63099949110FC791005F46AE /* VLCExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCExtension.h; path = Public/VLCExtension.h; sourceTree = "<group>"; };
......@@ -247,7 +243,6 @@
637D5ADB0CF6F2720073EA45 /* VLCMediaDiscoverer.m */,
EF78BD410CAEEFF600354E6E /* VLCMediaList.m */,
63014A781042ACE100534090 /* VLCMediaListPlayer.m */,
6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */,
EF8BB8CF0CAFA8D80038A613 /* VLCMediaPlayer.m */,
EF78BD400CAEEFF600354E6E /* VLCMediaLibrary.m */,
A7A0CEA30D2EF13000F2C039 /* VLCVideoCommon.m */,
......@@ -332,7 +327,6 @@
EF78BD130CAEEEE700354E6E /* VLCMedia.h */,
637D5ABC0CF6F2650073EA45 /* VLCMediaDiscoverer.h */,
EF78BD160CAEEEE700354E6E /* VLCMediaList.h */,
6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */,
63014B7D1042E64A00534090 /* VLCMediaListPlayer.h */,
EF8BB8CE0CAFA8D80038A613 /* VLCMediaPlayer.h */,
EF78BD150CAEEEE700354E6E /* VLCMediaLibrary.h */,
......@@ -363,7 +357,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
6303C43C0CF45CC30000ECC8 /* VLCMediaListAspect.h in Headers */,
EF78BD100CAEEEC300354E6E /* VLCEventManager.h in Headers */,
EF78BD1B0CAEEEE700354E6E /* VLCKit.h in Headers */,
EF78BD1C0CAEEEE700354E6E /* VLCMedia.h in Headers */,
......@@ -574,7 +567,6 @@
EF78BEF40CAF07E500354E6E /* VLCVideoView.m in Sources */,
EF8BB8D10CAFA8D80038A613 /* VLCMediaPlayer.m in Sources */,
EF7311910CB5797B009473B4 /* VLCAudio.m in Sources */,
6303C43A0CF45CAE0000ECC8 /* VLCMediaListAspect.m in Sources */,
637D5ADC0CF6F2720073EA45 /* VLCMediaDiscoverer.m in Sources */,
6341FCB10D2C0936002A97B7 /* VLCVideoLayer.m in Sources */,
A7A0CEA50D2EF13000F2C039 /* VLCVideoCommon.m in Sources */,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment