00001 #ifndef WAVECACHE_H 00002 #define WAVECACHE_H 00003 00004 00005 00006 // Store audio waveform fragments for drawing. 00007 #include "cachebase.h" 00008 00009 00010 class WaveCacheItem : public CacheItemBase 00011 { 00012 public: 00013 WaveCacheItem(); 00014 ~WaveCacheItem(); 00015 00016 int get_size(); 00017 00018 int channel; 00019 // End sample in asset samplerate. Starting point is CacheItemBase::position 00020 int64_t end; 00021 double high; 00022 double low; 00023 }; 00024 00025 00026 00027 00028 00029 class WaveCache : public CacheBase 00030 { 00031 public: 00032 WaveCache(); 00033 ~WaveCache(); 00034 00035 // Returns the first item on or after the start argument or 0 if none found. 00036 WaveCacheItem* get_wave(int asset_id, 00037 int channel, 00038 int64_t start, 00039 int64_t end); 00040 // Put waveform segment into cache 00041 void put_wave(Asset *asset, 00042 int channel, 00043 int64_t start, 00044 int64_t end, 00045 double high, 00046 double low); 00047 }; 00048 00049 00050 00051 #endif
1.5.5