aflibSoxFile.h

00001 /*
00002  * Copyright: (C) 2000 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 
00030 #ifndef _AFLIBSOXFILE_H
00031 #define _AFLIBSOXFILE_H
00032 
00033 #ifdef HAVE_CONFIG_H
00034 #include <config.h>
00035 #endif
00036 
00037 
00038 #include <map>
00039 #include <list>
00040 
00041 #include "aflibFile.h"
00042 #include "st.h"
00043 
00044 class aflibFileItem;
00045 class aflibSoxFile : public aflibFile {
00046 
00047 public:
00048 
00049    aflibSoxFile();
00050 
00051    ~aflibSoxFile();
00052 
00053 
00054    aflibStatus
00055    afopen(
00056       const char * file,
00057       aflibConfig* cfg);
00058 
00059    aflibStatus
00060    afcreate(
00061       const char * file,
00062       const aflibConfig& cfg);
00063 
00064    aflibStatus
00065    afread(
00066       aflibData& data,
00067       long long position = -1);
00068 
00069    aflibStatus
00070    afwrite(
00071       aflibData& data,
00072       long long position = -1);
00073 
00074    bool
00075    isDataSizeSupported(aflib_data_size size);
00076 
00077    bool
00078    isEndianSupported(aflib_data_endian end);
00079 
00080    bool
00081    isSampleRateSupported(int& rate);
00082 
00083    bool
00084    isChannelsSupported(int& channels);
00085 
00086 /* For getting and setting SOX soundstream struct */
00087     bool
00088     getItem(
00089         const char* item,
00090         void* value);
00091 
00092 private:
00093 
00094     static
00095     int filetype(int fd);
00096 /*
00097 void
00098 initOptions(aflibOptions& options);
00099 static void
00100 setOptionStrings(aflibOptions& options);
00101 */
00102 static void
00103 configToFormat(
00104    const aflibConfig& cfg,
00105     ft_t format
00106 );
00107 static void
00108 formatToConfig(
00109    aflibConfig& cfg,
00110     const ft_t format
00111 );
00112 
00113 void
00114 checkformat(ft_t format){
00115     st_checkformat(format);
00116 };
00117 
00118 
00119     struct st_soundstream _st_format;
00120     bool            _write;
00121     long long   _position;
00122 
00123 };
00124 
00125 
00126 #endif

Generated on Tue Jan 16 12:42:55 2007 for Open Source Audio Library Project by  doxygen 1.4.6