DenseTimeValueModel.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_DENSE_TIME_VALUE_MODEL_H
17 #define SV_DENSE_TIME_VALUE_MODEL_H
18 
19 #include <QObject>
20 
21 #include "Model.h"
22 
30 class DenseTimeValueModel : public Model
31 {
32  Q_OBJECT
33 
34 public:
36 
37  virtual ~DenseTimeValueModel() { }
38 
44  virtual float getValueMinimum() const = 0;
45 
51  virtual float getValueMaximum() const = 0;
52 
56  virtual int getChannelCount() const = 0;
57 
67  virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count)
68  const = 0;
69 
76  virtual std::vector<floatvec_t> getMultiChannelData(int fromchannel,
77  int tochannel,
78  sv_frame_t start,
79  sv_frame_t count)
80  const = 0;
81 
82  bool canPlay() const override { return true; }
83  QString getDefaultPlayClipId() const override { return ""; }
84 
85  QVector<QString>
86  getStringExportHeaders(DataExportOptions options) const override;
87 
88  QVector<QVector<QString>>
90  sv_frame_t startFrame,
91  sv_frame_t duration) const override;
92 
93  QString getTypeName() const override { return tr("Dense Time-Value"); }
94 };
95 
96 #endif
virtual int getChannelCount() const =0
Return the number of distinct channels for this model.
virtual std::vector< floatvec_t > getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const =0
Get the specified set of samples from given contiguous range of channels of the model in single-preci...
int64_t sv_frame_t
Frame index, the unit of our time axis.
Definition: BaseTypes.h:31
virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const =0
Get the specified set of samples from the given channel of the model in single-precision floating-poi...
virtual float getValueMinimum() const =0
Return the minimum possible value found in this model type.
QVector< QVector< QString > > toStringExportRows(DataExportOptions options, sv_frame_t startFrame, sv_frame_t duration) const override
Emit events starting within the given range as string rows ready for conversion to an e...
std::vector< float, breakfastquay::StlAllocator< float > > floatvec_t
Definition: BaseTypes.h:53
QString getTypeName() const override
Return the type of the model.
Model is the base class for all data models that represent any sort of data on a time scale based on ...
Definition: Model.h:51
bool canPlay() const override
virtual float getValueMaximum() const =0
Return the minimum possible value found in this model type.
Base class for models containing dense two-dimensional data (value against time). ...
QVector< QString > getStringExportHeaders(DataExportOptions options) const override
Return a label for each column that would be written by toStringExportRows.
QString getDefaultPlayClipId() const override
int DataExportOptions