comparison data/model/WaveFileModel.h @ 929:59e7fe1b1003 warnfix_no_size_t

Unsigned removals and warning fixes in data/
author Chris Cannam
date Tue, 17 Jun 2014 14:33:42 +0100
parents 29efe322ab47
children 6d2ece0fe356
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
32 class WaveFileModel : public RangeSummarisableTimeValueModel 32 class WaveFileModel : public RangeSummarisableTimeValueModel
33 { 33 {
34 Q_OBJECT 34 Q_OBJECT
35 35
36 public: 36 public:
37 WaveFileModel(FileSource source, size_t targetRate = 0); 37 WaveFileModel(FileSource source, int targetRate = 0);
38 WaveFileModel(FileSource source, AudioFileReader *reader); 38 WaveFileModel(FileSource source, AudioFileReader *reader);
39 ~WaveFileModel(); 39 ~WaveFileModel();
40 40
41 bool isOK() const; 41 bool isOK() const;
42 bool isReady(int *) const; 42 bool isReady(int *) const;
43 43
44 const ZoomConstraint *getZoomConstraint() const { return &m_zoomConstraint; } 44 const ZoomConstraint *getZoomConstraint() const { return &m_zoomConstraint; }
45 45
46 size_t getFrameCount() const; 46 int getFrameCount() const;
47 size_t getChannelCount() const; 47 int getChannelCount() const;
48 size_t getSampleRate() const; 48 int getSampleRate() const;
49 size_t getNativeRate() const; 49 int getNativeRate() const;
50 50
51 QString getTitle() const; 51 QString getTitle() const;
52 QString getMaker() const; 52 QString getMaker() const;
53 QString getLocation() const; 53 QString getLocation() const;
54 54
55 virtual Model *clone() const; 55 virtual Model *clone() const;
56 56
57 float getValueMinimum() const { return -1.0f; } 57 float getValueMinimum() const { return -1.0f; }
58 float getValueMaximum() const { return 1.0f; } 58 float getValueMaximum() const { return 1.0f; }
59 59
60 virtual size_t getStartFrame() const { return m_startFrame; } 60 virtual int getStartFrame() const { return m_startFrame; }
61 virtual size_t getEndFrame() const { return m_startFrame + getFrameCount(); } 61 virtual int getEndFrame() const { return m_startFrame + getFrameCount(); }
62 62
63 void setStartFrame(size_t startFrame) { m_startFrame = startFrame; } 63 void setStartFrame(int startFrame) { m_startFrame = startFrame; }
64 64
65 virtual size_t getData(int channel, size_t start, size_t count, 65 virtual int getData(int channel, int start, int count,
66 float *buffer) const; 66 float *buffer) const;
67 67
68 virtual size_t getData(int channel, size_t start, size_t count, 68 virtual int getData(int channel, int start, int count,
69 double *buffer) const; 69 double *buffer) const;
70 70
71 virtual size_t getData(size_t fromchannel, size_t tochannel, 71 virtual int getData(int fromchannel, int tochannel,
72 size_t start, size_t count, 72 int start, int count,
73 float **buffers) const; 73 float **buffers) const;
74 74
75 virtual size_t getSummaryBlockSize(size_t desired) const; 75 virtual int getSummaryBlockSize(int desired) const;
76 76
77 virtual void getSummaries(size_t channel, size_t start, size_t count, 77 virtual void getSummaries(int channel, int start, int count,
78 RangeBlock &ranges, 78 RangeBlock &ranges,
79 size_t &blockSize) const; 79 int &blockSize) const;
80 80
81 virtual Range getSummary(size_t channel, size_t start, size_t count) const; 81 virtual Range getSummary(int channel, int start, int count) const;
82 82
83 QString getTypeName() const { return tr("Wave File"); } 83 QString getTypeName() const { return tr("Wave File"); }
84 84
85 virtual void toXml(QTextStream &out, 85 virtual void toXml(QTextStream &out,
86 QString indent = "", 86 QString indent = "",
98 public: 98 public:
99 RangeCacheFillThread(WaveFileModel &model) : 99 RangeCacheFillThread(WaveFileModel &model) :
100 m_model(model), m_fillExtent(0), 100 m_model(model), m_fillExtent(0),
101 m_frameCount(model.getFrameCount()) { } 101 m_frameCount(model.getFrameCount()) { }
102 102
103 size_t getFillExtent() const { return m_fillExtent; } 103 int getFillExtent() const { return m_fillExtent; }
104 virtual void run(); 104 virtual void run();
105 105
106 protected: 106 protected:
107 WaveFileModel &m_model; 107 WaveFileModel &m_model;
108 size_t m_fillExtent; 108 int m_fillExtent;
109 size_t m_frameCount; 109 int m_frameCount;
110 }; 110 };
111 111
112 void fillCache(); 112 void fillCache();
113 113
114 FileSource m_source; 114 FileSource m_source;
115 QString m_path; 115 QString m_path;
116 AudioFileReader *m_reader; 116 AudioFileReader *m_reader;
117 bool m_myReader; 117 bool m_myReader;
118 118
119 size_t m_startFrame; 119 int m_startFrame;
120 120
121 RangeBlock m_cache[2]; // interleaved at two base resolutions 121 RangeBlock m_cache[2]; // interleaved at two base resolutions
122 mutable QMutex m_mutex; 122 mutable QMutex m_mutex;
123 RangeCacheFillThread *m_fillThread; 123 RangeCacheFillThread *m_fillThread;
124 QTimer *m_updateTimer; 124 QTimer *m_updateTimer;
125 size_t m_lastFillExtent; 125 int m_lastFillExtent;
126 bool m_exiting; 126 bool m_exiting;
127 static PowerOfSqrtTwoZoomConstraint m_zoomConstraint; 127 static PowerOfSqrtTwoZoomConstraint m_zoomConstraint;
128 128
129 mutable SampleBlock m_directRead; 129 mutable SampleBlock m_directRead;
130 mutable size_t m_lastDirectReadStart; 130 mutable int m_lastDirectReadStart;
131 mutable size_t m_lastDirectReadCount; 131 mutable int m_lastDirectReadCount;
132 mutable QMutex m_directReadMutex; 132 mutable QMutex m_directReadMutex;
133 }; 133 };
134 134
135 #endif 135 #endif