EditableDenseThreeDimensionalModel.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 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 _EDITABLE_DENSE_THREE_DIMENSIONAL_MODEL_H_
00017 #define _EDITABLE_DENSE_THREE_DIMENSIONAL_MODEL_H_
00018 
00019 #include "DenseThreeDimensionalModel.h"
00020 
00021 class EditableDenseThreeDimensionalModel : public DenseThreeDimensionalModel
00022 {
00023     Q_OBJECT
00024 
00025 public:
00026     EditableDenseThreeDimensionalModel(size_t sampleRate,
00027                                        size_t resolution,
00028                                        size_t yBinCount,
00029                                        bool notifyOnAdd = true);
00030 
00031     virtual bool isOK() const;
00032 
00033     virtual size_t getSampleRate() const;
00034     virtual size_t getStartFrame() const;
00035     virtual size_t getEndFrame() const;
00036 
00037     virtual Model *clone() const;
00038     
00039 
00043     virtual size_t getResolution() const;
00044 
00048     virtual void setResolution(size_t sz);
00049 
00053     virtual size_t getWidth() const;
00054 
00058     virtual size_t getHeight() const; 
00059 
00063     virtual void setHeight(size_t sz);
00064 
00068     virtual float getMinimumLevel() const;
00069 
00073     virtual void setMinimumLevel(float sz);
00074 
00078     virtual float getMaximumLevel() const;
00079 
00083     virtual void setMaximumLevel(float sz);
00084 
00088     virtual bool isColumnAvailable(size_t x) const { return x < getWidth(); }
00089 
00093     virtual void getColumn(size_t x, Column &) const;
00094 
00098     virtual float getValueAt(size_t x, size_t n) const;
00099 
00103     virtual void setColumn(size_t x, const Column &values);
00104 
00105     virtual QString getBinName(size_t n) const;
00106     virtual void setBinName(size_t n, QString);
00107     virtual void setBinNames(std::vector<QString> names);
00108 
00109     virtual void setCompletion(int completion, bool update = true);
00110     virtual int getCompletion() const { return m_completion; }
00111 
00112     QString getTypeName() const { return tr("Editable Dense 3-D"); }
00113 
00114     virtual QString toDelimitedDataString(QString delimiter) const;
00115 
00116     virtual void toXml(QTextStream &out,
00117                        QString indent = "",
00118                        QString extraAttributes = "") const;
00119 
00120 protected:
00121     typedef std::vector<Column> ValueMatrix;
00122     ValueMatrix m_data;
00123 
00124     std::vector<QString> m_binNames;
00125 
00126     size_t m_sampleRate;
00127     size_t m_resolution;
00128     size_t m_yBinCount;
00129     float m_minimum;
00130     float m_maximum;
00131     bool m_haveExtents;
00132     bool m_notifyOnAdd;
00133     long m_sinceLastNotifyMin;
00134     long m_sinceLastNotifyMax;
00135     int m_completion;
00136 
00137     mutable QMutex m_mutex;
00138 };
00139 
00140 #endif

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