1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#ifndef _SndSinIO_h
#define _SndSinIO_h
#include "SndWaveX.h"
#include "SndPVOCEX.h"
struct sinus_data {
short wWordFormat;
short wHopsize;
short wWindowType;
short wMaxtracks;
int dwWindowSize;
float fThreshold;
float fAnalysisRate;
};
struct sinusex {
int dwVersion;
sinus_data data;
};
struct WAVEFORMATSINUSEX {
wave_head waveformatex;
wav_ex waveformat_ext;
sinusex sinusformat_ext;
};
const GUID KSDATAFORMAT_SUBTYPE_SINUS = {
0x443a4b58,
0x21a2,
0x324b,
{ 0x00, 0x01, 0xAA, 0x02, 0x11, 0x03, 0xBB, 0x04 }
};
class SndSinIO : public SndWaveX {
protected:
sinusex m_sinheader;
int m_hopsize;
int* m_tracks;
int** m_trkindx;
int m_maxtracks;
public:
SndSinIO(char* name, int maxtracks, float threshold=0.01f,
int windowtype=HANNING, short mode = OVERWRITE,
short channels=1, int channelmask=0, short bits=32, int format=PCM,
SndObj** inputlist=0, float framepos= 0.f, int hopsize = DEF_VECSIZE,
int fftsize = DEF_FFTSIZE, float sr = DEF_SR);
~SndSinIO();
short Write();
short Read();
int GetTrackID(int track, int channel) { return m_trkindx[channel][track];}
int GetTracks(int channel) { return m_tracks[channel]; }
int GetFFTSize(){ return m_sinheader.data.dwWindowSize;}
int GetHopSize(){ return m_sinheader.data.wHopsize; }
int GetWindowType() { return m_sinheader.data.wWindowType; }
int GetMaxTracks() { return m_sinheader.data.wMaxtracks; }
void GetHeader(WAVEFORMATSINUSEX* pheader);
void SetTimePos(float pos);
};
#endif
|