Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

mixing.h

Go to the documentation of this file.
00001 //
00002 // mixing.h
00003 //
00004 #if !defined(__MIXING_H__)
00005 #define __MIXING_H__
00006 
00007 #include "opstruct.h"
00008 //#include "epocglue.h"
00009 #include "6581_.h"
00010 
00011 //
00012 // constants
00013 //
00014 static const int maxLogicalVoices = 4;
00015 static const int mix8monoMiddleIndex = 256*maxLogicalVoices/2;
00016 static const int mix8stereoMiddleIndex = 256*(maxLogicalVoices/2)/2;
00017 static const int mix16monoMiddleIndex = 256*maxLogicalVoices/2;
00018 static const int mix16stereoMiddleIndex = 256*(maxLogicalVoices/2)/2;
00019 
00020 
00021 //
00022 // class Mixer
00023 //
00024 class Mixer// : public sidEmuBase
00025         {
00026 
00027         friend emuEngine;
00028         
00029   public:
00030         Mixer(emuEngine* aEmuEngine, sidEmu* aSidEmu);
00031         ~Mixer();
00032         void MixerInit(bool threeVoiceAmplify, ubyte zero8, uword zero16);
00033         inline void syncEm();
00034         inline void* fillFunc(void* buffer, udword bufferLen) { return (this->*sidEmuFillFunc)(buffer, bufferLen); }
00035         
00036   public:
00037         void* fill8bitMono( void* buffer, udword numberOfSamples );
00038         void* fill8bitMonoControl( void* buffer, udword numberOfSamples );
00039         void* fill8bitStereo( void* buffer, udword numberOfSamples );
00040         void* fill8bitStereoControl( void* buffer, udword numberOfSamples );
00041         void* fill8bitStereoSurround( void* buffer, udword numberOfSamples );
00042         void* fill8bitsplit( void* buffer, udword numberOfSamples );
00043         void* fill16bitMono( void* buffer, udword numberOfSamples );
00044         void* fill16bitMonoControl( void* buffer, udword numberOfSamples );
00045         void* fill16bitStereo( void* buffer, udword numberOfSamples );
00046         void* fill16bitStereoControl( void* buffer, udword numberOfSamples );
00047         void* fill16bitStereoSurround( void* buffer, udword numberOfSamples );
00048         void* fill16bitsplit( void* buffer, udword numberOfSamples );
00049   public:
00050 //void* fill8bitMono(void*, udword); // only need one fill()-prototype here
00051 //      void* (*sidEmuFillFunc)(void*, udword); // default
00052         void* (Mixer::*sidEmuFillFunc)(void*, udword); // default
00053 
00054   private:
00055         sidEmu* iTheSidEmu;
00056     //
00057         ubyte mix8mono[256*maxLogicalVoices];
00058         ubyte mix8stereo[256*(maxLogicalVoices/2)];
00059         uword mix16mono[256*maxLogicalVoices];
00060         uword mix16stereo[256*(maxLogicalVoices/2)];
00061 
00062         sbyte *signedPanMix8;
00063         sword *signedPanMix16;
00064 
00065         ubyte zero8bit;   // ``zero''-sample
00066         uword zero16bit;  // either signed or unsigned
00067         udword splitBufferLen;
00068 
00069         Sample* iTheSampler;
00070         
00071 //      sidOperator& optr1, optr2, optr3;          // -> 6581_.cc
00072 //      uword& voice4_gainLeft, voice4_gainRight;
00073         
00074         };
00075 
00076 
00077 
00078 #endif // MIXING

Generated on Tue Feb 8 04:13:58 2005 for Esidplay by doxygen 1.3.3