mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
ab8f16961e
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
54 lines
985 B
C++
54 lines
985 B
C++
#ifndef B3_READ_WAV_FILE_H
|
|
#define B3_READ_WAV_FILE_H
|
|
|
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
struct b3WavTicker
|
|
{
|
|
b3AlignedObjectArray<double> lastFrame_;
|
|
bool finished_;
|
|
double time_;
|
|
double rate_;
|
|
};
|
|
|
|
class b3ReadWavFile
|
|
{
|
|
bool byteswap_;
|
|
bool wavFile_;
|
|
unsigned long m_numFrames;
|
|
unsigned long dataType_;
|
|
double fileDataRate_;
|
|
FILE *fd_;
|
|
unsigned long dataOffset_;
|
|
unsigned int channels_;
|
|
bool m_machineIsLittleEndian;
|
|
|
|
public:
|
|
b3ReadWavFile();
|
|
virtual ~b3ReadWavFile();
|
|
|
|
b3AlignedObjectArray<double> m_frames;
|
|
|
|
bool getWavInfo(const char *fileName);
|
|
|
|
void normalize(double peak);
|
|
|
|
double interpolate(double frame, unsigned int channel) const;
|
|
double tick(unsigned int channel, b3WavTicker *ticker);
|
|
|
|
void resize();
|
|
|
|
b3WavTicker createWavTicker(double sampleRate);
|
|
|
|
bool read(unsigned long startFrame, bool doNormalize);
|
|
|
|
int getNumFrames() const
|
|
{
|
|
return m_numFrames;
|
|
}
|
|
};
|
|
|
|
#endif //B3_READ_WAV_FILE_H
|