/* * Copyright: (C) 2000 Bruce W. Forsberg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Bruce Forsberg forsberg@tns.net * */ /*! \class aflibSoxFile \brief Derived class to read and write audio files using the SOX library. This class will read and write audio files using the SOX library. The SOX library project is at: http://home.sprynet.com/~cbagwell/sox.html . */ #ifndef _AFLIBSOXFILE_H #define _AFLIBSOXFILE_H #ifdef HAVE_CONFIG_H #include #endif #include #include #include "aflibFile.h" #include "st.h" class aflibFileItem; class aflibSoxFile : public aflibFile { public: aflibSoxFile(); ~aflibSoxFile(); aflibStatus afopen( const char * file, aflibConfig* cfg); aflibStatus afcreate( const char * file, const aflibConfig& cfg); aflibStatus afread( aflibData& data, long long position = -1); aflibStatus afwrite( aflibData& data, long long position = -1); bool isDataSizeSupported(aflib_data_size size); bool isEndianSupported(aflib_data_endian end); bool isSampleRateSupported(int& rate); bool isChannelsSupported(int& channels); /* For getting and setting SOX soundstream struct */ bool getItem( const char* item, void* value); private: static int filetype(int fd); /* void initOptions(aflibOptions& options); static void setOptionStrings(aflibOptions& options); */ static void configToFormat( const aflibConfig& cfg, ft_t format ); static void formatToConfig( aflibConfig& cfg, const ft_t format ); void checkformat(ft_t format){ st_checkformat(format); }; struct st_soundstream _st_format; bool _write; long long _position; }; #endif