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

IceCast2.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     : IceCast2.h
00008    Version  : $Revision: 1.5 $
00009    Author   : $Author: darkeye $
00010    Location : $Source: /cvsroot/darkice/darkice/src/IceCast2.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 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 /* ============================================================ 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 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 /* ================================================= external data structures */
00262 
00263 
00264 /* ====================================================== function prototypes */
00265 
00266 
00267 
00268 #endif  /* ICE_CAST2_H */
00269 
00270 
00271 /*------------------------------------------------------------------------------
00272  
00273   $Source: /cvsroot/darkice/darkice/src/IceCast2.h,v $
00274 
00275   $Log: IceCast2.h,v $
00276   Revision 1.5  2005/04/16 21:57:34  darkeye
00277   added AAC support through the faac codec, http://www.audiocoding.com/
00278 
00279   Revision 1.4  2005/04/14 11:53:17  darkeye
00280   fixed API documentation issues
00281 
00282   Revision 1.3  2002/02/20 11:54:11  darkeye
00283   added local dump file possibility
00284 
00285   Revision 1.2  2002/02/20 10:35:35  darkeye
00286   updated to work with Ogg Vorbis libs rc3 and current IceCast2 cvs
00287 
00288   Revision 1.1  2001/09/14 19:31:06  darkeye
00289   added IceCast2 / vorbis support
00290 
00291 
00292   
00293 ------------------------------------------------------------------------------*/
00294 

Generated on Sat Oct 22 13:17:04 2005 for DarkIce by  doxygen 1.4.4