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

aflibData.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 
00023 #ifndef _AFLIBDATA_H_
00024 #define _AFLIBDATA_H_
00025 
00026 #include "aflibConfig.h"
00027 
00028 
00051 class aflibData {
00052 
00053 public:
00054 
00055    aflibData(long length);
00056 
00057    aflibData(
00058       const aflibConfig& config,
00059       long length);
00060 
00061    aflibData(const aflibData& data);
00062 
00063    ~aflibData();
00064 
00065    aflibData&
00066    operator=(const aflibData& data);
00067 
00068    void
00069    setConfig(const aflibConfig& config);
00070 
00071    const aflibConfig&
00072    getConfig() const;
00073 
00074    void
00075    getLength(long& length) const;
00076 
00077    long
00078    getLength() const;
00079 
00080    void
00081    getOrigLength(long& length) const;
00082 
00083    long
00084    getOrigLength() const;
00085 
00086    void
00087    adjustLength(long length);
00088 
00089    void
00090    adjustTotalLength(long length);
00091 
00092    long
00093    getTotalLength();
00094 
00095    long
00096    getTotalAdjustLength();
00097 
00098    void *
00099    getDataPointer() const;
00100 
00101    void
00102    setSample(
00103       int sample,
00104       long position,
00105       int channel);
00106 
00107    int
00108    getSample(
00109       long position,
00110       int channel);
00111 
00112    void
00113    getMinMax(
00114       int& min_value,
00115       int& max_value) const;
00116 
00117    void
00118    convertToSize(aflib_data_size data_size);
00119 
00120    void
00121    convertToEndian(aflib_data_endian endian);
00122 
00123    aflib_data_endian
00124    getHostEndian() const;
00125 
00126    void
00127    zeroData();
00128 
00129 private:
00130 
00131    void
00132    init();
00133 
00134    void
00135    setHostEndian();
00136 
00137    void
00138    allocate();
00139 
00140 
00141    void *    _data;        // holds pointer to data
00142    int       _initialized; // indicates if data has been initialized
00143    aflibConfig  _config;   // data organization
00144    int       _byte_inc;    // number of bytes for each sample
00145    long      _length;
00146    long      _adj_length;
00147    long      _total_length;
00148    aflib_data_endian  _endian;
00149 
00150 };
00151 
00152 
00153 #endif

Generated at Tue Aug 7 22:18:06 2001 for Open Source Audio Library Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001