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 #ifdef HAVE_CONFIG_H
00027 #include <config.h>
00028 #endif
00029
00030
00031 #include "aflibAudio.h"
00032 #include "aflibConverter.h"
00033
00034
00047 class aflibAudioSampleRateCvt : public aflibAudio {
00048
00049 public:
00050
00051
00052 aflibAudioSampleRateCvt(
00053 aflibAudio& audio,
00054 double factor,
00055 bool linear_interpolation = FALSE,
00056 bool high_quality = FALSE,
00057 bool filter_interpolation = FALSE);
00058
00059 ~aflibAudioSampleRateCvt();
00060
00061 void
00062 setFactor(
00063 double factor,
00064 double volume = 1.0);
00065
00066 void
00067 setInputConfig(const aflibConfig& cfg);
00068
00070 const char *
00071 getName() const { return "aflibAudioSampleRateCvt";};
00072
00073 aflibStatus
00074 compute_segment(
00075 list<aflibData*>& data,
00076 long long position = -1) ;
00077
00078 aflibData *
00079 process(
00080 aflibStatus& ret_status,
00081 long long position,
00082 int& num_samples,
00083 bool free_memory = TRUE) ;
00084
00085 bool
00086 isDataSizeSupported(aflib_data_size size);
00087
00088 bool
00089 isChannelsSupported(int& channels);
00090
00091 private:
00092
00093 aflibAudioSampleRateCvt();
00094
00095 aflibAudioSampleRateCvt(const aflibAudioSampleRateCvt& op);
00096
00097 const aflibAudioSampleRateCvt&
00098 operator=(const aflibAudioSampleRateCvt& op);
00099
00100
00101 int _extra_sample;
00102 int _output_samples;
00103 int _requested_samples;
00104 aflibConverter * _converter;
00105 double _factor;
00106 bool _initial;
00107 int _init_chan;
00108 short *_in_array;
00109 int _in_array_size;
00110 short *_out_array;
00111 int _out_array_size;
00112 double _vol;
00113
00114
00115
00116 long long _next_output_position;
00117 long long _next_input_position;
00118 int _save_samples;
00119 int _prev_in_count;
00120
00121
00122
00123 };
00124
00125
00126 #endif