comparison data/model/WritableWaveFileModel.h @ 1124:efea94b04d5a 3.0-integration

Merge from branch recording
author Chris Cannam
date Thu, 20 Aug 2015 13:15:19 +0100
parents 4d9816ba0ebe b9faee02afa5
children e994747fb9dd
comparison
equal deleted inserted replaced
1118:fbc43d5dc3d1 1124:efea94b04d5a
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _WRITABLE_WAVE_FILE_MODEL_H_ 16 #ifndef WRITABLE_WAVE_FILE_MODEL_H
17 #define _WRITABLE_WAVE_FILE_MODEL_H_ 17 #define WRITABLE_WAVE_FILE_MODEL_H
18 18
19 #include "WaveFileModel.h" 19 #include "WaveFileModel.h"
20 #include "ReadOnlyWaveFileModel.h"
21 #include "PowerOfSqrtTwoZoomConstraint.h"
20 22
21 class WavFileWriter; 23 class WavFileWriter;
22 class WavFileReader; 24 class WavFileReader;
23 25
24 class WritableWaveFileModel : public RangeSummarisableTimeValueModel 26 class WritableWaveFileModel : public WaveFileModel
25 { 27 {
26 Q_OBJECT 28 Q_OBJECT
27 29
28 public: 30 public:
29 WritableWaveFileModel(sv_samplerate_t sampleRate, int channels, QString path = ""); 31 WritableWaveFileModel(sv_samplerate_t sampleRate, int channels, QString path = "");
49 } 51 }
50 52
51 sv_frame_t getFrameCount() const; 53 sv_frame_t getFrameCount() const;
52 int getChannelCount() const { return m_channels; } 54 int getChannelCount() const { return m_channels; }
53 sv_samplerate_t getSampleRate() const { return m_sampleRate; } 55 sv_samplerate_t getSampleRate() const { return m_sampleRate; }
56 sv_samplerate_t getNativeRate() const { return m_sampleRate; }
57
58 QString getTitle() const {
59 if (m_model) return m_model->getTitle();
60 else return "";
61 }
62 QString getMaker() const {
63 if (m_model) return m_model->getMaker();
64 else return "";
65 }
66 QString getLocation() const {
67 if (m_model) return m_model->getLocation();
68 else return "";
69 }
54 70
55 float getValueMinimum() const { return -1.0f; } 71 float getValueMinimum() const { return -1.0f; }
56 float getValueMaximum() const { return 1.0f; } 72 float getValueMaximum() const { return 1.0f; }
57 73
58 virtual sv_frame_t getStartFrame() const { return m_startFrame; } 74 virtual sv_frame_t getStartFrame() const { return m_startFrame; }
76 virtual void toXml(QTextStream &out, 92 virtual void toXml(QTextStream &out,
77 QString indent = "", 93 QString indent = "",
78 QString extraAttributes = "") const; 94 QString extraAttributes = "") const;
79 95
80 protected: 96 protected:
81 WaveFileModel *m_model; 97 ReadOnlyWaveFileModel *m_model;
82 WavFileWriter *m_writer; 98 WavFileWriter *m_writer;
83 WavFileReader *m_reader; 99 WavFileReader *m_reader;
84 sv_samplerate_t m_sampleRate; 100 sv_samplerate_t m_sampleRate;
85 int m_channels; 101 int m_channels;
86 sv_frame_t m_frameCount; 102 sv_frame_t m_frameCount;