00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _VLC_CONTROL_H
00025 #define _VLC_CONTROL_H 1
00026
00027 # ifdef __cplusplus
00028 extern "C" {
00029 # endif
00030
00031 #include <vlc/vlc.h>
00032
00033 #if defined( WIN32 )
00034 #define WINDOWHANDLE HWND
00035 #else
00036 #define WINDOWHANDLE int
00037 #endif
00038
00039
00040
00041
00042 typedef enum {
00043 mediacontrol_AbsolutePosition,
00044 mediacontrol_RelativePosition,
00045 mediacontrol_ModuloPosition
00046 } mediacontrol_PositionOrigin;
00047
00048 typedef enum {
00049 mediacontrol_ByteCount,
00050 mediacontrol_SampleCount,
00051 mediacontrol_MediaTime
00052 } mediacontrol_PositionKey;
00053
00054 typedef struct {
00055 mediacontrol_PositionOrigin origin;
00056 mediacontrol_PositionKey key;
00057 long value;
00058 } mediacontrol_Position;
00059
00060 typedef struct {
00061 int width;
00062 int height;
00063 long type;
00064 vlc_int64_t date;
00065 int size;
00066 char *data;
00067 } mediacontrol_RGBPicture;
00068
00069 typedef struct {
00070 int size;
00071 char **data;
00072 } mediacontrol_PlaylistSeq;
00073
00074 typedef struct {
00075 int code;
00076 char *message;
00077 } mediacontrol_Exception;
00078
00079
00080 #define mediacontrol_PositionKeyNotSupported 1
00081 #define mediacontrol_PositionOriginNotSupported 2
00082 #define mediacontrol_InvalidPosition 3
00083 #define mediacontrol_PlaylistException 4
00084 #define mediacontrol_InternalException 5
00085
00086 typedef struct {
00087 vlc_object_t *p_vlc;
00088 playlist_t *p_playlist;
00089 intf_thread_t *p_intf;
00090 int vlc_object_id;
00091 } mediacontrol_Instance;
00092
00093
00094 enum mediacontrol_PlayerStatusList
00095 {
00096 mediacontrol_PlayingStatus, mediacontrol_PauseStatus,
00097 mediacontrol_ForwardStatus, mediacontrol_BackwardStatus,
00098 mediacontrol_InitStatus, mediacontrol_EndStatus,
00099 mediacontrol_UndefinedStatus
00100 };
00101 typedef enum mediacontrol_PlayerStatusList mediacontrol_PlayerStatus;
00102
00103 typedef struct {
00104 mediacontrol_PlayerStatus streamstatus;
00105 char *url;
00106 vlc_int64_t position;
00107 vlc_int64_t length;
00108 } mediacontrol_StreamInformation;
00109
00110
00111
00112
00113 vlc_int64_t mediacontrol_unit_convert( input_thread_t *p_input,
00114 mediacontrol_PositionKey from,
00115 mediacontrol_PositionKey to,
00116 vlc_int64_t value );
00117 vlc_int64_t mediacontrol_position2microsecond(
00118 input_thread_t *p_input,
00119 const mediacontrol_Position *pos );
00120
00121 mediacontrol_RGBPicture *mediacontrol_RGBPicture__alloc( int datasize );
00122
00123 void mediacontrol_RGBPicture__free( mediacontrol_RGBPicture *pic );
00124
00125 mediacontrol_RGBPicture *
00126 _mediacontrol_createRGBPicture( int, int, long, vlc_int64_t l_date,
00127 char *, int);
00128
00129 mediacontrol_PlaylistSeq *mediacontrol_PlaylistSeq__alloc( int size );
00130
00131 void mediacontrol_PlaylistSeq__free( mediacontrol_PlaylistSeq *ps );
00132
00133 mediacontrol_Exception *
00134 mediacontrol_exception_init( mediacontrol_Exception *exception );
00135
00136 void mediacontrol_exception_free(mediacontrol_Exception *exception);
00137
00138
00139
00140
00141 mediacontrol_Instance *
00142 mediacontrol_new( char **args, mediacontrol_Exception *exception );
00143
00144 mediacontrol_Instance *
00145 mediacontrol_new_from_object( vlc_object_t *p_object,
00146 mediacontrol_Exception *exception );
00147
00148 mediacontrol_Position *
00149 mediacontrol_get_media_position(
00150 mediacontrol_Instance *self,
00151 const mediacontrol_PositionOrigin an_origin,
00152 const mediacontrol_PositionKey a_key,
00153 mediacontrol_Exception *exception );
00154
00155 void mediacontrol_set_media_position( mediacontrol_Instance *self,
00156 const mediacontrol_Position *a_position,
00157 mediacontrol_Exception *exception );
00158
00159 void mediacontrol_start( mediacontrol_Instance *self,
00160 const mediacontrol_Position *a_position,
00161 mediacontrol_Exception *exception );
00162
00163 void mediacontrol_pause( mediacontrol_Instance *self,
00164 const mediacontrol_Position *a_position,
00165 mediacontrol_Exception *exception );
00166
00167 void mediacontrol_resume( mediacontrol_Instance *self,
00168 const mediacontrol_Position *a_position,
00169 mediacontrol_Exception *exception );
00170
00171 void mediacontrol_stop( mediacontrol_Instance *self,
00172 const mediacontrol_Position *a_position,
00173 mediacontrol_Exception *exception );
00174
00175 void mediacontrol_exit( mediacontrol_Instance *self );
00176
00177 void mediacontrol_playlist_add_item( mediacontrol_Instance *self,
00178 const char* psz_file,
00179 mediacontrol_Exception *exception );
00180 void mediacontrol_playlist_clear( mediacontrol_Instance *self,
00181 mediacontrol_Exception *exception );
00182 mediacontrol_PlaylistSeq *
00183 mediacontrol_playlist_get_list( mediacontrol_Instance *self,
00184 mediacontrol_Exception *exception );
00185
00186
00187
00188
00189
00190 mediacontrol_RGBPicture *
00191 mediacontrol_snapshot( mediacontrol_Instance *self,
00192 const mediacontrol_Position *a_position,
00193 mediacontrol_Exception *exception );
00194
00195
00196 mediacontrol_RGBPicture **
00197 mediacontrol_all_snapshots( mediacontrol_Instance *self,
00198 mediacontrol_Exception *exception );
00199
00200
00201 void mediacontrol_display_text( mediacontrol_Instance *self,
00202 const char *message,
00203 const mediacontrol_Position *begin,
00204 const mediacontrol_Position *end,
00205 mediacontrol_Exception *exception );
00206
00207 mediacontrol_StreamInformation *
00208 mediacontrol_get_stream_information( mediacontrol_Instance *self,
00209 mediacontrol_PositionKey a_key,
00210 mediacontrol_Exception *exception );
00211
00212 unsigned short
00213 mediacontrol_sound_get_volume( mediacontrol_Instance *self,
00214 mediacontrol_Exception *exception );
00215 void mediacontrol_sound_set_volume( mediacontrol_Instance *self,
00216 const unsigned short volume,
00217 mediacontrol_Exception *exception );
00218
00219 vlc_bool_t mediacontrol_set_visual( mediacontrol_Instance *self,
00220 WINDOWHANDLE visual_id,
00221 mediacontrol_Exception *exception );
00222
00223 # ifdef __cplusplus
00224 }
00225 # endif
00226
00227 #endif