martin@0: /* martin@0: * Decoder.h martin@0: * SoundField martin@0: * martin@0: * Created by Martin Morrell on 14/06/2012. martin@0: * Copyright 2012 Queen Mary University of London. All rights reserved. martin@0: * martin@0: */ martin@0: martin@0: martin@0: class Decoder martin@0: { martin@0: friend class MyEditor; martin@0: public: martin@0: double Rotate; //+/-180 degrees martin@0: double Tilt; //+/-180 degrees martin@0: double Tumble; //+/-180 degrees martin@0: double Zoom; //+/-100 martin@0: int ZoomMethod; //4 positions martin@0: double Width; //0-90 degrees martin@0: double Pattern; //0-1 Omni amount martin@0: int Mode; //0 or 1 for xy or ms martin@0: double RearVerb; //0-24dB martin@0: double HiVerb; //0-24dB martin@0: martin@0: double temp; //temp for rotations martin@0: double temp2[4]; //temp for zooming martin@0: martin@0: double outputL; //Left output martin@0: double outputR; //Right output martin@0: martin@0: double outputC; //Centre output martin@0: double outputS; //Subwoofer output martin@0: martin@0: double outputSL; //Surround Left output martin@0: double outputSR; //Surround Right output martin@0: martin@0: int surMode; //Rear mics mode martin@0: double surPattern; //Rear mics pattern martin@0: double surWidth; //Rear mics width martin@0: double surGain; //Rear mics gain martin@0: martin@0: double centreOrder; //Centre mic order martin@0: double centrePattern; //Centre mic pattern martin@0: double centreGain; //Centre mic gain martin@0: martin@0: double subGain; //Subwoofer gain martin@0: martin@0: int decoderMode; //Decoder mode, set to same as number of outputs martin@0: martin@0: //Filter Code martin@0: int Fs; martin@0: int Fc; martin@0: double bLF[3]; martin@0: double bHF[3]; martin@0: double a[3]; martin@0: double prevIn[2]; martin@0: double prevOut[2]; martin@0: double prevInw[2]; martin@0: double prevOutw[2]; martin@0: double prevInx[2]; martin@0: double prevOutx[2]; martin@0: double prevIny[2]; martin@0: double prevOuty[2]; martin@0: double prevInz[2]; martin@0: double prevOutz[2]; martin@0: martin@0: void clearFilter(); //Clears the previous filter values martin@0: martin@0: martin@0: //Overall Function martin@0: void monoDecoder(double &w, double &x, double &y, double &z); //Decode to mono martin@0: void stereoDecoder(double &w, double &x, double &y, double &z); //Decode to stereo martin@0: void twoOneDecoder(double &w, double &x, double &y, double &z); //Decode to stereo martin@0: void lrcsDecoder(double &w, double &x, double &y, double &z); //Decode to LRCS martin@0: void fiveDecoder(double &w, double &x, double &y, double &z); //Decode to 5.0 martin@0: void fiveOneDecoder(double &w, double &x, double &y, double &z); //Decode to 5.1 martin@0: martin@0: martin@0: //private: martin@0: double degRad(double angle); //Convert degreesto radians martin@0: double radDeg(double angle); //Convert radians to degrees martin@0: martin@0: //SoundField Rotations martin@0: void rotateField(double &x, double &y); martin@0: void tiltField(double &x, double &y); martin@0: void tumbleField(double &x, double &y); martin@0: martin@0: //Zoom Methods martin@0: void dominanceZoom(double &w, double &x, double &y, double &z); martin@0: void pressZoom(double &w, double &x, double &y, double &z); martin@0: void pushZoom(double &w, double &x, double &y, double &z); martin@0: void focusZoom(double &w, double &x, double &y, double &z); martin@0: martin@0: //Stereo Decoders martin@0: void xyDecode(double &w, double &x, double &y, double &z); martin@0: void msDecode(double &w, double &x, double &y, double &z); martin@0: martin@0: //Reverbs martin@0: void rearVerb(double &w, double &x, double &y, double &z); martin@0: void hiVerb(double &w, double &x, double &y, double &z); martin@0: martin@0: //Surround martin@0: void centreMic(double &w, double &x); martin@0: void xySurDecode(double &w, double &x, double &y, double &z); martin@0: void msSurDecode(double &w, double &x, double &y, double &z); martin@0: martin@0: //Subwoofer martin@0: void subSignal(double &w); martin@0: martin@0: //Filter Code martin@0: void filterCoefs(); martin@0: void filterLF(); martin@0: void filterHF(double &w, double &x, double &y, double &z); martin@0: };