00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
00105
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