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 SHOUT_CAST_H
00030 #define SHOUT_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 ShoutCast : public CastSink
00060 {
00061 private:
00062
00066 char * irc;
00067
00071 char * aim;
00072
00076 char * icq;
00077
00086 void
00087 init ( const char * irc,
00088 const char * aim,
00089 const char * icq )
00090 throw ( Exception );
00091
00097 void
00098 strip ( void ) throw ( Exception );
00099
00100
00101 protected:
00102
00108 inline
00109 ShoutCast ( 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 ShoutCast ( TcpSocket * socket,
00147 const char * password,
00148 unsigned int bitRate,
00149 const char * name = 0,
00150 const char * url = 0,
00151 const char * genre = 0,
00152 bool isPublic = false,
00153 const char * irc = 0,
00154 const char * aim = 0,
00155 const char * icq = 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( irc, aim, icq);
00170 }
00171
00177 inline
00178 ShoutCast( const ShoutCast & cs ) throw ( Exception )
00179 : CastSink( cs )
00180 {
00181 init( cs.getIrc(), cs.getAim(), cs.getIcq());
00182 }
00183
00189 inline virtual
00190 ~ShoutCast( void ) throw ( Exception )
00191 {
00192 strip();
00193 }
00194
00202 inline virtual ShoutCast &
00203 operator= ( const ShoutCast & cs ) throw ( Exception )
00204 {
00205 if ( this != &cs ) {
00206 strip();
00207 CastSink::operator=( cs );
00208 init( cs.getIrc(), cs.getAim(), cs.getIcq());
00209 }
00210 return *this;
00211 }
00212
00218 inline const char *
00219 getIrc ( void ) const throw ()
00220 {
00221 return irc;
00222 }
00223
00229 inline const char *
00230 getAim ( void ) const throw ()
00231 {
00232 return aim;
00233 }
00234
00240 inline const char *
00241 getIcq ( void ) const throw ()
00242 {
00243 return icq;
00244 }
00245
00246 };
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256 #endif
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276