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

aflibAudioSampleRateCvt.h

Go to the documentation of this file.
00001 /*
00002  * Copyright: (C) 1999-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@adnc.com
00019  *
00020  */
00021 
00022 
00023 #ifndef _AFLIBAUDIOSAMPLERATECVT_H_
00024 #define _AFLIBAUDIOSAMPLERATECVT_H_
00025 
00026 
00027 #include "aflibAudio.h"
00028 #include "aflibConverter.h"
00029 
00030 
00043 class aflibAudioSampleRateCvt : public aflibAudio {
00044 
00045 public:
00046 
00047    // Available contructors and destructors
00048    aflibAudioSampleRateCvt(
00049       aflibAudio& audio, 
00050       double factor,
00051       bool  linear_interpolation = FALSE,
00052       bool  high_quality = FALSE,
00053       bool  filter_interpolation = FALSE);
00054 
00055    ~aflibAudioSampleRateCvt();
00056 
00057    void
00058    setFactor(
00059       double factor);
00060 
00061    void
00062    setInputConfig(const aflibConfig& cfg);
00063 
00065    const char *
00066    getName() const { return "aflibAudioSampleRateCvt";};
00067 
00068    aflibStatus
00069    compute_segment(
00070       list<aflibData*>& data,
00071       long long position = -1) ;
00072 
00073    aflibData *
00074    process(
00075       aflibStatus& ret_status,
00076       long long position,
00077       int& num_samples,
00078       bool free_memory = TRUE) ;
00079 
00080    bool
00081    isDataSizeSupported(aflib_data_size size);
00082 
00083 private:
00084 
00085    aflibAudioSampleRateCvt();
00086 
00087    aflibAudioSampleRateCvt(const aflibAudioSampleRateCvt& op);
00088 
00089    const aflibAudioSampleRateCvt&
00090    operator=(const aflibAudioSampleRateCvt& op);
00091 
00092 
00093 int     _extra_sample;
00094 int     _output_samples;
00095 aflibConverter  * _converter;
00096 double  _factor;
00097 bool    _initial;
00098 int     _init_chan;
00099 HWORD   *_in_array;
00100 int      _in_array_size;
00101 HWORD   *_out_array;
00102 int      _out_array_size;
00103 
00104 // These factors are used for buffering audio data so that we can get
00105 // the audio data as a stream from the parent
00106 long long _next_output_position;
00107 long long _next_input_position;
00108 int       _save_samples;
00109 int       _prev_in_count;
00110 
00111 
00112 
00113 };
00114 
00115 
00116 #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