00001 /* 00002 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 #ifndef AudioFileMemoryLoader_hxx 00023 #define AudioFileMemoryLoader_hxx 00024 00025 #include <CLAM/Processing.hxx> 00026 #include <CLAM/MonoAudioFileReader.hxx> 00027 #include <CLAM/MonoAudioFileReaderConfig.hxx> 00028 #include <CLAM/AudioOutPort.hxx> 00029 #include <CLAM/OutControl.hxx> 00030 #include <CLAM/InControl.hxx> 00031 00032 namespace CLAM 00033 { 00034 00035 class AudioFileMemoryLoader : public Processing 00036 { 00037 public: 00038 00039 typedef MonoAudioFileReaderConfig Config; 00040 00041 AudioFileMemoryLoader( const ProcessingConfig& cfg = Config() ); 00042 00043 virtual const char* GetClassName() const; 00044 virtual const ProcessingConfig& GetConfig() const; 00045 bool Do( Audio & outputSamples ); 00046 virtual bool Do(); 00047 virtual ~AudioFileMemoryLoader(); 00048 00049 unsigned long GetSamples(); 00050 00051 protected: // methods 00052 00053 virtual bool ConcreteConfigure( const ProcessingConfig& cfgObject ); 00054 virtual bool ConcreteStart(); 00055 00056 protected: // attributes 00057 00058 Config _config; 00059 AudioOutPort _output; 00060 FloatOutControl _timeOutput; 00061 FloatInControl _positionInput; 00062 TControlData _lastPosition; 00063 TControlData _delta; 00064 long _position; 00065 Audio _samples; 00066 TData _sampleRate; 00067 }; 00068 } 00069 00070 #endif // AudioFileMemoryLoader.hxx