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

SoundSrv2.hh

Go to the documentation of this file.
00001 /*
00002 
00003     SoundServer2
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 #include <dsp/DSPOp.hh>
00033 
00034 #include "Config.h"
00035 #include "Audio.hh"
00036 #include "CfgFile.hh"
00037 #include "LogFile.hh"
00038 #include "Messages.hh"
00039 #include "SockServ.hh"
00040 #include "SockOp.hh"
00041 
00042 
00043 #ifndef SOUNDSRV2_HH
00044     #define SOUNDSRV2_HH
00045 
00046     #define SS2_LOGENTRY_SIZE       256
00047 
00048     #define SS2_OSS_MAJOR(x)        ((x >> 16) & 0xff)
00049     #define SS2_OSS_MINOR(x)        ((x >> 8) & 0xff)
00050     #define SS2_OSS_PL(x)           (x & 0xff)
00051 
00052 
00067     class clSoundSrv2
00068     {
00069             volatile bool bRun;
00070             volatile int iAudioBufSize;
00071             volatile int iBlockCntr;
00072             stSoundStart sHdr;
00073             #ifdef USE_FLAC
00074             FLAC__StreamEncoder *spFLACEnc;
00075             #endif
00076             clAlloc AudioBuf;
00077             clAlloc CompHead;
00078             clAlloc FLACFrame;
00079             clMutex MtxAudio;
00080             #ifdef USE_RWLOCK
00081             clRWLock RWLAudio;
00082             #endif
00083             clCondition CndAudio;
00084             clCfgFile Cfg;
00085             bool GetAudioCfg (char *, int *, int *, int *, int *);
00086             bool InitCompress (int, int, int, int, int);
00087             #ifdef USE_FLAC
00088             void Convert (FLAC__int32 *, const void *, long, int);
00089             #endif
00090         public:
00091             clLogFile Log;
00092             clSoundSrv2 ();
00093             ~clSoundSrv2 ();
00094             int Main (int, char **);
00095             void *AudioInThread (void *);
00096             void *ServeClientThread (void *);
00097             void Stop() { bRun = false; }
00098             #ifdef USE_FLAC
00099             FLAC__StreamEncoderWriteStatus FLACWrite (
00100                 const FLAC__StreamEncoder *, const FLAC__byte *, unsigned,
00101                 unsigned, unsigned);
00102             void FLACMetaData (const FLAC__StreamEncoder *, 
00103                 const FLAC__StreamMetadata *);
00104             #endif
00105     };
00106 
00107 #endif
00108 

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