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 #define SURROUND_BUFSIZE 8192
00025
00026 class FreeSurround
00027 {
00028 public:
00029 typedef enum
00030 {
00031 SurroundModePassive,
00032 SurroundModeActiveSimple,
00033 SurroundModeActiveLinear
00034 } SurroundMode;
00035 public:
00036 FreeSurround(uint srate, bool moviemode, SurroundMode mode);
00037 ~FreeSurround();
00038
00039
00040 uint putFrames(void* buffer, uint numFrames, uint numChannels);
00041
00042 uint receiveFrames(void *buffer, uint maxFrames);
00043
00044 void flush();
00045 uint numUnprocessedFrames();
00046 uint numFrames();
00047
00048 long long getLatency();
00049 uint frameLatency();
00050
00051 uint framesPerBlock();
00052
00053 protected:
00054 void process_block();
00055 void open();
00056 void close();
00057 void SetParams();
00058
00059 private:
00060
00061
00062 struct fsurround_params {
00063 int32_t center_width;
00064 int32_t dimension;
00065 float coeff_a,coeff_b;
00066 int32_t phasemode;
00067 int32_t steering;
00068 int32_t front_sep, rear_sep;
00069 float gain;
00070
00071 fsurround_params(int32_t center_width=100, int32_t dimension=0);
00072 } params;
00073
00074
00075 uint srate;
00076
00077
00078 bool open_;
00079 bool initialized_;
00080 struct buffers *bufs;
00081 struct int16buffers *int16bufs;
00082 class fsurround_decoder *decoder;
00083 int in_count;
00084 int out_count;
00085 bool processed;
00086 int processed_size;
00087 SurroundMode surround_mode;
00088 int latency_frames;
00089 int channels;
00090 };
00091
00092 #endif