VLCMediaPlayer.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*****************************************************************************
  2. * VLCMediaPlayer.h: VLC.framework VLCMediaPlayer header
  3. *****************************************************************************
  4. * Copyright (C) 2007 Pierre d'Herbemont
  5. * Copyright (C) 2007 the VideoLAN team
  6. * $Id$
  7. *
  8. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  23. *****************************************************************************/
  24. #import <Cocoa/Cocoa.h>
  25. #import "VLCMedia.h"
  26. /* Notification Messages */
  27. extern NSString * VLCMediaPlayerTimeChanged;
  28. extern NSString * VLCMediaPlayerStateChanged;
  29. // TODO: Documentation
  30. typedef enum VLCMediaPlayerState
  31. {
  32. VLCMediaPlayerStateStopped, //< Player has stopped
  33. VLCMediaPlayerStateOpening, //< Stream is opening
  34. VLCMediaPlayerStateBuffering, //< Stream is buffering
  35. VLCMediaPlayerStateEnded, //< Stream has ended
  36. VLCMediaPlayerStateError, //< Player has generated an error
  37. VLCMediaPlayerStatePlaying, //< Stream is playing
  38. VLCMediaPlayerStatePaused //< Stream is paused
  39. } VLCMediaPlayerState;
  40. extern NSString *VLCMediaPlayerStateToString(VLCMediaPlayerState state);
  41. /**
  42. * Formal protocol declaration for playback delegates. Allows playback messages
  43. * to be trapped by delegated objects.
  44. */
  45. @protocol VLCMediaPlayerDelegate
  46. - (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
  47. - (void)mediaPlayerStateChanged:(NSNotification *)aNotification;
  48. @end
  49. // TODO: Should we use medialist_player or our own flavor of media player?
  50. @interface VLCMediaPlayer : NSObject
  51. {
  52. id delegate; //< Object delegate
  53. VLCVideoView *videoView;//< NSView instance where media is rendered to
  54. void *instance; // Internal
  55. VLCMedia *media; //< Current media being played
  56. }
  57. /* Initializers */
  58. - (id)initWithVideoView:(VLCVideoView *)aVideoView;
  59. /* Properties */
  60. - (void)setDelegate:(id)value;
  61. - (id)delegate;
  62. /* Video View Options */
  63. // TODO: Should be it's own object?
  64. // TODO: use VLCVideoView instead of NSView
  65. - (void)setVideoView:(VLCVideoView *)value;
  66. - (VLCVideoView *)videoView;
  67. - (void)setFullscreen:(BOOL)value;
  68. - (BOOL)fullscreen;
  69. - (void)setVideoAspectRatio:(char *)value;
  70. - (char *)videoAspectRatio;
  71. - (void)setVideoSubTitles:(int)value;
  72. - (int)videoSubTitles;
  73. - (void)setVideoCropGeometry:(char *)value;
  74. - (char *)videoCropGeometry;
  75. - (void)setVideoTeleText:(int)value;
  76. - (int)videoTeleText;
  77. - (void)setRate:(int)value;
  78. - (int)rate;
  79. /* Video Information */
  80. - (NSSize)videoSize;
  81. - (BOOL)hasVideoOut;
  82. - (float)framesPerSecond;
  83. /**
  84. * Sets the current position (or time) of the feed.
  85. * \param value New time to set the current position to. If time is [VLCTime nullTime], 0 is assumed.
  86. */
  87. - (void)setTime:(VLCTime *)value;
  88. /**
  89. * Returns the current position (or time) of the feed.
  90. * \return VLCTIme object with current time.
  91. */
  92. - (VLCTime *)time;
  93. - (void)setChapter:(int)value;
  94. - (int)chapter;
  95. - (int)countOfChapters;
  96. /* Audio Options */
  97. - (void)setAudioTrack:(int)value;
  98. - (int)audioTrack;
  99. - (int)countOfAudioTracks;
  100. - (void)setAudioChannel:(int)value;
  101. - (int)audioChannel;
  102. /* Media Options */
  103. - (void)setMedia:(VLCMedia *)value;
  104. - (VLCMedia *)media;
  105. /* Playback Operations */
  106. /**
  107. * Plays a media resource using the currently selected media controller (or
  108. * default controller. If feed was paused then the feed resumes at the position
  109. * it was paused in.
  110. * \return A Boolean determining whether the stream was played or not.
  111. */
  112. - (BOOL)play;
  113. /**
  114. * Toggle's the pause state of the feed.
  115. */
  116. - (void)pause;
  117. /**
  118. * Fast forwards through the feed at the standard 1x rate.
  119. */
  120. //- (void)fastForward;
  121. /**
  122. * Fast forwards through the feed at the rate specified.
  123. * \param rate Rate at which the feed should be fast forwarded.
  124. */
  125. //- (void)fastForwardAtRate:(int)rate;
  126. /**
  127. * Rewinds through the feed at the standard 1x rate.
  128. */
  129. //- (void)rewind;
  130. /**
  131. * Rewinds through the feed at the rate specified.
  132. * \param rate Rate at which the feed should be fast rewound.
  133. */
  134. //- (void)rewindAtRate:(int)rate;
  135. /* Playback Information */
  136. /**
  137. * Playback state flag identifying that the stream is currently playing.
  138. * \return TRUE if the feed is playing, FALSE if otherwise.
  139. */
  140. - (BOOL)isPlaying;
  141. /**
  142. * Playback state flag identifying wheather the stream will play.
  143. * \return TRUE if the feed is ready for playback, FALSE if otherwise.
  144. */
  145. - (BOOL)willPlay;
  146. /**
  147. * Playback's current state.
  148. * \see VLCMediaState
  149. */
  150. - (VLCMediaPlayerState)state;
  151. @end