#include <Peaks.h>
Public Member Functions | |
Peaks (Loader *ld, const track_t itrack, const wxString &name, const ratio_t density) | |
Constructor. | |
~Peaks () | |
Destructor. | |
bool | Synchronize (wxWindow *parent) |
Update peaks with visual feedback. | |
bool | GetPeak (const samples_t ppos, const ratio_t density, floatsample_t &peak) |
Get a single peak. | |
Private Member Functions | |
bool | write_header (const length_t length) |
Write cache file header. | |
bool | check_header (const length_t length) |
Check cache file header. | |
void | not_persistent () |
Switch off the cache. | |
Private Attributes | |
Loader * | loader |
Loader. | |
track_t | track |
Subtrack. | |
bool | empty |
Empty flag. | |
wxFile * | peaks |
Peaks persistent file. | |
ratio_t | ratio |
Display ratio. | |
off_t | stamppos |
Position of the stamp in cache file. | |
off_t | datapos |
Position of the first peak in cache file. |
Peak class is used to quickly access audio track peaks to display the waveform on screen. The class uses memory and disk cache for the peak data and maintains persistent peak file for each track.
|
Constructor. Create a peak object from wave data supplied by 'ld' (internal track 'itrack') and store the cache to file 'name' with default zoom ratio 'density'.
|
|
Destructor. Close peak file and cleanup. |
|
Check cache file header. Switch off any peak caching, all peak values are calculated on-the-fly. |
|
Get a single peak. Get a single peak from the cache. If 'density' is any of the zoom ratios precached, then get the peak from the cache, otherwise calculate the peak value on-the-fly.
|
|
Switch off the cache.
|
|
Update peaks with visual feedback. Update the peak cache (peak file) from data from the loader. Give a visual feedback the update process.
|
|
Write cache file header. Write a header (tag, version, etc.) to the peak file.
|
|
Position of the first peak in cache file.
|
|
Empty flag.
|
|
|
|
Peaks persistent file.
|
|
Display ratio.
|
|
Position of the stamp in cache file.
|
|
Subtrack.
|