00001 /*********************************************************************** 00002 00003 FinalMix: Peaks.h 00004 by Martin Decky 00005 00006 Redistribution of this file is permitted under the GNU Public License. 00007 00008 0.9.2 Initial 00009 0.9.5 Cleanup 00010 00011 **********************************************************************/ 00012 00013 00014 #ifndef _FM_PEAKS_H_ 00015 #define _FM_PEAKS_H_ 00016 00017 00018 #include "generic.h" 00019 #include "Loaders.h" 00020 00021 00022 #define PEAK_MAX 1.0 00023 00024 00032 class Peaks { 00033 public: 00034 Peaks(Loader * ld, const track_t itrack, const wxString & name, const ratio_t density); 00035 ~Peaks(); 00037 bool Synchronize(wxWindow * parent); 00038 bool GetPeak(const samples_t ppos, const ratio_t density, floatsample_t & peak); 00039 private: 00040 Loader * loader; 00041 track_t track; 00042 bool empty; 00043 wxFile * peaks; 00044 ratio_t ratio; 00045 off_t stamppos; 00046 off_t datapos; 00048 bool write_header(const length_t length); 00049 bool check_header(const length_t length); 00051 void not_persistent(); 00052 }; 00053 00054 #endif