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

Generated at Sun May 13 16:18:53 2001 for Open Source Audio Library Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001