00001 /* 00002 * Copyright: (C) 1999-2001 Bruce W. Forsberg 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or any later version. 00008 * 00009 * This library 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 GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Bruce Forsberg forsberg@tns.net 00019 * 00020 */ 00021 00041 #ifndef _AFLIBDEVFILE_H 00042 #define _AFLIBDEVFILE_H 00043 00044 #ifdef HAVE_CONFIG_H 00045 #include <config.h> 00046 #endif 00047 00048 #include "aflibFile.h" 00049 00050 #define AFLIB_DEV_ITEM_BUFFER "aflib_dev_item_buffer" 00051 00052 class aflibDevFile : public aflibFile { 00053 00054 public: 00055 00056 aflibDevFile(); 00057 00058 ~aflibDevFile(); 00059 00060 aflibStatus 00061 afopen( 00062 const char * file, 00063 aflibConfig* cfg); 00064 00065 aflibStatus 00066 afcreate( 00067 const char * file, 00068 const aflibConfig& config); 00069 00070 aflibStatus 00071 afread( 00072 aflibData& data, 00073 long long position = -1); 00074 00075 aflibStatus 00076 afwrite( 00077 aflibData& data, 00078 long long position = -1); 00079 00080 bool 00081 setItem( 00082 const char * item, 00083 const void * value); 00084 00085 void 00086 programDevice(); 00087 00088 bool 00089 isDataSizeSupported(aflib_data_size size); 00090 00091 bool 00092 isEndianSupported(aflib_data_endian end); 00093 00094 bool 00095 isSampleRateSupported(int& rate); 00096 00097 private: 00098 00099 int 00100 createBuffer( 00101 const aflibConfig& cfg, 00102 double factor); 00103 00104 bool _create_mode; 00105 int _snd_format; 00106 int _snd_stereo; 00107 int _snd_speed; 00108 double _snd_buffer; 00109 int _fd_int; 00110 aflib_data_size _size; 00111 string _file; 00112 00113 }; 00114 00115 00116 #endif