/
trm.h
85 lines (64 loc) · 2.53 KB
/
trm.h
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
74
75
76
77
78
79
80
81
82
83
84
85
/* --------------------------------------------------------------------------
MusicBrainz -- The Internet music metadatabase
Copyright (C) 2000 Robert Kaye
Copyright (C) Relatable
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id$
----------------------------------------------------------------------------*/
#ifndef _TRM_H_
#define _TRM_H_
#include <string>
#include <vector>
using namespace std;
class TRM
{
public:
TRM(void);
virtual ~TRM(void);
bool SetProxy (const string &proxyAddr, short proxyPort);
bool SetPCMDataInfo (int samplesPerSecond, int numChannels,
int bitsPerSample);
bool GenerateSignature (char *data, int size);
int FinalizeSignature(string &strGUID, string &collID);
void ConvertSigToASCII(char sig[17], char ascii_sig[37]);
void SetSongLength(long seconds);
private:
void DownmixPCM(void);
int CountBeats(void);
int m_bits_per_sample;
int m_samples_per_second;
int m_number_of_channels;
long m_downmix_size;
int m_finishedFFTs;
signed short *m_downmixBuffer;
char *m_storeBuffer;
long m_numBytesNeeded;
long m_numBytesWritten;
long m_numSamplesWritten;
double fWin[64];
double fftBuffer[64];
double fftBuffer2[64];
double freqs[32];
float fLastFFT[32];
float *beatStore;
int beatindex;
string m_proxy;
short m_proxyPort;
#ifdef WIN32
__int64 m_song_samples;
#else
long long m_song_samples;
#endif
long m_song_seconds;
};
#endif