00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ICE_CAST2_H
00030 #define ICE_CAST2_H
00031
00032 #ifndef __cplusplus
00033 #error This is a C++ include file
00034 #endif
00035
00036
00037
00038
00039 #include "Sink.h"
00040 #include "TcpSocket.h"
00041 #include "CastSink.h"
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00059 class IceCast2 : public CastSink
00060 {
00061 public:
00062
00066 enum StreamFormat { mp3, oggVorbis, aac };
00067
00068
00069 private:
00070
00074 StreamFormat format;
00075
00079 char * mountPoint;
00080
00084 char * description;
00085
00094 void
00095 init ( StreamFormat format,
00096 const char * mountPoint,
00097 const char * description )
00098 throw ( Exception );
00099
00105 void
00106 strip ( void ) throw ( Exception );
00107
00108
00109 protected:
00110
00116 inline
00117 IceCast2 ( void ) throw ( Exception )
00118 {
00119 throw Exception( __FILE__, __LINE__);
00120 }
00121
00128 virtual bool
00129 sendLogin ( void ) throw ( Exception );
00130
00131
00132 public:
00133
00153 inline
00154 IceCast2 ( TcpSocket * socket,
00155 const char * password,
00156 const char * mountPoint,
00157 StreamFormat format,
00158 unsigned int bitRate,
00159 const char * name = 0,
00160 const char * description = 0,
00161 const char * url = 0,
00162 const char * genre = 0,
00163 bool isPublic = false,
00164 Sink * streamDump = 0,
00165 unsigned int bufferDuration = 10 )
00166 throw ( Exception )
00167 : CastSink( socket,
00168 password,
00169 bitRate,
00170 name,
00171 url,
00172 genre,
00173 isPublic,
00174 streamDump,
00175 bufferDuration )
00176 {
00177 init( format, mountPoint, description);
00178 }
00179
00185 inline
00186 IceCast2( const IceCast2 & cs ) throw ( Exception )
00187 : CastSink( cs )
00188 {
00189 init( cs.getFormat(),
00190 cs.getMountPoint(),
00191 cs.getDescription() );
00192 }
00193
00199 inline virtual
00200 ~IceCast2( void ) throw ( Exception )
00201 {
00202 strip();
00203 }
00204
00212 inline virtual IceCast2 &
00213 operator= ( const IceCast2 & cs ) throw ( Exception )
00214 {
00215 if ( this != &cs ) {
00216 strip();
00217 CastSink::operator=( cs );
00218 init( cs.getFormat(),
00219 cs.getMountPoint(),
00220 cs.getDescription() );
00221 }
00222 return *this;
00223 }
00224
00230 inline StreamFormat
00231 getFormat ( void ) const throw ()
00232 {
00233 return format;
00234 }
00235
00241 inline const char *
00242 getMountPoint ( void ) const throw ()
00243 {
00244 return mountPoint;
00245 }
00246
00252 inline const char *
00253 getDescription ( void ) const throw ()
00254 {
00255 return description;
00256 }
00257
00258 };
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268 #endif
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294