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

SoundSrvA.hh

Go to the documentation of this file.
00001 /*
00002 
00003     SoundServer for ALSA
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 #ifdef USE_ALSA05
00036 #include "AudioA.hh"
00037 #else
00038 #include "AudioA2.hh"
00039 #endif
00040 #include "CfgFile.hh"
00041 #include "LogFile.hh"
00042 #include "Messages.hh"
00043 #include "SockServ.hh"
00044 #include "SockOp.hh"
00045 
00046 
00047 #ifndef SOUNDSRVA_HH
00048     #define SOUNDSRVA_HH
00049 
00050     #define SSA_LOGENTRY_SIZE       256
00051 
00052 
00058     class clSoundSrvA
00059     {
00060             volatile bool bRun;
00061             volatile int iAudioBufSize;
00062             volatile int iBlockCntr;
00063             stSoundStart sHdr;
00064             #ifdef USE_FLAC
00065             FLAC__StreamEncoder *spFLACEnc;
00066             #endif
00067             clAlloc AudioBuf;
00068             clAlloc CompHead;
00069             clAlloc FLACFrame;
00070             clMutex MtxAudio;
00071             #ifdef USE_RWLOCK
00072             clRWLock RWLAudio;
00073             #endif
00074             clCondition CndAudio;
00075             clCfgFile Cfg;
00076             bool GetAudioCfg (int *, int *, int *, int *, int *, int *, 
00077                 int *, int *);
00078             bool InitCompress (int, int, int, int, int);
00079             #ifdef USE_FLAC
00080             void Convert (FLAC__int32 *, const void *, long, int);
00081             #endif
00082         public:
00083             clLogFile Log;
00084             clSoundSrvA ();
00085             ~clSoundSrvA ();
00086             int Main (int, char **);
00087             void *AudioInThread (void *);
00088             void *ServeClientThread (void *);
00089             void Stop() { bRun = false; }
00090             #ifdef USE_FLAC
00091             FLAC__StreamEncoderWriteStatus FLACWrite (
00092                 const FLAC__StreamEncoder *, const FLAC__byte *, unsigned,
00093                 unsigned, unsigned);
00094             void FLACMetaData (const FLAC__StreamEncoder *, 
00095                 const FLAC__StreamMetadata *);
00096             #endif
00097     };
00098 
00099 #endif
00100 

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