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

SoundAttributes.h

Go to the documentation of this file.
00001 /* audiodevs: Abstraction layer for audio hardware & samples 00002 Copyright (C) 2003-2004 Nemosoft Unv. 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 For questions, remarks, patches, etc. for this program, the author can be 00019 reached at camstream@smcc.demon.nl. 00020 */ 00021 00022 #ifndef SOUNDATTRS_H 00023 #define SOUNDATTRS_H 00024 00025 #include <sys/types.h> 00026 00027 #ifdef _WIN32 00028 typedef char int8_t; 00029 typedef unsigned char u_int8_t; 00030 typedef __int16 int16_t; 00031 typedef unsigned short u_int16_t; 00032 typedef long int32_t; 00033 typedef unsigned long u_int32_t; 00034 #endif 00035 00036 struct SoundAttributes 00037 { 00039 enum Format 00040 { 00041 Unknown, 00042 Signed8, 00043 Signed16, 00044 Signed24, 00045 Signed32, 00046 Unsigned8, 00047 Unsigned16, 00048 Unsigned24, 00049 Unsigned32, 00050 Float, 00051 }; 00052 00054 enum Position 00055 { 00056 NotUsed = -1, 00057 Mono = 32, 00058 Left, 00059 Right, 00060 Center, 00061 LeftRear, 00062 RightRear, 00063 LFE, 00064 LeftCenter, 00065 RightCenter, 00066 Top, 00067 MaxPosition = 64 00068 }; 00069 00071 enum Preset 00072 { 00073 Speech, 00074 Radio, 00075 CD, 00076 DAT, 00077 Dolby51, 00078 00079 }; 00080 00081 enum Channels 00082 { 00083 MaxChannel = 32 00084 }; 00085 00086 unsigned int SampleRate; 00087 Format SampleFormat; 00088 unsigned short Channels; 00089 Position ChannelPosition[MaxChannel]; 00090 00091 SoundAttributes(); 00092 00093 void Reset(); 00094 void SetPreset(Preset); 00095 00096 unsigned int FormatWidth() const; 00097 unsigned int BytesPerSample() const; 00098 00099 bool operator ==(const SoundAttributes &comp) const; 00100 bool operator !=(const SoundAttributes &comp) const; 00101 00102 static SoundAttributes GetFormat(Preset fmt); 00103 }; 00104 00105 #endif

Generated on Wed Dec 13 23:38:46 2006 for CamStream by doxygen 1.3.7