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