comparison data/model/DenseTimeValueModel.h @ 1096:4d9816ba0ebe simple-fft-model

Rework audio file reader API to prefer using std containers
author Chris Cannam
date Mon, 15 Jun 2015 12:19:47 +0100
parents 9f4505ac9072
children 54af1e21705c
comparison
equal deleted inserted replaced
1095:b66734b5f806 1096:4d9816ba0ebe
55 */ 55 */
56 virtual int getChannelCount() const = 0; 56 virtual int getChannelCount() const = 0;
57 57
58 /** 58 /**
59 * Get the specified set of samples from the given channel of the 59 * Get the specified set of samples from the given channel of the
60 * model in single-precision floating-point format. Return the 60 * model in single-precision floating-point format. Returned
61 * number of samples actually retrieved. 61 * vector may have fewer samples than requested, if the end of
62 * file was reached.
63 *
62 * If the channel is given as -1, mix all available channels and 64 * If the channel is given as -1, mix all available channels and
63 * return the result. 65 * return the result.
64 */ 66 */
65 virtual sv_frame_t getData(int channel, sv_frame_t start, sv_frame_t count, 67 virtual std::vector<float> getData(int channel, sv_frame_t start, sv_frame_t count) const = 0;
66 float *buffer) const = 0;
67 68
68 /** 69 /**
69 * Get the specified set of samples from given contiguous range 70 * Get the specified set of samples from given contiguous range of
70 * of channels of the model in single-precision floating-point 71 * channels of the model in single-precision floating-point
71 * format. Return the number of sample frames actually retrieved. 72 * format. Returned vector may have fewer samples than requested,
73 * if the end of file was reached.
72 */ 74 */
73 virtual sv_frame_t getMultiChannelData(int fromchannel, int tochannel, 75 virtual std::vector<std::vector<float>> getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const = 0;
74 sv_frame_t start, sv_frame_t count,
75 float **buffers) const = 0;
76 76
77 virtual bool canPlay() const { return true; } 77 virtual bool canPlay() const { return true; }
78 virtual QString getDefaultPlayClipId() const { return ""; } 78 virtual QString getDefaultPlayClipId() const { return ""; }
79 79
80 virtual QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const; 80 virtual QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const;