comparison data/fileio/CodedAudioFileReader.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 f0558e69a074
children d03b3d956358
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
36 enum CacheMode { 36 enum CacheMode {
37 CacheInTemporaryFile, 37 CacheInTemporaryFile,
38 CacheInMemory 38 CacheInMemory
39 }; 39 };
40 40
41 virtual void getInterleavedFrames(size_t start, size_t count, 41 virtual void getInterleavedFrames(int start, int count,
42 SampleBlock &frames) const; 42 SampleBlock &frames) const;
43 43
44 virtual size_t getNativeRate() const { return m_fileRate; } 44 virtual int getNativeRate() const { return m_fileRate; }
45 45
46 /// Intermediate cache means all CodedAudioFileReaders are quickly seekable 46 /// Intermediate cache means all CodedAudioFileReaders are quickly seekable
47 virtual bool isQuicklySeekable() const { return true; } 47 virtual bool isQuicklySeekable() const { return true; }
48 48
49 signals: 49 signals:
50 void progress(int); 50 void progress(int);
51 51
52 protected: 52 protected:
53 CodedAudioFileReader(CacheMode cacheMode, size_t targetRate); 53 CodedAudioFileReader(CacheMode cacheMode, int targetRate);
54 54
55 void initialiseDecodeCache(); // samplerate, channels must have been set 55 void initialiseDecodeCache(); // samplerate, channels must have been set
56 56
57 // may throw InsufficientDiscSpace: 57 // may throw InsufficientDiscSpace:
58 void addSamplesToDecodeCache(float **samples, size_t nframes); 58 void addSamplesToDecodeCache(float **samples, int nframes);
59 void addSamplesToDecodeCache(float *samplesInterleaved, size_t nframes); 59 void addSamplesToDecodeCache(float *samplesInterleaved, int nframes);
60 void addSamplesToDecodeCache(const SampleBlock &interleaved); 60 void addSamplesToDecodeCache(const SampleBlock &interleaved);
61 61
62 // may throw InsufficientDiscSpace: 62 // may throw InsufficientDiscSpace:
63 void finishDecodeCache(); 63 void finishDecodeCache();
64 64
66 66
67 void startSerialised(QString id); 67 void startSerialised(QString id);
68 void endSerialised(); 68 void endSerialised();
69 69
70 private: 70 private:
71 void pushBuffer(float *interleaved, size_t sz, bool final); 71 void pushBuffer(float *interleaved, int sz, bool final);
72 void pushBufferResampling(float *interleaved, size_t sz, float ratio, bool final); 72 void pushBufferResampling(float *interleaved, int sz, float ratio, bool final);
73 void pushBufferNonResampling(float *interleaved, size_t sz); 73 void pushBufferNonResampling(float *interleaved, int sz);
74 74
75 protected: 75 protected:
76 QMutex m_cacheMutex; 76 QMutex m_cacheMutex;
77 CacheMode m_cacheMode; 77 CacheMode m_cacheMode;
78 SampleBlock m_data; 78 SampleBlock m_data;
79 mutable QReadWriteLock m_dataLock; 79 mutable QReadWriteLock m_dataLock;
80 bool m_initialised; 80 bool m_initialised;
81 Serialiser *m_serialiser; 81 Serialiser *m_serialiser;
82 size_t m_fileRate; 82 int m_fileRate;
83 83
84 QString m_cacheFileName; 84 QString m_cacheFileName;
85 SNDFILE *m_cacheFileWritePtr; 85 SNDFILE *m_cacheFileWritePtr;
86 WavFileReader *m_cacheFileReader; 86 WavFileReader *m_cacheFileReader;
87 float *m_cacheWriteBuffer; 87 float *m_cacheWriteBuffer;
88 size_t m_cacheWriteBufferIndex; 88 int m_cacheWriteBufferIndex;
89 size_t m_cacheWriteBufferSize; // frames 89 int m_cacheWriteBufferSize; // frames
90 90
91 Resampler *m_resampler; 91 Resampler *m_resampler;
92 float *m_resampleBuffer; 92 float *m_resampleBuffer;
93 size_t m_fileFrameCount; 93 int m_fileFrameCount;
94 }; 94 };
95 95
96 #endif 96 #endif