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-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 _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       double volume = 1.0);
00061 
00062    void
00063    setInputConfig(const aflibConfig& cfg);
00064 
00066    const char *
00067    getName() const { return "aflibAudioSampleRateCvt";};
00068 
00069    aflibStatus
00070    compute_segment(
00071       list<aflibData*>& data,
00072       long long position = -1) ;
00073 
00074    aflibData *
00075    process(
00076       aflibStatus& ret_status,
00077       long long position,
00078       int& num_samples,
00079       bool free_memory = TRUE) ;
00080 
00081    bool
00082    isDataSizeSupported(aflib_data_size size);
00083 
00084 private:
00085 
00086    aflibAudioSampleRateCvt();
00087 
00088    aflibAudioSampleRateCvt(const aflibAudioSampleRateCvt& op);
00089 
00090    const aflibAudioSampleRateCvt&
00091    operator=(const aflibAudioSampleRateCvt& op);
00092 
00093 
00094 int     _extra_sample;
00095 int     _output_samples;
00096 aflibConverter  * _converter;
00097 double  _factor;
00098 bool    _initial;
00099 int     _init_chan;
00100 short  *_in_array;
00101 int     _in_array_size;
00102 short  *_out_array;
00103 int     _out_array_size;
00104 double  _vol;
00105 
00106 // These factors are used for buffering audio data so that we can get
00107 // the audio data as a stream from the parent
00108 long long _next_output_position;
00109 long long _next_input_position;
00110 int       _save_samples;
00111 int       _prev_in_count;
00112 
00113 
00114 
00115 };
00116 
00117 
00118 #endif

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