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

MacOSX/Framework: Implement VLCMediaListAspect.

parent c69a5c6e
/*****************************************************************************
* VLCMediaLisAspect.h: VLC.framework VLCMediaLisAspect header
*****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2007 the VideoLAN team
* $Id: VLCMediaList.h 21564 2007-08-29 21:09:27Z pdherbemont $
*
* 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 VLCMediaListAspect : NSObject
{
void * p_mlv; //< Internal instance of media list view
}
- (VLCMedia *)mediaAtIndex:(int)index;
- (int)count;
@end
\ No newline at end of file
/*****************************************************************************
* VLCMediaList.m: VLC.framework VLCMediaList implementation
*****************************************************************************
* 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 "VLCMediaListAspect.h"
#import "VLCLibrary.h"
#import "VLCEventManager.h"
#import "VLCLibVLCBridging.h"
#include <vlc/vlc.h>
#include <vlc/libvlc.h>
// TODO: Documentation
@interface VLCMediaListAspect (Private)
/* Initializers */
- (void)initInternalMediaListView;
@end
@implementation VLCMediaListAspect (KeyValueCodingCompliance)
/* For the @"Media" key */
- (int) countOfMedia
{
return [self count];
}
- (id) objectInMediaAtIndex:(int)i
{
return [self mediaAtIndex:i];
}
@end
@implementation VLCMediaListAspect
- (void)dealloc
{
// Release allocated memory
libvlc_media_list_release(p_mlv);
[super dealloc];
}
- (VLCMedia *)mediaAtIndex:(int)index
{
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
libvlc_media_descriptor_t *p_md = libvlc_media_list_view_item_at_index( p_mlv, index, &p_e );
quit_on_exception( &p_e );
// Returns local object for media descriptor, searchs for user data first. If not found it creates a
// new cocoa object representation of the media descriptor.
return [VLCMedia mediaWithLibVLCMediaDescriptor:p_md];
}
- (int)count
{
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
int result = libvlc_media_list_view_count( p_mlv, &p_e );
quit_on_exception( &p_e );
return result;
}
@end
@implementation VLCMediaListAspect (LibVLCBridging)
+ (id)mediaListAspectWithLibVLCMediaListView:(void *)p_new_mlv;
{
return [[[VLCMediaList alloc] initWithLibVLCMediaList:p_new_mlv] autorelease];
}
- (id)initWithLibVLCMediaListView:(void *)p_new_mlv;
{
if( self = [super init] )
{
p_mlv = p_new_mlv;
libvlc_media_list_view_retain(p_mlv);
[self initInternalMediaListView];
}
return self;
}
- (void *)libVLCMediaListView
{
return p_mlv;
}
@end
@implementation VLCMediaListAspect (Private)
- (void)initInternalMediaListView
{
/* Add internal callback */
}
@end
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
6303C43A0CF45CAE0000ECC8 /* VLCMediaListAspect.m in Sources */ = {isa = PBXBuildFile; fileRef = 6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */; };
6303C43C0CF45CC30000ECC8 /* VLCMediaListAspect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */; };
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
EF7311900CB5797B009473B4 /* VLCAudio.h in Headers */ = {isa = PBXBuildFile; fileRef = EF73118E0CB5797B009473B4 /* VLCAudio.h */; settings = {ATTRIBUTES = (Public, ); }; };
EF7311910CB5797B009473B4 /* VLCAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = EF73118F0CB5797B009473B4 /* VLCAudio.m */; };
......@@ -36,6 +38,8 @@
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
32DBCF5E0370ADEE00C91783 /* VLC_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLC_Prefix.pch; sourceTree = "<group>"; };
63030CC70CCA652C0088ECD1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.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>"; };
8DC2EF5B0486A6940098B216 /* VLC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VLC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
EF73118E0CB5797B009473B4 /* VLCAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCAudio.h; path = Public/VLCAudio.h; sourceTree = "<group>"; };
......@@ -122,6 +126,7 @@
EF78BD3D0CAEEFF600354E6E /* VLCLibrary.m */,
EF78BD3E0CAEEFF600354E6E /* VLCMedia.m */,
EF78BD410CAEEFF600354E6E /* VLCMediaList.m */,
6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */,
EF8BB8CF0CAFA8D80038A613 /* VLCMediaPlayer.m */,
EF78BD400CAEEFF600354E6E /* VLCMediaLibrary.m */,
EF78BD450CAEEFF600354E6E /* VLCVideoView.m */,
......@@ -173,6 +178,7 @@
EF78BD0E0CAEEEC300354E6E /* VLCLibrary.h */,
EF78BD130CAEEEE700354E6E /* VLCMedia.h */,
EF78BD160CAEEEE700354E6E /* VLCMediaList.h */,
6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */,
EF8BB8CE0CAFA8D80038A613 /* VLCMediaPlayer.h */,
EF78BD150CAEEEE700354E6E /* VLCMediaLibrary.h */,
EF78BD1A0CAEEEE700354E6E /* VLCVideoView.h */,
......@@ -200,6 +206,7 @@
EF8BB8D00CAFA8D80038A613 /* VLCMediaPlayer.h in Headers */,
EF7311900CB5797B009473B4 /* VLCAudio.h in Headers */,
EFD551DD0CC6DD720074CEE1 /* VLCLibVLCBridging.h in Headers */,
6303C43C0CF45CC30000ECC8 /* VLCMediaListAspect.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -233,10 +240,12 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "VLC" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* VLC */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8DC2EF4F0486A6940098B216 /* VLC */,
);
......@@ -283,6 +292,7 @@
EF78BEF40CAF07E500354E6E /* VLCVideoView.m in Sources */,
EF8BB8D10CAFA8D80038A613 /* VLCMediaPlayer.m in Sources */,
EF7311910CB5797B009473B4 /* VLCAudio.m in Sources */,
6303C43A0CF45CAE0000ECC8 /* VLCMediaListAspect.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
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