Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

ShoutCast.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 
00003    Copyright (c) 2000 Tyrell Corporation. All rights reserved.
00004 
00005    Tyrell DarkIce
00006 
00007    File     : ShoutCast.h
00008    Version  : $Revision: 1.3 $
00009    Author   : $Author: darkeye $
00010    Location : $Source: /cvsroot/darkice/darkice/src/ShoutCast.h,v $
00011    
00012    Copyright notice:
00013 
00014     This program is free software; you can redistribute it and/or
00015     modify it under the terms of the GNU General Public License  
00016     as published by the Free Software Foundation; either version 2
00017     of the License, or (at your option) any later version.
00018    
00019     This program is distributed in the hope that it will be useful,
00020     but WITHOUT ANY WARRANTY; without even the implied warranty of 
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
00022     GNU General Public License for more details.
00023    
00024     You should have received a copy of the GNU General Public License
00025     along with this program; if not, write to the Free Software
00026     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 /* ============================================================ include files */
00038 
00039 #include "Sink.h"
00040 #include "TcpSocket.h"
00041 #include "CastSink.h"
00042 
00043 
00044 /* ================================================================ constants */
00045 
00046 
00047 /* =================================================================== macros */
00048 
00049 
00050 /* =============================================================== data types */
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 /* ================================================= external data structures */
00250 
00251 
00252 /* ====================================================== function prototypes */
00253 
00254 
00255 
00256 #endif  /* SHOUT_CAST_H */
00257 
00258 
00259 /*------------------------------------------------------------------------------
00260  
00261   $Source: /cvsroot/darkice/darkice/src/ShoutCast.h,v $
00262 
00263   $Log: ShoutCast.h,v $
00264   Revision 1.3  2005/04/14 11:53:17  darkeye
00265   fixed API documentation issues
00266 
00267   Revision 1.2  2002/02/20 11:54:11  darkeye
00268   added local dump file possibility
00269 
00270   Revision 1.1  2001/09/09 11:27:31  darkeye
00271   added support for ShoutCast servers
00272 
00273 
00274   
00275 ------------------------------------------------------------------------------*/
00276 

Generated on Fri May 19 15:36:48 2006 for DarkIce by  doxygen 1.4.4