From: Felix Paul Kühne Date: Sun, 20 Dec 2009 12:41:58 +0000 (+0100) Subject: osx/framework: extended API to cover titles, fps, playback modes and some convienienc... X-Git-Tag: 1.1.0-ff~1890 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5203cf9acca84a550deacc9661f9d3d79fd270fe;p=vlc osx/framework: extended API to cover titles, fps, playback modes and some convienience chapter functionality Additionally, updated some copyright information. --- diff --git a/projects/macosx/framework/Headers/Public/VLCAudio.h b/projects/macosx/framework/Headers/Public/VLCAudio.h index 0df81ca55b..e291d4c592 100644 --- a/projects/macosx/framework/Headers/Public/VLCAudio.h +++ b/projects/macosx/framework/Headers/Public/VLCAudio.h @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import - /* Notification Messages */ /** * Standard notification messages that are emitted by VLCAudio object. diff --git a/projects/macosx/framework/Headers/Public/VLCLibrary.h b/projects/macosx/framework/Headers/Public/VLCLibrary.h index 82cadadd2a..e2e3a3e074 100644 --- a/projects/macosx/framework/Headers/Public/VLCLibrary.h +++ b/projects/macosx/framework/Headers/Public/VLCLibrary.h @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import "VLCAudio.h" #import "VLCMediaList.h" #import "VLCMedia.h" diff --git a/projects/macosx/framework/Headers/Public/VLCMedia.h b/projects/macosx/framework/Headers/Public/VLCMedia.h index 030275824c..84d778f8b3 100644 --- a/projects/macosx/framework/Headers/Public/VLCMedia.h +++ b/projects/macosx/framework/Headers/Public/VLCMedia.h @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import "VLCMediaList.h" #import "VLCTime.h" diff --git a/projects/macosx/framework/Headers/Public/VLCMediaDiscoverer.h b/projects/macosx/framework/Headers/Public/VLCMediaDiscoverer.h index 2122ef9e61..378441a734 100644 --- a/projects/macosx/framework/Headers/Public/VLCMediaDiscoverer.h +++ b/projects/macosx/framework/Headers/Public/VLCMediaDiscoverer.h @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import @class VLCMediaList; diff --git a/projects/macosx/framework/Headers/Public/VLCMediaLibrary.h b/projects/macosx/framework/Headers/Public/VLCMediaLibrary.h index 285207c89c..7ce9219d04 100644 --- a/projects/macosx/framework/Headers/Public/VLCMediaLibrary.h +++ b/projects/macosx/framework/Headers/Public/VLCMediaLibrary.h @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import "VLCMediaList.h" @class VLCMediaList; diff --git a/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h b/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h index 8bf30c57cc..17f3917683 100644 --- a/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h +++ b/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h @@ -1,10 +1,28 @@ -// -// VLCMediaListPlayer.h -// VLCKit -// -// Created by Pierre d'Herbemont on 8/24/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// +/***************************************************************************** + * VLCMediaListPlayer.m: VLCKit.framework VLCMediaListPlayer implementation + ***************************************************************************** + * Copyright (C) 2009 Pierre d'Herbemont + * Partial Copyright (C) 2009 Felix Paul Kühne + * Copyright (C) 2009 the VideoLAN team + * $Id$ + * + * Authors: Pierre d'Herbemont + * Felix Paul Kühne + * Felix Paul Kühne * * 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 @@ -22,7 +24,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import "VLCMedia.h" #import "VLCVideoView.h" #import "VLCVideoLayer.h" @@ -155,11 +156,16 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state); - (VLCTime *)time; @property (readonly) VLCTime *remainingTime; +@property (readonly) int fps; - (void)setChapter:(int)value; - (int)chapter; - (int)countOfChapters; +- (void)setTitle:(int)value; +- (int)title; +- (int)countOfTitles; + /* Audio Options */ - (void)setAudioTrack:(int)value; - (int)audioTrack; diff --git a/projects/macosx/framework/Headers/Public/VLCServicesDiscoverer.h b/projects/macosx/framework/Headers/Public/VLCServicesDiscoverer.h index ebd439b0e4..437f487dea 100644 --- a/projects/macosx/framework/Headers/Public/VLCServicesDiscoverer.h +++ b/projects/macosx/framework/Headers/Public/VLCServicesDiscoverer.h @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import - @interface VLCServicesDiscoverer : NSObject { NSArray * services; diff --git a/projects/macosx/framework/Headers/Public/VLCStreamOutput.h b/projects/macosx/framework/Headers/Public/VLCStreamOutput.h index 63f467f03d..ab1d5e37fb 100644 --- a/projects/macosx/framework/Headers/Public/VLCStreamOutput.h +++ b/projects/macosx/framework/Headers/Public/VLCStreamOutput.h @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import - extern NSString * VLCDefaultStreamOutputRTSP; extern NSString * VLCDefaultStreamOutputRTP; extern NSString * VLCDefaultStreamOutputRTP; diff --git a/projects/macosx/framework/Headers/Public/VLCStreamSession.h b/projects/macosx/framework/Headers/Public/VLCStreamSession.h index 669d92b562..71fc87ea0e 100644 --- a/projects/macosx/framework/Headers/Public/VLCStreamSession.h +++ b/projects/macosx/framework/Headers/Public/VLCStreamSession.h @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import #import #import diff --git a/projects/macosx/framework/Headers/Public/VLCTime.h b/projects/macosx/framework/Headers/Public/VLCTime.h index 69e885175d..56e9929644 100644 --- a/projects/macosx/framework/Headers/Public/VLCTime.h +++ b/projects/macosx/framework/Headers/Public/VLCTime.h @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import - /** * Provides an object to define VLCMedia's time. */ diff --git a/projects/macosx/framework/Headers/Public/VLCVideoView.h b/projects/macosx/framework/Headers/Public/VLCVideoView.h index 2f76be1387..bc8baf319e 100644 --- a/projects/macosx/framework/Headers/Public/VLCVideoView.h +++ b/projects/macosx/framework/Headers/Public/VLCVideoView.h @@ -22,7 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#import #import @interface VLCVideoView : NSView diff --git a/projects/macosx/framework/Sources/VLCMediaListPlayer.m b/projects/macosx/framework/Sources/VLCMediaListPlayer.m index 5ff85255a2..f83af7719a 100644 --- a/projects/macosx/framework/Sources/VLCMediaListPlayer.m +++ b/projects/macosx/framework/Sources/VLCMediaListPlayer.m @@ -1,10 +1,28 @@ -// -// VLCMediaListPlayer.m -// VLCKit -// -// Created by Pierre d'Herbemont on 8/24/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// +/***************************************************************************** + * VLCMediaListPlayer.m: VLCKit.framework VLCMediaListPlayer implementation + ***************************************************************************** + * Copyright (C) 2009 Pierre d'Herbemont + * Partial Copyright (C) 2009 Felix Paul Kühne + * Copyright (C) 2009 the VideoLAN team + * $Id$ + * + * Authors: Pierre d'Herbemont + * Felix Paul Kühne * Faustion Osuna + * Felix Paul Kühne * * 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 @@ -399,9 +401,21 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * return [VLCTime timeWithNumber:[NSNumber numberWithDouble:-remaining]]; } +- (int)fps +{ + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + int result = libvlc_media_player_get_fps( instance, &ex ); + catch_exception( &ex ); + return result; +} + - (void)setChapter:(int)value; { - libvlc_media_player_set_chapter( instance, value, NULL ); + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + libvlc_media_player_set_chapter( instance, value, &ex ); + catch_exception( &ex ); } - (int)chapter @@ -422,6 +436,48 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * return result; } +- (void)nextChapter +{ + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + libvlc_media_player_next_chapter( instance, &ex ); + catch_exception( &ex ); +} + +- (void)previousChapter +{ + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + libvlc_media_player_previous_chapter( instance, &ex ); + catch_exception( &ex ); +} + +- (void)setTitle:(int)value +{ + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + libvlc_media_player_set_title( instance, value, &ex ); + catch_exception( &ex ); +} + +- (int)title +{ + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + int result = libvlc_media_player_get_title( instance, &ex ); + catch_exception( &ex ); + return result; +} + +- (int)countOfTitles +{ + libvlc_exception_t ex; + libvlc_exception_init( &ex ); + int result = libvlc_media_player_get_title_count( instance, &ex ); + catch_exception( &ex ); + return result; +} + - (void)setAudioTrack:(int)value { libvlc_audio_set_track( instance, value, NULL );