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_CAST_H
00030 #define ICE_CAST_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 IceCast : public CastSink
00060 {
00061 private:
00062
00066 char * mountPoint;
00067
00071 char * remoteDumpFile;
00072
00076 char * description;
00077
00086 void
00087 init ( const char * mountPoint,
00088 const char * description,
00089 const char * remoteDumpFile )
00090 throw ( Exception );
00091
00097 void
00098 strip ( void ) throw ( Exception );
00099
00100
00101 protected:
00102
00108 inline
00109 IceCast ( void ) throw ( Exception )
00110 {
00111 throw Exception( __FILE__, __LINE__);
00112 }
00113
00120 virtual bool
00121 sendLogin ( void ) throw ( Exception );
00122
00123
00124 public:
00125
00145 inline
00146 IceCast ( TcpSocket * socket,
00147 const char * password,
00148 const char * mountPoint,
00149 unsigned int bitRate,
00150 const char * name = 0,
00151 const char * description = 0,
00152 const char * url = 0,
00153 const char * genre = 0,
00154 bool isPublic = false,
00155 const char * remoteDumpFile = 0,
00156 Sink * streamDump = 0,
00157 unsigned int bufferDuration = 10 )
00158 throw ( Exception )
00159 : CastSink( socket,
00160 password,
00161 bitRate,
00162 name,
00163 url,
00164 genre,
00165 isPublic,
00166 streamDump,
00167 bufferDuration )
00168 {
00169 init( mountPoint, description, remoteDumpFile);
00170 }
00171
00177 inline
00178 IceCast( const IceCast & cs ) throw ( Exception )
00179 : CastSink( cs )
00180 {
00181 init( cs.getMountPoint(),
00182 cs.getDescription(),
00183 cs.getRemoteDumpFile() );
00184 }
00185
00191 inline virtual
00192 ~IceCast( void ) throw ( Exception )
00193 {
00194 strip();
00195 }
00196
00204 inline virtual IceCast &
00205 operator= ( const IceCast & cs ) throw ( Exception )
00206 {
00207 if ( this != &cs ) {
00208 strip();
00209 CastSink::operator=( cs );
00210 init( cs.getMountPoint(),
00211 cs.getDescription(),
00212 cs.getRemoteDumpFile() );
00213 }
00214 return *this;
00215 }
00216
00222 inline const char *
00223 getMountPoint ( void ) const throw ()
00224 {
00225 return mountPoint;
00226 }
00227
00233 inline const char *
00234 getRemoteDumpFile ( void ) const throw ()
00235 {
00236 return remoteDumpFile;
00237 }
00238
00244 inline const char *
00245 getDescription ( void ) const throw ()
00246 {
00247 return description;
00248 }
00249
00250 };
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260 #endif
00261
00262
00263
00264
00265
00266
00267
00268
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