Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

mediacontrol-core.h

00001 #ifndef __mediacontrol_core_h
00002 
00003 #define __mediacontrol_core_h
00004 
00005 #ifndef __VLC__
00006 #define __VLC__
00007 #endif
00008 #include <vlc/vlc.h>
00009 
00010 /************************************************************************
00011  * Position Object Manipulation
00012  *************************************************************************/
00013 typedef enum  {
00014   mediacontrol_AbsolutePosition,
00015   mediacontrol_RelativePosition,
00016   mediacontrol_ModuloPosition
00017 } mediacontrol_PositionOrigin;
00018 
00019 typedef enum {
00020   mediacontrol_ByteCount,
00021   mediacontrol_SampleCount,
00022   mediacontrol_MediaTime
00023 } mediacontrol_PositionKey;
00024 
00025 typedef struct {
00026   mediacontrol_PositionOrigin origin;
00027   mediacontrol_PositionKey key;
00028   long value;
00029 } mediacontrol_Position;
00030 
00031 typedef struct {
00032   int  width;
00033   int  height;
00034   long type;
00035   long long date;
00036   int  size;
00037   char* data;
00038 } mediacontrol_RGBPicture;
00039 
00040 typedef struct {
00041   int size;
00042   char** data;
00043 } mediacontrol_PlaylistSeq;
00044 
00045 typedef struct {
00046   int code;
00047   char* message;
00048 } mediacontrol_Exception;
00049 
00050 /* Exception codes */
00051 #define mediacontrol_PositionKeyNotSupported    1
00052 #define mediacontrol_PositionOriginNotSupported 2
00053 #define mediacontrol_InvalidPosition            3
00054 #define mediacontrol_PlaylistException          4
00055 #define mediacontrol_InternalException          5
00056 
00057 typedef struct {
00058   vlc_object_t  *p_vlc;
00059   playlist_t    *p_playlist;
00060   intf_thread_t *p_intf;
00061   int           vlc_object_id;
00062 } mediacontrol_Instance;
00063 
00064 /* Cf stream_control.h */
00065 enum mediacontrol_PlayerStatusList
00066   { 
00067     mediacontrol_PlayingStatus, mediacontrol_PauseStatus, 
00068     mediacontrol_ForwardStatus, mediacontrol_BackwardStatus, 
00069     mediacontrol_InitStatus,    mediacontrol_EndStatus, 
00070     mediacontrol_UndefinedStatus 
00071   };
00072 typedef enum mediacontrol_PlayerStatusList mediacontrol_PlayerStatus;
00073 
00074 typedef struct {
00075     mediacontrol_PlayerStatus streamstatus;
00076     char* url;         /* The URL of the current media stream */
00077     long long position;     /* actual location in the stream (in ms) */
00078     long long length;         /* total length of the stream (in ms) */
00079   } mediacontrol_StreamInformation;
00080 
00081 /* Helper functions */
00082 long long mediacontrol_unit_convert (input_thread_t *p_input,
00083                                      mediacontrol_PositionKey from,
00084                                      mediacontrol_PositionKey to,
00085                                      long long value);
00086 long long
00087 mediacontrol_position2microsecond (input_thread_t* p_input, const mediacontrol_Position * pos);
00088 
00089 mediacontrol_RGBPicture* mediacontrol_RGBPicture__alloc (int datasize);
00090 void mediacontrol_RGBPicture__free (mediacontrol_RGBPicture* pic);
00091 mediacontrol_PlaylistSeq* mediacontrol_PlaylistSeq__alloc (int size);
00092 void mediacontrol_PlaylistSeq__free (mediacontrol_PlaylistSeq* ps);
00093 
00094 mediacontrol_Exception* mediacontrol_exception_init(mediacontrol_Exception *exception);
00095 void mediacontrol_exception_free(mediacontrol_Exception *exception);
00096 
00097 mediacontrol_Instance* mediacontrol_new(char** args, mediacontrol_Exception *exception);
00098 mediacontrol_Instance* mediacontrol_new_from_object(vlc_object_t* p_object,
00099                                                     mediacontrol_Exception *exception);
00100 mediacontrol_Position* mediacontrol_get_media_position(mediacontrol_Instance *self,
00101                                                        mediacontrol_PositionOrigin an_origin,
00102                                                        mediacontrol_PositionKey a_key,
00103                                                        mediacontrol_Exception *exception);
00104 void mediacontrol_set_media_position(mediacontrol_Instance *self,
00105                                      const mediacontrol_Position* a_position, 
00106                                      mediacontrol_Exception *exception);
00107 void mediacontrol_start(mediacontrol_Instance *self,
00108                         const mediacontrol_Position* a_position, 
00109                         mediacontrol_Exception *exception);
00110 void mediacontrol_pause(mediacontrol_Instance *self,
00111                         const mediacontrol_Position* a_position, 
00112                         mediacontrol_Exception *exception);
00113 void mediacontrol_resume(mediacontrol_Instance *self,
00114                          const mediacontrol_Position* a_position,
00115                          mediacontrol_Exception *exception);
00116 void mediacontrol_stop(mediacontrol_Instance *self,
00117                        const mediacontrol_Position* a_position,
00118                        mediacontrol_Exception *exception);
00119 void mediacontrol_exit(mediacontrol_Instance *self);
00120 
00121 void mediacontrol_playlist_add_item (mediacontrol_Instance *self,
00122                                      const char* psz_file,
00123                                      mediacontrol_Exception *exception);
00124 void mediacontrol_playlist_clear (mediacontrol_Instance *self,
00125                                   mediacontrol_Exception *exception);
00126 mediacontrol_PlaylistSeq* mediacontrol_playlist_get_list (mediacontrol_Instance *self,
00127                                                           mediacontrol_Exception *exception);
00128 
00129 mediacontrol_RGBPicture* mediacontrol_snapshot (mediacontrol_Instance *self,
00130                                                 const mediacontrol_Position* a_position,
00131                                                 mediacontrol_Exception *exception);
00132 /* Return a NULL terminated list */
00133 mediacontrol_RGBPicture** mediacontrol_all_snapshots (mediacontrol_Instance *self,
00134                                                       mediacontrol_Exception *exception);
00135 
00136 // Displays the message string, between "begin" and "end" positions
00137 void mediacontrol_display_text (mediacontrol_Instance *self,
00138                                 const char* message, 
00139                                 const mediacontrol_Position* begin, 
00140                                 const mediacontrol_Position* end,
00141                                 mediacontrol_Exception *exception);
00142 
00143 mediacontrol_StreamInformation* 
00144 mediacontrol_get_stream_information(mediacontrol_Instance* self,
00145                                     mediacontrol_PositionKey a_key,
00146                                     mediacontrol_Exception *exception);
00147 
00148 unsigned short mediacontrol_sound_get_volume(mediacontrol_Instance* self,
00149                                              mediacontrol_Exception *exception);
00150 void mediacontrol_sound_set_volume(mediacontrol_Instance* self,
00151                                    const unsigned short volume,
00152                                    mediacontrol_Exception *exception);
00153 
00154 #endif
00155 

Generated on Tue Dec 20 10:14:30 2005 for vlc-0.8.4a by  doxygen 1.4.2