WaveFileModel.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 and QMUL.
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_WAVE_FILE_MODEL_H
17 #define SV_WAVE_FILE_MODEL_H
18 
20 
21 #include <stdlib.h>
22 
24 {
25  Q_OBJECT
26 
27 public:
28  virtual ~WaveFileModel();
29 
30  virtual sv_frame_t getFrameCount() const = 0;
31  int getChannelCount() const override = 0;
32  sv_samplerate_t getSampleRate() const override = 0;
33  sv_samplerate_t getNativeRate() const override = 0;
34 
35  QString getTitle() const override = 0;
36  QString getMaker() const override = 0;
37  QString getLocation() const override = 0;
38 
39  sv_frame_t getStartFrame() const override = 0;
40  sv_frame_t getTrueEndFrame() const override = 0;
41 
42  virtual void setStartFrame(sv_frame_t startFrame) = 0;
43 
44 protected:
45  WaveFileModel() { } // only accessible from subclasses
46 };
47 
48 #endif
double sv_samplerate_t
Sample rate.
Definition: BaseTypes.h:51
int64_t sv_frame_t
Frame index, the unit of our time axis.
Definition: BaseTypes.h:31
sv_frame_t getStartFrame() const override=0
Return the first audio frame spanned by the model.
sv_samplerate_t getSampleRate() const override=0
Return the frame rate in frames per second.
virtual void setStartFrame(sv_frame_t startFrame)=0
sv_samplerate_t getNativeRate() const override=0
Return the frame rate of the underlying material, if the model itself has already been resampled...
virtual sv_frame_t getFrameCount() const =0
QString getTitle() const override=0
Return the "work title" of the model, if known.
QString getLocation() const override=0
Return the location of the data in this model (e.g.
int getChannelCount() const override=0
Return the number of distinct channels for this model.
virtual ~WaveFileModel()
sv_frame_t getTrueEndFrame() const override=0
Return the audio frame at the end of the model.
Base class for models containing dense two-dimensional data (value against time) that may be meaningf...
QString getMaker() const override=0
Return the "artist" or "maker" of the model, if known.