Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

StreamDist.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Audio stream distributor
00004     Copyright (C) 2000-2002 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <Alloc.hh>
00024 #include <Condition.hh>
00025 #include <Mutex.hh>
00026 #ifdef USE_RWLOCK
00027 #include <RWLock.hh>
00028 #endif
00029 #ifdef USE_FLAC
00030     #include <FLAC/all.h>
00031 #endif
00032 
00033 #include "Config.h"
00034 #include "LocalMsg.h"
00035 #include "CfgFile.hh"
00036 #include "LogFile.hh"
00037 #include "Messages.hh"
00038 #include "SockClie.hh"
00039 #include "SockOp.hh"
00040 #include "SockServ.hh"
00041 
00042 
00043 #ifndef STREAMDIST_HH
00044     #define STREAMDIST_HH
00045 
00046     #define SD_LOGENTRY_SIZE        256
00047     #define SD_HOSTADDR_MAX         256
00048 
00049 
00055     class clStreamDist
00056     {
00057             volatile bool bRun;
00058             volatile int iFragmentSize;
00059             volatile int iAudioBufSize;
00060             volatile int iBlockCntr;
00061             stRawDataFirst sHdr;
00062             #ifdef USE_FLAC
00063             FLAC__StreamDecoder *spFLACDec;
00064             #endif
00065             clCfgFile Cfg;
00066             clAlloc AudioBuf;
00067             clMutex MtxAudio;
00068             #ifdef USE_RWLOCK
00069             clRWLock RWLAudio;
00070             #endif
00071             #ifdef USE_FLAC
00072             clSockOp *InSOp;
00073             #endif
00074             clCondition CndAudio;
00075             void CopyChannel (GDT *, const GDT *, int);
00076             bool InitCompress (int);
00077         public:
00078             clLogFile Log;
00079             clStreamDist ();
00080             ~clStreamDist ();
00081             int Main (int, char **);
00082             void *AudioInThread (void *);
00083             void *ServeClientThread (void *);
00084             void Stop () { bRun = false; }
00085             #ifdef USE_FLAC
00086             FLAC__StreamDecoderReadStatus FLACRead (
00087                 const FLAC__StreamDecoder *, FLAC__byte *, unsigned *);
00088             FLAC__StreamDecoderWriteStatus FLACWrite (
00089                 const FLAC__StreamDecoder *, const FLAC__Frame *, 
00090                 const FLAC__int32 * const *);
00091             void FLACMetaData (
00092                 const FLAC__StreamDecoder *, const FLAC__StreamMetadata *);
00093             void FLACError (
00094                 const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus);
00095             #endif
00096     };
00097     
00098 #endif
00099 

Generated on Sun Oct 26 19:11:23 2003 for HASAS by doxygen 1.3.3