/* ---------------------------------------------------------------------------- WAVESraw.hpp Encapsulates a waveform which will be transmitted (possibly in segments) to the sound system via CHANNEL. The wave object either 'operates' on a supplied memory location, or creates its own internal memory as controlled by the constructor. WAVESraw was created to support GenMon v2.0 in which the calling LabView application would create its own waveforms. So rather than operate on a list of TONES assumed to represent a collection of Sin waves, WAVESraw handles the complete waveform in floating point form. It converts the waveform to a 24 bit digital representation which is left justified in a 32 bit field. This is suitable for direct use by the sound system. NOTE: Latency corrections are no longer performed in this object... this must now be done in the LabView side of the application */ #ifndef _WAVE_ #define _WAVE_ #include "misctyps.h" #include "globals.h" #include "fundtypes.h" #define CYCLEINTERCEPT 21.75154568 // Paste these from Latency.xls #define CYCLESLOPE -0.002125175 class WAVE { //------------- Class construction/destruction public: WAVE ( uInt32 waveSize ); WAVE ( void *pvMem ,uInt32 waveSize ); WAVE ( WAVE &refWAVE ); WAVE ( WAVE *pWAVE ); ~WAVE ( void ); //------------- Class overloaded operators WAVE &operator += ( WAVE &rhs ); // rhs means right hand side of equation WAVE operator + ( WAVE &rhs ); // Addition operator WAVE &operator -= ( WAVE &rhs ); WAVE operator - ( void ); // Negation or unary minus WAVE operator - ( WAVE &rhs ); // Subtraction WAVE &operator = ( WAVE &rhs ); // Assignment operator //------------- Class methods void make ( void ); // Calculates a waveform void link ( void *pWave ); // Links waveform to memory location void modify ( float32 *pWave ); // Changes a waveform void convert ( WAVEPTR pWAVEtoConvert ,long WaveLen ); // Converts binary waveform to floating point waveform void show ( uint NumPtsToShow ); // Prints out part of a waveform void show ( void ); // dumps whole waveform private: void Init ( void *pvMem ,uInt32 waveSize ); // Performs common initialization void copy ( WAVE *pWAVE ); // Workhorse copy construction //------------- Member variables public: WAVEPTR m_pWAVE ,m_pWVcopy; // Ultimate storage of the waveform uint m_Init; // Flag for tracking initialization uint m_Len; // Length of waveform //------------- Global to all waveforms, otherwise +/-/= become fuzzy or at least overly awkward static uint g_Width; // Total bit width of waveform static int g_Shifts; // Justification of waveform static long g_Len; // Length of waveform for all wave objects private: }; #endif