This repository was archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 284
Expand file tree
/
Copy pathCodegen.h
More file actions
52 lines (41 loc) · 1.26 KB
/
Codegen.h
File metadata and controls
52 lines (41 loc) · 1.26 KB
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
//
// echoprint-codegen
// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
#ifndef CODEGEN_H
#define CODEGEN_H
// Entry point for generating codes from PCM data.
#define ECHOPRINT_VERSION 4.12
#include <string>
#include <vector>
#ifdef _MSC_VER
#ifdef CODEGEN_EXPORTS
#define CODEGEN_API __declspec(dllexport)
#pragma message("Exporting codegen.dll")
#else
#define CODEGEN_API __declspec(dllimport)
#pragma message("Importing codegen.dll")
#endif
#else
#define CODEGEN_API
#endif
class Fingerprint;
class SubbandAnalysis;
struct FPCode;
class CODEGEN_API Codegen {
public:
Codegen(const float* pcm, unsigned int numSamples, int start_offset);
std::string getCodeString(bool human_readable);
int getNumCodes(){return _NumCodes;}
static double getVersion() { return ECHOPRINT_VERSION; }
private:
Fingerprint* computeFingerprint(SubbandAnalysis *pSubbandAnalysis, int start_offset);
std::string createCodeString(std::vector<FPCode> vCodes);
std::string createCodeStringJSON(std::vector<FPCode> vCodes);
std::string compress(const std::string& s);
std::string _CodeString;
int _NumCodes;
bool is_code_string_cached[2];
std::string code_string_cache[2];
};
#endif