OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / lib / libopenh323 / include / opalwavfile.h
1 /*
2  * OpalWavFile.h
3  *
4  * WAV file class with auto-PCM conversion
5  *
6  * OpenH323 Library
7  *
8  * Copyright (c) 2002 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open H323 Library.
21  *
22  * Contributor(s): ______________________________________.
23  *
24  * $Log: opalwavfile.h,v $
25  * Revision 1.9  2005/11/30 13:05:01  csoutheren
26  * Changed tags for Doxygen
27  *
28  * Revision 1.8  2004/08/26 08:05:03  csoutheren
29  * Codecs now appear in abstract factory system
30  * Fixed Windows factory bootstrap system (again)
31  *
32  * Revision 1.7  2004/08/09 11:11:33  csoutheren
33  * Added stupid windows hack to force opalwavfile factories to register
34  *
35  * Revision 1.6  2004/07/15 11:13:49  rjongbloed
36  * Migrated changes from crs_vxnml_devel branch into main trunk
37  *
38  * Revision 1.5.6.1  2004/07/07 07:10:11  csoutheren
39  * Changed to use new factory based PWAVFile
40  * Removed redundant blocking/unblocking when using G.723.1
41  *
42  * Revision 1.5  2002/09/16 01:14:15  robertj
43  * Added #define so can select if #pragma interface/implementation is used on
44  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
45  *
46  * Revision 1.4  2002/09/06 06:20:37  robertj
47  * More cosmetic changes
48  *
49  * Revision 1.3  2002/08/08 13:00:02  craigs
50  * Remove unused definition of LastReadCount thanks to Peter 'Luna' Runestig
51  *
52  * Revision 1.2  2002/08/05 10:03:47  robertj
53  * Cosmetic changes to normalise the usage of pragma interface/implementation.
54  *
55  * Revision 1.1  2002/06/20 01:21:03  craigs
56  * Initial version
57  *
58  */
59
60 #ifndef __OPALWAVFILE_H
61 #define __OPALWAVFILE_H
62
63 #ifdef P_USE_PRAGMA
64 #pragma interface
65 #endif
66
67
68 #include <ptclib/pwavfile.h>
69
70 /**This class is similar to the PWavFile class found in the PWlib
71    components library. However, it will tranparently convert all data
72    to/from PCM format, allowing applications to be unconcerned with 
73    the underlying data format. Note that this will only work with
74    sample-based formats that can be converted to/from PCM data, such as
75    uLaw and aLaw
76   */
77
78 class OpalWAVFile : public PWAVFile
79 {
80   PCLASSINFO(OpalWAVFile, PWAVFile);
81   public:
82     OpalWAVFile(
83       unsigned format = fmt_PCM ///<  Type of WAV File to create
84     );
85
86     /**Create a unique temporary file name, and open the file in the specified
87        mode and using the specified options. Note that opening a new, unique,
88        temporary file name in ReadOnly mode will always fail. This would only
89        be usefull in a mode and options that will create the file.
90
91        If a WAV file is being created, the type parameter can be used
92        to create a PCM Wave file or a G.723.1 Wave file by using
93        #WaveType enum#
94
95        The #PChannel::IsOpen()# function may be used after object
96        construction to determine if the file was successfully opened.
97      */
98     OpalWAVFile(
99       OpenMode mode,            ///<  Mode in which to open the file.
100       int opts = ModeDefault,   ///<  #OpenOptions enum# for open operation.
101       unsigned format = fmt_PCM ///<  Type of WAV File to create
102     );
103
104     /**Create a WAV file object with the specified name and open it in
105        the specified mode and with the specified options.
106        If a WAV file is being created, the type parameter can be used
107        to create a PCM Wave file or a G.723.1 Wave file by using
108        #WaveType enum#
109
110        The #PChannel::IsOpen()# function may be used after object
111        construction to determine if the file was successfully opened.
112      */
113     OpalWAVFile(
114       const PFilePath & name,     ///<  Name of file to open.
115       OpenMode mode = ReadWrite,  ///<  Mode in which to open the file.
116       int opts = ModeDefault,     ///<  #OpenOptions enum# for open operation.
117       unsigned format = fmt_PCM ///<  Type of WAV File to create
118     );
119 };
120
121 #endif // __OPALWAVFILE_H
122
123
124 // End of File ///////////////////////////////////////////////////////////////