RangeSummarisableTimeValueModel.h

Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006-2007 Chris Cannam and QMUL.
00008     
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _RANGE_SUMMARISABLE_TIME_VALUE_MODEL_H_
00017 #define _RANGE_SUMMARISABLE_TIME_VALUE_MODEL_H_
00018 
00019 #include <QObject>
00020 
00021 #include "DenseTimeValueModel.h"
00022 #include "base/ZoomConstraint.h"
00023 
00031 class RangeSummarisableTimeValueModel : public DenseTimeValueModel
00032 {
00033     Q_OBJECT
00034 
00035 public:
00036     RangeSummarisableTimeValueModel() { }
00037 
00038     struct Range
00039     {
00040         float min;
00041         float max;
00042         float absmean;
00043         Range() : 
00044             min(0.f), max(0.f), absmean(0.f) { }
00045         Range(const Range &r) : 
00046             min(r.min), max(r.max), absmean(r.absmean) { }
00047         Range(float min_, float max_, float absmean_) :
00048             min(min_), max(max_), absmean(absmean_) { }
00049     };
00050 
00051     typedef std::vector<Range> RangeBlock;
00052 
00064     virtual void getSummaries(size_t channel, size_t start, size_t count,
00065                               RangeBlock &ranges,
00066                               size_t &blockSize) const = 0;
00067 
00073     virtual Range getSummary(size_t channel, size_t start, size_t count) const = 0;
00074 
00075     virtual size_t getSummaryBlockSize(size_t desired) const = 0;
00076 
00077     QString getTypeName() const { return tr("Range-Summarisable Time-Value"); }
00078 };
00079 
00080 #endif
00081 

Generated on Wed Feb 20 15:45:27 2008 for SonicVisualiser by  doxygen 1.5.1