//------------------------------------------------------------------------ // // SimpleDataLoader.cpp // // This class shows how to extend the CVisDataLoader class to load some // data. Currently, it only does a Random or Wave waveform. // // ------------------------------------------------------------------- // * 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-21-01 Ratajik Initial Development //------------------------------------------------------------------------ #include "Stdafx.h" #include "VisInterface.h" #include "SimpleDataLoader.h" //------------------------------------------------------------------------ // // Method: CSimpleDataLoader // // Description: The ctor // // Parms: N/A // // Return: N/A // // Exceptions: N/A // // C H A N G E L O G // ===================================================================== // Change ID Date Programmer Description // ============ ========= =========== ================================ // 02-21-01 Ratajik Initial Development //_________________________________________________________________________ CSimpleDataLoader::CSimpleDataLoader() { } //------------------------------------------------------------------------ // // Method: LoadData // // Description: Using the passed pointers, load the data. This only does // two very basic waveforms. Others will be added later... // // Parms: unsigned char * - Waveform left channel // unsigned char * - Waveform right channel // unsigned char * - Spec left channel // unsigned char * - Spec right channel // // Return: bool - TRUE = worked // // Exceptions: N/A // // C H A N G E L O G // ===================================================================== // Change ID Date Programmer Description // ============ ========= =========== ================================ // 02-21-01 Ratajik Initial Development //_________________________________________________________________________ bool CSimpleDataLoader::LoadData(unsigned char *pWaveLeft, unsigned char *pWaveRight, unsigned char *pSpecLeft, unsigned char *pSpecRight) { ASSERT(pWaveLeft && pSpecLeft); int i; if(pWaveLeft && pSpecLeft && pSpecLeft && pSpecRight) { // // Fill for the size of the buffer. // for( i = 0; i < VIS_BUFFER_SIZE;i++ ) { pSpecLeft [i] = rand(); pSpecRight[i] = rand(); pWaveLeft [i] = rand(); pWaveRight[i] = rand(); } return(true); } else return(false); } //------------------------------------------------------------------------ // // Method: IsValid // // Description: This is a very simple one, so it's ALWAYS valid.... // // Parms: N/A // // Return: bool - TRUE = is Valid. // // Exceptions: N/A // // C H A N G E L O G // ===================================================================== // Change ID Date Programmer Description // ============ ========= =========== ================================ // 02-21-01 Ratajik Initial Development //_________________________________________________________________________ bool CSimpleDataLoader::IsValid( void ) { return(true); }