00001 /* 00002 00003 Level server, header 00004 Copyright (C) 2000-2001 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 <limits.h> 00024 00025 #include <Alloc.hh> 00026 #include <dsp/DSPOp.hh> 00027 #include <dsp/Filter.hh> 00028 00029 #include "Config.h" 00030 #include "LocalMsg.h" 00031 #include "CfgFile.hh" 00032 #include "Messages.hh" 00033 #include "SockClie.hh" 00034 #include "SockOp.hh" 00035 00036 00037 #ifndef LEVEL_HH 00038 #define LEVEL_HH 00039 00040 #define LEVEL_FILTER_WINDOW true 00041 00042 00046 class clLevel 00047 { 00048 bool bRun; 00049 long lFilterSize; 00050 long lRawDataCount; 00051 long lRawBufSize; 00052 long lSampleCount; 00053 char cpStreamSocket[_POSIX_PATH_MAX + 1]; 00054 GDT fResPeakLevel; 00055 stRawDataFirst sRawHdr; 00056 stLevelReq sRequest; 00057 stLevelRes sResult; 00058 clDSPAlloc RawBuf; 00059 clDSPAlloc DataBuf; 00060 clCfgFile CfgFile; 00061 clDSPOp DSP; 00062 clFilter Filter; 00063 clSockClie SClient; 00064 clSockOp SOpRequest; 00065 clSockOp SOpResult; 00066 clSockOp SOpRaw; 00067 clLevelMsg Msg; 00068 bool GetCfg (); 00069 bool GetRequest (); 00070 bool ConnectStream (); 00071 bool Initialize (); 00072 bool ReceiveData (); 00073 bool Process (); 00074 bool SendResult (); 00075 public: 00076 clLevel (int, int); 00077 ~clLevel (); 00078 int Main (int, char **); 00079 }; 00080 00081 #endif 00082
1.3.3