Commit d4bbae04 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCMediaListAspect.m: Implement -hierarchicalAspect and...

MacOSX/Framework/VLCMediaListAspect.m: Implement -hierarchicalAspect and -flatAspect. (And add an internal @interface for VLCMediaListAspect (LibVLCBridging)).
parent 71e01e17
/*****************************************************************************
* VLCLibVLCbridging.h: VLC.framework VLCLibVLCBridging header
* VLCLibVLCbridging.h: VLC.framework VLCLibVLCBridging (Private) header
*****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2007 the VideoLAN team
......@@ -22,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "VLCLibrary.h"
#import "VLCLibrary.h"
// TODO: Documentation
@interface VLCMediaList (LibVLCBridging)
......@@ -57,6 +57,7 @@
- (void *)libVLCMediaDescriptor;
@end
// TODO: Documentation
@interface VLCMedia (VLCMediaPlayerBridging)
- (void)setLength:(VLCTime *)value;
......@@ -68,6 +69,12 @@
- (void *)instance;
@end
@interface VLCMediaListAspect (VLCLibVLCBridging)
+ (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
- (id)initWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
- (libvlc_media_list_view_t *)libVLCMediaListView;
@end
// TODO: Documentation
@interface VLCLibrary (VLCAudioBridging)
- (void)setAudio:(VLCAudio *)value;
......
......@@ -28,6 +28,7 @@
#import <VLC/VLCMedia.h>
#import <VLC/VLCMediaLibrary.h>
#import <VLC/VLCMediaList.h>
#import <VLC/VLCMediaListAspect.h>
#import <VLC/VLCTime.h>
#import <VLC/VLCVideoView.h>
......
......@@ -30,6 +30,7 @@ extern NSString * VLCMediaListItemDeleted;
@class VLCMedia;
@class VLCMediaList;
@class VLCMediaListAspect;
// TODO: Documentation
@protocol VLCMediaListDelegate
......@@ -58,4 +59,8 @@ extern NSString * VLCMediaListItemDeleted;
- (VLCMedia *)mediaAtIndex:(int)index;
- (int)indexOfMedia:(VLCMedia *)media;
- (int)count;
/* Media list aspect */
- (VLCMediaListAspect *)hierarchicalAspect;
- (VLCMediaListAspect *)flatAspect;
@end
\ No newline at end of file
......@@ -222,6 +222,26 @@ static void HandleMediaListWillDeleteItem(const libvlc_event_t *event, void *use
return result;
}
/* Media list aspect */
- (VLCMediaListAspect *)hierarchicalAspect
{
VLCMediaListAspect * hierarchicalAspect;
libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_view( p_mlist, NULL );
hierarchicalAspect = [VLCMediaListAspect mediaListAspectWithLibVLCMediaListView: p_mlv];
libvlc_media_list_view_release( p_mlv );
return hierarchicalAspect;
}
- (VLCMediaListAspect *)flatAspect
{
VLCMediaListAspect * flatAspect;
libvlc_media_list_view_t * p_mlv = libvlc_media_list_flat_view( p_mlist, NULL );
flatAspect = [VLCMediaListAspect mediaListAspectWithLibVLCMediaListView: p_mlv];
libvlc_media_list_view_release( p_mlv );
return flatAspect;
}
@end
@implementation VLCMediaList (LibVLCBridging)
......
......@@ -105,12 +105,12 @@ static void HandleMediaListViewWillDeleteItem(const libvlc_event_t *event, void
@end
@implementation VLCMediaListAspect (LibVLCBridging)
+ (id)mediaListAspectWithLibVLCMediaListView:(void *)p_new_mlv;
+ (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
{
return [[[VLCMediaList alloc] initWithLibVLCMediaList:p_new_mlv] autorelease];
}
- (id)initWithLibVLCMediaListView:(void *)p_new_mlv;
- (id)initWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
{
if( self = [super init] )
{
......@@ -121,9 +121,9 @@ static void HandleMediaListViewWillDeleteItem(const libvlc_event_t *event, void
return self;
}
- (void *)libVLCMediaListView
- (libvlc_media_list_view_t *)libVLCMediaListView
{
return p_mlv;
return (libvlc_media_list_view_t *)p_mlv;
}
@end
......
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