SynthLab SDK
wavedata.h
1 
2 #ifndef __wavedata_h__
3 #define __wavedata_h__
4 
5 namespace SynthLab
6 {
7  // This is a helper object for reading Wave files into floating point buffers.
8  // It is NOT optimized for speed (yet)
9 #if defined _WINDOWS || defined _WINDLL
10 //#include <windows.h>
11 
12 // wave file parser
13  class WaveData
14  {
15  public: // Functions
16  //
17  // One Time Initialization
18  // pFilePath is the FULLY qualified file name + additional path info
19  // VALID Examples: audio.wav
20  // //samples//audio.wav
21  WaveData(const char* pFilePath);
22 
23  // One Time Destruction
24  ~WaveData(void);
25 
26  unsigned int m_uNumChannels;
27  unsigned int m_uSampleRate;
28  unsigned int m_uSampleCount;
29  unsigned int m_uLoopCount;
30  unsigned int m_uLoopStartIndex;
31  unsigned int m_uLoopEndIndex;
32  unsigned int m_uLoopType;
33  unsigned int m_uMIDINote;
34  unsigned int m_uMIDIPitchFraction;
35  unsigned int m_uSMPTEFormat;
36  unsigned int m_uSMPTEOffset;
37 
38  bool m_bWaveLoaded;
39 
40  // --- the WAV file converted to floats on range of -1.0 --> +1.0
41  float* m_pWaveBuffer = nullptr;
42 
43  protected:
44  bool readWaveFile(const char* pFilePath);
45  void* m_hFile;
46  };
47 
48 #else // MacOS Version here!
49 
50 // wave file parser
51  class WaveData
52  {
53  public: // Functions
54  //
55  // One Time Initialization
56  // pFilePath is the FULLY qualified file name + additional path info
57  // VALID Examples: audio.wav
58  // //samples//audio.wav
59  WaveData(const char* pFilePath);
60 
61  // One Time Destruction
62  ~WaveData(void);
63 
64  UINT m_uNumChannels;
65  UINT m_uSampleRate;
66  UINT m_uSampleCount;
67  UINT m_uLoopCount;
68  UINT m_uLoopStartIndex;
69  UINT m_uLoopEndIndex;
70  UINT m_uLoopType;
71  UINT m_uMIDINote;
72  UINT m_uMIDIPitchFraction;
73  UINT m_uSMPTEFormat;
74  UINT m_uSMPTEOffset;
75 
76  bool m_bWaveLoaded;
77 
78  // the WAV file converted to floats on range of -1.0 --> +1.0
79  float* m_pWaveBuffer;
80 
81  protected:
82  bool readWaveFile(const char* pFilePath);
83  };
84 
85 #endif
86 
87 #endif
88 
89 }
Definition: analogegcore.cpp:4
Definition: wavedata.h:51