Commit 6dda19c8 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework: Very minor identation changes.

parent 702edfe8
......@@ -29,8 +29,8 @@
@interface VLCMediaLibrary : NSObject
{
void *mlib;
VLCMediaList *allMedia;
void * mlib;
VLCMediaList * allMedia;
}
+ (id)sharedMediaLibrary;
......
......@@ -25,8 +25,8 @@
#import "VLCMedia.h"
/* Notification Messages */
extern NSString *VLCMediaListItemAdded;
extern NSString *VLCMediaListItemDeleted;
extern NSString * VLCMediaListItemAdded;
extern NSString * VLCMediaListItemDeleted;
@class VLCMedia;
@class VLCMediaList;
......@@ -59,7 +59,7 @@ extern NSString *VLCMediaListItemDeleted;
- (int)indexOfMedia:(VLCMedia *)media;
- (int)count;
#if 0 /* Disabled until this get fixed in libvlc
#if 0 /* Disabled until this get fixed in libvlc */
- (NSArray *)sublists; //< A way to see the same media list. Only sub media list.
- (NSArray *)flatMediaView; //< A way to see the same media list. Only media.
- (VLCMedia *)providerMedia; //< If a media was at the origin of this media list, here it is.
......
......@@ -26,8 +26,8 @@
#import "VLCMedia.h"
/* Notification Messages */
extern NSString *VLCMediaPlayerTimeChanged;
extern NSString *VLCMediaPlayerStateChanged;
extern NSString * VLCMediaPlayerTimeChanged;
extern NSString * VLCMediaPlayerStateChanged;
// TODO: Documentation
typedef enum VLCMediaPlayerState
......
......@@ -25,8 +25,8 @@
#import <Cocoa/Cocoa.h>
/* Notifications */
extern NSString *VLCVideoViewEnteredFullScreen;
extern NSString *VLCVideoViewLeftFullScreen;
extern NSString * VLCVideoViewEnteredFullScreen;
extern NSString * VLCVideoViewLeftFullScreen;
@protocol VLCVideoViewDelegate
// Notifications defined in VLCVideoView.h
......@@ -49,7 +49,7 @@ extern NSString *VLCVideoViewLeftFullScreen;
@interface VLCVideoView : NSView <VLCOpenGLVoutEmbedding>
{
id delegate;
NSColor *backColor;
NSColor * backColor;
BOOL stretchesVideo;
// TODO: Allow for view to report transparency to do some cool effects
......
......@@ -37,7 +37,7 @@ void __quit_on_exception( void * e, const char * function, const char * file, in
{
/* XXX: localization */
NSRunCriticalAlertPanel( @"Error", [NSString stringWithFormat:@"libvlc has thrown us an error: %s (%s:%d %s)",
libvlc_exception_get_message(ex), file, line_number, function], @"Quit", nil, nil );
libvlc_exception_get_message( ex ), file, line_number, function], @"Quit", nil, nil );
exit( ex->i_code );
}
}
......@@ -61,7 +61,7 @@ static void *DestroySharedLibraryAtExit()
[[self alloc] init];
// Register a function to gracefully destroy the shared library on exit.
atexit((void*)DestroySharedLibraryAtExit);
atexit( (void*)DestroySharedLibraryAtExit );
}
return sharedLibrary;
}
......@@ -79,8 +79,8 @@ static void *DestroySharedLibraryAtExit()
libvlc_exception_init( &ex );
// Figure out the frameworks path
char *applicationPath = strdup([[NSString stringWithFormat:@"%@/Versions/Current/VLC",
[[NSBundle bundleForClass:[VLCLibrary class]] bundlePath]] UTF8String]);
char *applicationPath = strdup( [[NSString stringWithFormat:@"%@/Versions/Current/VLC",
[[NSBundle bundleForClass:[VLCLibrary class]] bundlePath]] UTF8String] );
// TODO: Raise error if there is no memory available
char *lib_vlc_params[] = {
......@@ -89,7 +89,7 @@ static void *DestroySharedLibraryAtExit()
"--no-video-title-show", NULL
};
instance = (void *)libvlc_new(7, lib_vlc_params, &ex);
instance = (void *)libvlc_new( 7, lib_vlc_params, &ex );
quit_on_exception( &ex );
if (!sharedLibrary)
......@@ -99,7 +99,7 @@ static void *DestroySharedLibraryAtExit()
/*audio = */ [[VLCAudio alloc] initWithLibrary:self];
// free allocated resources
free(applicationPath);
free( applicationPath );
}
return self;
}
......@@ -114,9 +114,9 @@ static void *DestroySharedLibraryAtExit()
if (instance)
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_exception_init( &ex );
libvlc_destroy(instance, &ex);
libvlc_destroy( instance, &ex );
}
}
@finally
......
......@@ -219,7 +219,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
[subitems release];
[metaDictionary release];
libvlc_media_descriptor_release(p_md);
libvlc_media_descriptor_release( p_md );
[super dealloc];
}
......@@ -257,7 +257,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
if (!length)
{
// Try figuring out what the length is
long long duration = libvlc_media_descriptor_get_duration(p_md, NULL);
long long duration = libvlc_media_descriptor_get_duration( p_md, NULL );
if (duration > -1)
{
[self setLength:[VLCTime timeWithNumber:[NSNumber numberWithLongLong:duration]]];
......@@ -278,7 +278,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
{
while (!length && ![self isPreparsed] && [aDate timeIntervalSinceNow] > 0)
{
usleep(THREAD_SLEEP);
usleep( THREAD_SLEEP );
}
// So we're done waiting, but sometimes we trap the fact that the parsing
......@@ -294,7 +294,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
- (BOOL)isPreparsed
{
return libvlc_media_descriptor_is_preparsed(p_md, NULL);
return libvlc_media_descriptor_is_preparsed( p_md, NULL );
}
- (NSDictionary *)metaDictionary
......@@ -320,10 +320,10 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
libvlc_exception_t ex;
libvlc_exception_init( &ex );
VLCMedia *media = (VLCMedia *)libvlc_media_descriptor_get_user_data(md, &ex);
if (!media || libvlc_exception_raised(&ex))
VLCMedia *media = (VLCMedia *)libvlc_media_descriptor_get_user_data( md, &ex );
if (!media || libvlc_exception_raised( &ex ))
{
libvlc_exception_clear(&ex);
libvlc_exception_clear( &ex );
return [[[VLCMedia alloc] initWithLibVLCMediaDescriptor:md] autorelease];
}
else
......@@ -344,18 +344,18 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
{
return [self retain];
}
libvlc_exception_clear(&ex); // Just in case an exception was raised, lets release it
libvlc_exception_clear( &ex ); // Just in case an exception was raised, lets release it
if (self = [super init])
{
char * p_url;
p_url = libvlc_media_descriptor_get_mrl(md, &ex);
p_url = libvlc_media_descriptor_get_mrl( md, &ex );
quit_on_exception( &ex );
url = [NSString stringWithCString:p_url];
libvlc_media_descriptor_retain(md);
libvlc_media_descriptor_retain( md );
p_md = md;
[self initInternalMediaDescriptor];
......@@ -419,27 +419,27 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
- (void)initInternalMediaDescriptor
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_media_descriptor_set_user_data(p_md, (void*)self, &ex);
quit_on_exception(&ex);
libvlc_exception_init( &ex );
libvlc_media_descriptor_set_user_data( p_md, (void*)self, &ex );
quit_on_exception( &ex );
// TODO: Should these events be caught by VLCMediaList's notification hooks?
libvlc_event_manager_t *p_em = libvlc_media_descriptor_event_manager(p_md, &ex);
libvlc_event_manager_t *p_em = libvlc_media_descriptor_event_manager( p_md, &ex );
// libvlc_event_attach(p_em, libvlc_MediaDescriptorSubItemAdded, HandleMediaSubItemAdded, self, &ex);
// libvlc_event_attach(p_em, libvlc_MediaDescriptorSubItemRemoved, HandleMediaSubItemRemoved, self, &ex);
// libvlc_event_attach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, &ex);
// libvlc_event_attach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex);
quit_on_exception(&ex);
quit_on_exception( &ex );
libvlc_media_list_t *p_mlist = libvlc_media_descriptor_subitems(p_md, NULL);
libvlc_media_list_t *p_mlist = libvlc_media_descriptor_subitems( p_md, NULL );
if (!p_mlist)
subitems = nil;
else
{
[subitems release];
subitems = [[VLCMediaList medialistWithLibVLCMediaList:p_mlist] retain];
libvlc_media_list_release(p_mlist);
libvlc_media_list_release( p_mlist );
}
[self fetchMetaInformation];
}
......@@ -471,7 +471,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
}
result = YES;
}
free(value);
free( value );
return result;
}
......@@ -480,9 +480,9 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
// TODO: Only fetch meta data that has been requested. Just don't fetch
// it, just because.
[self setMetaValue:libvlc_media_descriptor_get_meta(p_md, libvlc_meta_Title, NULL) forKey:[VLCMedia metaTypeToString:libvlc_meta_Title]];
[self setMetaValue:libvlc_media_descriptor_get_meta(p_md, libvlc_meta_Artist, NULL) forKey:[VLCMedia metaTypeToString:libvlc_meta_Artist]];
[self setMetaValue:libvlc_media_descriptor_get_meta(p_md, libvlc_meta_ArtworkURL, NULL) forKey:[VLCMedia metaTypeToString:libvlc_meta_ArtworkURL]];
[self setMetaValue:libvlc_media_descriptor_get_meta( p_md, libvlc_meta_Title, NULL ) forKey:[VLCMedia metaTypeToString:libvlc_meta_Title]];
[self setMetaValue:libvlc_media_descriptor_get_meta( p_md, libvlc_meta_Artist, NULL ) forKey:[VLCMedia metaTypeToString:libvlc_meta_Artist]];
[self setMetaValue:libvlc_media_descriptor_get_meta( p_md, libvlc_meta_ArtworkURL, NULL ) forKey:[VLCMedia metaTypeToString:libvlc_meta_ArtworkURL]];
}
- (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL
......
......@@ -84,7 +84,7 @@ static VLCMediaLibrary * sharedMediaLibrary = nil;
{
libvlc_media_list_t *p_mlist = libvlc_media_library_media_list( mlib, NULL );
VLCMediaList *medialist = [VLCMediaList medialistWithLibVLCMediaList:p_mlist];
libvlc_media_list_release(p_mlist);
libvlc_media_list_release( p_mlist );
NSArray *ret = [medialist sublists];
return ret;
......
......@@ -124,12 +124,12 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
- (void)lock
{
libvlc_media_list_lock(p_mlist);
libvlc_media_list_lock( p_mlist );
}
- (void)unlock
{
libvlc_media_list_unlock(p_mlist);
libvlc_media_list_unlock( p_mlist );
}
- (int)addMedia:(VLCMedia *)media
......@@ -146,8 +146,8 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Add it to the libvlc's medialist
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
libvlc_media_list_insert_media_descriptor(p_mlist, [media libVLCMediaDescriptor], index, &p_e);
quit_on_exception(&p_e);
libvlc_media_list_insert_media_descriptor( p_mlist, [media libVLCMediaDescriptor], index, &p_e );
quit_on_exception( &p_e );
}
- (void)removeMediaAtIndex:(int)index
......@@ -156,17 +156,17 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Remove it from the libvlc's medialist
libvlc_exception_t p_e;
libvlc_exception_init(&p_e);
libvlc_media_list_remove_index(p_mlist, index, &p_e);
quit_on_exception(&p_e);
libvlc_exception_init( &p_e );
libvlc_media_list_remove_index( p_mlist, index, &p_e );
quit_on_exception( &p_e );
}
- (VLCMedia *)mediaAtIndex:(int)index
{
libvlc_exception_t p_e;
libvlc_exception_init(&p_e);
libvlc_media_descriptor_t *p_md = libvlc_media_list_item_at_index(p_mlist, index, &p_e);
quit_on_exception(&p_e);
libvlc_exception_init( &p_e );
libvlc_media_descriptor_t *p_md = libvlc_media_list_item_at_index( p_mlist, 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.
......@@ -176,9 +176,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
- (int)count
{
libvlc_exception_t p_e;
libvlc_exception_init(&p_e);
int result = libvlc_media_list_count(p_mlist, &p_e);
quit_on_exception(&p_e);
libvlc_exception_init( &p_e );
int result = libvlc_media_list_count( p_mlist, &p_e );
quit_on_exception( &p_e );
return result;
}
......@@ -186,9 +186,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
- (int)indexOfMedia:(VLCMedia *)media
{
libvlc_exception_t p_e;
libvlc_exception_init(&p_e);
int result = libvlc_media_list_index_of_item(p_mlist, [media libVLCMediaDescriptor], &p_e);
quit_on_exception(&p_e);
libvlc_exception_init( &p_e );
int result = libvlc_media_list_index_of_item( p_mlist, [media libVLCMediaDescriptor], &p_e );
quit_on_exception( &p_e );
return result;
}
......@@ -199,22 +199,22 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
int i, count;
libvlc_exception_t p_e;
libvlc_exception_init(&p_e);
count = libvlc_media_list_count(p_mlist, &p_e);
quit_on_exception(&p_e);
libvlc_exception_init( &p_e );
count = libvlc_media_list_count( p_mlist, &p_e );
quit_on_exception( &p_e );
for(i = 0; i < count; i++)
{
libvlc_media_descriptor_t *p_md;
libvlc_media_list_t *p_submlist;
p_md = libvlc_media_list_item_at_index(p_mlist, i, NULL);
p_submlist = libvlc_media_descriptor_subitems(p_md, NULL);
if(p_submlist)
p_md = libvlc_media_list_item_at_index( p_mlist, i, NULL );
p_submlist = libvlc_media_descriptor_subitems( p_md, NULL );
if (p_submlist)
{
[ret addObject:[VLCMediaList medialistWithLibVLCMediaList:p_submlist]];
libvlc_media_list_release(p_submlist);
libvlc_media_list_release( p_submlist );
}
libvlc_media_descriptor_release(p_md);
libvlc_media_descriptor_release( p_md );
}
return [ret autorelease];
}
......@@ -275,9 +275,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
libvlc_exception_t p_e;
libvlc_exception_init(&p_e);
libvlc_event_manager_t *p_em = libvlc_media_list_event_manager(p_mlist, &p_e);
libvlc_event_attach(p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self, &p_e);
libvlc_event_attach(p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self, &p_e);
libvlc_event_manager_t *p_em = libvlc_media_list_event_manager( p_mlist, &p_e );
libvlc_event_attach( p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self, &p_e );
libvlc_event_attach( p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self, &p_e );
[self unlock];
quit_on_exception( &p_e );
......
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