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

ComediSrv.hh

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

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