//------------------------------------------------------------------------ // // SampleDataLoader.h // // This class shows how to extend the CVisDataLoader class to load some // data. Currently, it only does a Random or Wave waveform. // of CVisInterface pointers. // // ------------------------------------------------------------------- // * COPYRIGHT 2001, Greg Ratajik and Ratajik Software * // * All rights Reserved * // ------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // More information about this program can be found at: // http://www.ratajik.com/VisInterface // C H A N G E L O G // ===================================================================== // Change ID Date Programmer Description // ============ ========= =========== ================================ // 02-05-01 Ratajik Initial Development //------------------------------------------------------------------------ #pragma once #include "VisDataLoader.h" // // Suppored types of data to create // and load. // enum DataLoaderType { TYPE_RANDOM, TYPE_WAVE }; //------------------------------------------------------------------------ // // Class: CSampleDataLoader // // Description: Load some sample data to be rendered. // // Methods // of // Interest: LoadData() // - Fill up to VIS_BUFFER_SIZE // of data into any of the 4 passed buffers. // // IsValid() // - Always returns true for this class. (always valid) // // C H A N G E L O G // =================================================================== // Change ID Date Programmer Description // ============ ========= =========== ================================ // 02-21-01 Ratajik Initial Development //_________________________________________________________________________ class CSampleDataLoader : public CVisDataLoader { public: CSampleDataLoader(); virtual ~CSampleDataLoader(){} virtual bool LoadData(unsigned char *pWaveLeft, unsigned char *pWaveRight, unsigned char *pSpecLeft, unsigned char *pSpecRight); virtual bool IsValid( void ); void SetType(DataLoaderType type) {m_typeData = type;} void ShowWave( bool bDoWave) { m_bDoWave = bDoWave;} void ShowSpec( bool bDoSpec) { m_bDoSpec = bDoSpec;} protected: private: DataLoaderType m_typeData; int m_nLast; bool m_bDoSpec; bool m_bDoWave; };