00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef FREESURROUND_H
00020 #define FREESURROUND_H
00021
00022 #include "compat.h"
00023
00024 class FreeSurround
00025 {
00026 public:
00027 typedef enum
00028 {
00029 SurroundModePassive,
00030 SurroundModeActiveSimple,
00031 SurroundModeActiveLinear
00032 } SurroundMode;
00033 public:
00034 FreeSurround(uint srate, bool moviemode, SurroundMode mode);
00035 ~FreeSurround();
00036
00037
00038 uint putSamples(short* samples, uint numSamples, uint numChannels, int step);
00039 uint putSamples(char* samples, uint numSamples, uint numChannels, int step);
00040
00041 uint receiveSamples(short *output,
00042 uint maxSamples
00043 );
00044
00045 void flush();
00046
00047 uint numUnprocessedSamples();
00048 uint numSamples();
00049
00050 long long getLatency();
00051 uint sampleLatency();
00052
00053 uint samplesPerBlock();
00054
00055 protected:
00056 void process_block();
00057 void open();
00058 void close();
00059 void SetParams();
00060
00061 private:
00062
00063
00064 struct fsurround_params {
00065 int32_t center_width;
00066 int32_t dimension;
00067 float coeff_a,coeff_b;
00068 int32_t phasemode;
00069 int32_t steering;
00070 int32_t front_sep, rear_sep;
00071 float gain;
00072
00073
00074 fsurround_params(int32_t center_width=100, int32_t dimension=0);
00075 } params;
00076
00077
00078 uint srate;
00079
00080
00081 bool open_;
00082 bool initialized_;
00083
00084 struct int16buffers *int16bufs;
00085 class fsurround_decoder *decoder;
00086 int in_count;
00087 int out_count;
00088 bool processed;
00089 int processed_size;
00090 SurroundMode surround_mode;
00091
00092 };
00093
00094 #endif
00095