00001 /* 00002 * audiorecord.h 00003 * 00004 * OPAL audio record manager 00005 * 00006 * Open Phone Abstraction Library (OPAL) 00007 * Formally known as the Open H323 project. 00008 * 00009 * Copyright (C) 2007 Post Increment 00010 * 00011 * The contents of this file are subject to the Mozilla Public License 00012 * Version 1.0 (the "License"); you may not use this file except in 00013 * compliance with the License. You may obtain a copy of the License at 00014 * http://www.mozilla.org/MPL/ 00015 * 00016 * Software distributed under the License is distributed on an "AS IS" 00017 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00018 * the License for the specific language governing rights and limitations 00019 * under the License. 00020 * 00021 * The Original Code is Open Phone Abstraction Library. 00022 * 00023 * The Initial Developer of the Original Code is Post Increment 00024 * 00025 * Contributor(s): ______________________________________. 00026 * 00027 * $Log: audiorecord.h,v $ 00028 * Revision 2.1 2007/05/07 14:13:51 csoutheren 00029 * Add call record capability 00030 * 00031 */ 00032 00033 00034 #ifndef _OPALAUDIORECORD_H 00035 #define _OPALAUDIORECORD_H 00036 00038 // 00039 // This class manages the recording of OPAL calls using the AudioMixer class 00040 // 00041 00042 #include <opal/opalmixer.h> 00043 00044 class OpalRecordManager 00045 { 00046 public: 00047 class Mixer_T : public OpalAudioMixer 00048 { 00049 protected: 00050 OpalWAVFile file; 00051 BOOL mono; 00052 BOOL started; 00053 00054 public: 00055 Mixer_T(); 00056 BOOL Open(const PFilePath & fn); 00057 BOOL Close(); 00058 BOOL OnWriteAudio(const MixerFrame & mixerFrame); 00059 }; 00060 00061 Mixer_T mixer; 00062 00063 protected: 00064 PMutex mutex; 00065 PString token; 00066 BOOL started; 00067 00068 public: 00069 OpalRecordManager(); 00070 BOOL Open(const PString & _callToken, const PFilePath & fn); 00071 BOOL CloseStream(const PString & _callToken, const std::string & _strm); 00072 BOOL Close(const PString & _callToken); 00073 BOOL WriteAudio(const PString & _callToken, const std::string & strm, const RTP_DataFrame & rtp); 00074 }; 00075 00076 00077 #endif // _OPALAUDIOMIXER_H