Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

aflibFile.h

Go to the documentation of this file.
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 
00022 #ifndef _AFLIBFILE_H
00023 #define _AFLIBFILE_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028 
00029 #include "aflib.h"
00030 #include "aflibConfig.h"
00031 
00032 #include <string>
00033 #include <list>
00034 #include <map>
00035 using std::string;
00036 using std::list;
00037 using std::map;
00038 
00039 
00068 class aflibData;
00069 class aflibFileItem;
00070 
00071 class aflibFile {
00072 
00073 public:
00074 
00075    virtual ~aflibFile();
00076 
00077    static void
00078    returnSupportedFormats(
00079       list <string>& formats,
00080       list <string>& descriptions);
00081 
00082    static const list<aflibFileItem*>&  
00083     returnSupportedFormats();
00084 
00085    static aflibFile *
00086    open(
00087       aflibFileType type_enum,
00088       const string& file,
00089       aflibConfig* cfg = NULL,
00090       aflibStatus* status = NULL);
00091 
00092    static aflibFile *
00093    open(
00094       const string& format,
00095       const string& file,
00096       aflibConfig* cfg = NULL,
00097       aflibStatus* status = NULL);
00098 
00099    static aflibFile *
00100    create(
00101       aflibFileType type_enum,
00102       const string& file,
00103       const aflibConfig& cfg,
00104       aflibStatus* status = NULL);
00105 
00106    static aflibFile *
00107    create(
00108       const string& format,
00109       const string& file,
00110       const aflibConfig& cfg,
00111       aflibStatus* status = NULL);
00112 
00113    virtual aflibStatus
00114    afopen(
00115       const char * file,
00116       aflibConfig* cfg);
00117 
00118    virtual aflibStatus
00119    afcreate(
00120       const char * file,
00121       const aflibConfig& cfg);
00122 
00123    virtual aflibStatus
00124    afread(
00125       aflibData& data,
00126       long long position = -1);
00127 
00128    virtual aflibStatus
00129    afwrite(
00130       aflibData& data,
00131       long long position = -1);
00132 
00133    virtual bool
00134    setItem(
00135       const char * item,
00136       const void * value);
00137 
00138    virtual bool
00139    getItem(
00140       const char * item,
00141       void * value);
00142 
00143    const string&
00144    getFormat() const;
00145 
00146    virtual void
00147    setInputConfig(const aflibConfig& cfg);
00148  
00149    const aflibConfig&
00150    getInputConfig() const;
00151  
00152    void
00153    setOutputConfig(const aflibConfig& cfg);
00154  
00155    const aflibConfig&
00156    getOutputConfig() const;
00157 
00158    void
00159    setValue1(const string& value);
00160 
00161    void
00162    setValue2(const string& value);
00163 
00164    void
00165    setValue3(const string& value);
00166 
00167    virtual bool
00168    isDataSizeSupported(aflib_data_size size);
00169  
00170    virtual bool
00171    isEndianSupported(aflib_data_endian end);
00172  
00173    virtual bool
00174    isSampleRateSupported(int& rate);
00175 
00176    virtual bool
00177    isChannelsSupported(int& channels);
00178 
00179 protected:
00180 
00181    aflibFile();
00182 
00183    long       _total_size;
00184    long       _one_second_size;
00185    long       _current_place_size;
00186    string     _value1;
00187    string     _value2;
00188    string     _value3;
00189 
00190 
00191 private:
00192 
00193     //void (*_isChannelsSupported)(int&);
00194    aflibConfig _cfg_input;
00195    aflibConfig _cfg_output;
00196    void *     _lib1;
00197    aflibFile * _file_object;
00198    string     _format;
00199    static list<aflibFileItem *>  _support_list;
00200    static bool _list_created;
00201 
00202 
00203    aflibFile(const char * module_name);
00204 
00205    aflibFile(const aflibFile& file);
00206 
00207    const aflibFile&
00208    operator== (const aflibFile& file);
00209 
00210    static aflibFile *
00211    allocateModuleFile(
00212       aflibFileType type_enum,
00213       const char *  module_format);
00214 
00215    static const char *
00216    findModuleFile(const string& file_name);
00217 
00218    static void
00219    parseModuleFile();
00220 
00221    bool
00222    initialized();
00223 
00224 };
00225 
00226 #endif

Generated on Wed May 8 20:51:06 2002 for Open Source Audio Library Project by doxygen1.2.15