MacOSX/Framework/VLCMediaPlayer.m: Implement Chapter and Audio selection. (Patch...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 25 Oct 2007 12:39:10 +0000 (12:39 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 25 Oct 2007 12:39:10 +0000 (12:39 +0000)
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m

index ee6dd51..2aa373c 100644 (file)
@@ -110,9 +110,14 @@ extern NSString *VLCMediaPlayerStateToString(VLCMediaPlayerState state);
  */
 - (VLCTime *)time;
 
+- (void)setChapter:(int)value;
+- (int)chapter;
+- (int)countOfChapters;
+
 /* Audio Options */
 - (void)setAudioTrack:(int)value;
 - (int)audioTrack;
+- (int)countOfAudioTracks;
 
 - (void)setAudioChannel:(int)value;
 - (int)audioChannel;
index da7be14..0f6a8d8 100644 (file)
@@ -296,6 +296,29 @@ NSString *VLCMediaPlayerStateToString(VLCMediaPlayerState state)
         return [VLCTime timeWithNumber:[NSNumber numberWithLongLong:time]];
 }
 
+- (void)setChapter:(int)value;
+{
+    libvlc_media_instance_set_chapter( instance, value, NULL );
+}
+
+- (int)chapter
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    int result = libvlc_media_instance_get_chapter( instance, &ex );
+    quit_on_exception( &ex );
+    return result;
+}
+
+- (int)countOfChapters
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    int result = libvlc_media_instance_get_chapter_count( instance, &ex );
+    quit_on_exception( &ex );
+    return result;
+}
+
 - (void)setAudioTrack:(int)value
 {
     libvlc_audio_set_track( instance, value, NULL );
@@ -310,6 +333,15 @@ NSString *VLCMediaPlayerStateToString(VLCMediaPlayerState state)
     return result;
 }
 
+- (int)countOfAudioTracks
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    int result = libvlc_audio_get_track_count( instance, &ex );
+    quit_on_exception( &ex );
+    return result;
+}
+
 - (void)setAudioChannel:(int)value
 {
     libvlc_audio_set_channel( instance, value, NULL );