]> git.sesse.net Git - vlc/commitdiff
osx/framework: extended API to cover titles, fps, playback modes and some convienienc...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 20 Dec 2009 12:41:58 +0000 (13:41 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 20 Dec 2009 12:42:20 +0000 (13:42 +0100)
Additionally, updated some copyright information.

14 files changed:
projects/macosx/framework/Headers/Public/VLCAudio.h
projects/macosx/framework/Headers/Public/VLCLibrary.h
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Headers/Public/VLCMediaDiscoverer.h
projects/macosx/framework/Headers/Public/VLCMediaLibrary.h
projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Headers/Public/VLCServicesDiscoverer.h
projects/macosx/framework/Headers/Public/VLCStreamOutput.h
projects/macosx/framework/Headers/Public/VLCStreamSession.h
projects/macosx/framework/Headers/Public/VLCTime.h
projects/macosx/framework/Headers/Public/VLCVideoView.h
projects/macosx/framework/Sources/VLCMediaListPlayer.m
projects/macosx/framework/Sources/VLCMediaPlayer.m

index 0df81ca55bfcf1c36abdd6456af13a9addf56db6..e291d4c5922f84d5098bb2549707a0d91ac19d68 100644 (file)
@@ -22,8 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
-
 /* Notification Messages */
 /**
  * Standard notification messages that are emitted by VLCAudio object.
index 82cadadd2aa3528c573b17a3d45fb0e144092cb9..e2e3a3e07434513ef08aa5891e2765bbbd527a62 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #import "VLCAudio.h"
 #import "VLCMediaList.h"
 #import "VLCMedia.h"
index 030275824c25c9b9c7b90cd2b9c3979d9597d1cc..84d778f8b36ebafb048fa6970e64dbe3fe389c2a 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #import "VLCMediaList.h"
 #import "VLCTime.h"
 
index 2122ef9e61194c603e90a0485cc7201ac649f0e7..378441a734e8c7ec55d9a4ecc8d938c732c1ea30 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #import <VLCKit/VLCMediaList.h>
 
 @class VLCMediaList;
index 285207c89cd22732e497d6abed702a801c084f7b..7ce9219d04e5fe06d095172de53059ca1daa71de 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #import "VLCMediaList.h"
 
 @class VLCMediaList;
index 8bf30c57ccc2897c0b61b4f09b493ff937a801f9..17f3917683dc94ef345240b53102d5e1b30f720b 100644 (file)
@@ -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 <pdherbemont # videolan.org>
+ *          Felix Paul Kühne <fkuehne # 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.
+ *****************************************************************************/
 
 @class VLCMedia, VLCMediaPlayer, VLCMediaList;
 
 - (void)play;
 - (void)stop;
 
+/**
+ * Playmode selection (don't repeat anything, repeat one, repeat all)
+ */
+- (void)doNotRepeatAnyItem;
+- (void)repeatCurrentItem;
+- (void)repeatAllItems;
+
 /**
  * media must be in the current media list.
  */
index 6112f4727dabf01951134772e7a591a11501c53b..e95124c4fd9cacf06359308864adba0f53708102 100644 (file)
@@ -1,11 +1,13 @@
 /*****************************************************************************
  * VLCMediaPlayer.h: VLCKit.framework VLCMediaPlayer header
  *****************************************************************************
- * Copyright (C) 2007 Pierre d'Herbemont
- * Copyright (C) 2007 the VideoLAN team
+ * Copyright (C) 2007-2009 Pierre d'Herbemont
+ * Copyright (C) 2007-2009 the VideoLAN team
+ * Partial Copyright (C) 2009 Felix Paul Kühne
  * $Id$
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
+ *          Felix Paul Kühne <fkuehne # 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
@@ -22,7 +24,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #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;
index ebd439b0e48f478a554cb5e3400012f9ade7e035..437f487dead205b4f4cd9861c194311dea289bc9 100644 (file)
@@ -22,8 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
-
 @interface VLCServicesDiscoverer : NSObject
 {
     NSArray * services;
index 63f467f03da537a2961bed5691473a921c15a75c..ab1d5e37fb20eae05ea0c5d12d1b57e7883aa6f3 100644 (file)
@@ -22,8 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
-
 extern NSString * VLCDefaultStreamOutputRTSP;
 extern NSString * VLCDefaultStreamOutputRTP;
 extern NSString * VLCDefaultStreamOutputRTP;
index 669d92b5621ad19f086897f4dcb98657711e37d3..71fc87ea0ea52f1e3e236b82ee2996638f86033a 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #import <VLCKit/VLCStreamOutput.h>
 #import <VLCKit/VLCMediaPlayer.h>
 #import <VLCKit/VLCMedia.h>
index 69e885175dab048afa368c3a7be7654a76c7f627..56e9929644e22e9550b6c625dc1dc8180e3fdb5b 100644 (file)
@@ -22,8 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
-
 /**
  * Provides an object to define VLCMedia's time.
  */
index 2f76be13874004c90bcd3d375e9dd4c9f779375d..bc8baf319efcb47aea61a5c435782e6a702e7f7c 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <Cocoa/Cocoa.h>
 #import <QuartzCore/QuartzCore.h>
 
 @interface VLCVideoView : NSView
index 5ff85255a28ab123dbb8147722119229fe4d73ce..f83af7719a4fa580bf184cfdc6fb828c4c97705e 100644 (file)
@@ -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 <pdherbemont # videolan.org>
+ *          Felix Paul Kühne <fkuehne # 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 "VLCMediaListPlayer.h"
 #import "VLCMedia.h"
     libvlc_exception_t ex;
     libvlc_exception_init(&ex);
     libvlc_media_list_player_play_item(instance, [media libVLCMediaDescriptor], &ex);
-    catch_exception(&ex);    
+    catch_exception(&ex);
 }
 
 - (void)play
     libvlc_exception_t ex;
     libvlc_exception_init(&ex);
     libvlc_media_list_player_play(instance, &ex);
-    catch_exception(&ex);    
+    catch_exception(&ex);
 }
 
 - (void)stop
     libvlc_exception_t ex;
     libvlc_exception_init(&ex);
     libvlc_media_list_player_stop(instance, &ex);
-    catch_exception(&ex);        
+    catch_exception(&ex);
+}
+
+- (void)doNotRepeatAnyItem;
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init(&ex);
+    libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
+    catch_exception(&ex);
+}
+
+- (void)repeatCurrentItem
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init(&ex);
+    libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_repeat, &ex);
+    catch_exception(&ex);
+}
+
+- (void)repeatAllItems
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init(&ex);
+    libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_loop, &ex);
+    catch_exception(&ex);
 }
 @end
index 59095950dc0b4916b8eb22f28eb1d0786d412de2..662e35e137acc0e1c93dece0c6332e792b476237 100644 (file)
@@ -1,12 +1,14 @@
 /*****************************************************************************
  * VLCMediaPlayer.m: VLCKit.framework VLCMediaPlayer implementation
  *****************************************************************************
- * Copyright (C) 2007 Pierre d'Herbemont
- * Copyright (C) 2007 the VideoLAN team
+ * Copyright (C) 2007-2009 Pierre d'Herbemont
+ * Copyright (C) 2007-2009 the VideoLAN team
+ * Partial Copyright (C) 2009 Felix Paul Kühne
  * $Id$
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  *          Faustion Osuna <enrique.osuna # gmail.com>
+ *          Felix Paul Kühne <fkuehne # 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
@@ -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 );