/************************************************************************************** PROTUX - THE FREE PROFESSIONAL AUDIO TOOLS FOR LINUX AUTHOR : See AUTHORS file for details This software is distributed under the terms of the GNU General Public License as specified in the COPYING file. ***************************************************************************************/ #ifndef PEAK_HH #define PEAK_HH #include #include #include class Audio; class Peak : public MustuxEngine { Q_OBJECT public: Peak(); ~Peak(); /** Instantiate a Peak Object and generate RAM buffers containing the peak images for * zoom levels equal or greater than 6. Zoom levels between 1 and 5 uses "real-peak" * images (peaks which are read direct from the audio file); */ int build(Audio* audiosource, QProgressBar *monitorProgressBar = 0); /** Deallocate memory resources allocated by build() */ int unbuild(); /** Receives an empty buffer and fills it with peaks, according to the zoom level passed. */ int fill_buffer(short* bufferToFill, long long startBlock, int numBlocksToFill , int hzoom); /** Display information about the RAM buffers on the console */ void show_info(); /** Save the ram buffers images to a .peak file */ int save(); /** Load the ram buffers from .peak file previously saved*/ int load(); static const int MAX_ZOOM_LEVELS=31; static const int MAX_ZOOM_USING_SOURCEFILE; static const int zoomStep[MAX_ZOOM_LEVELS]; private : Audio* audioSource; FILE* audioSourceFile; long long audioSourceFileSize; long long audioSize; short* RAMBuffer[MAX_ZOOM_LEVELS]; long long RAMBufferSize[MAX_ZOOM_LEVELS]; short* tempRAMBuffer; int totalRAMBufferSize; int headerSize; int blockSize; int channels; int rate; int bitDepth; public slots: }; #include "Audio.hh" #endif //eof