Lines 25-30
Link Here
|
25 |
|
25 |
|
26 |
QString ChromaPrinter::calcFingerPrint(const Mixxx::SoundSourcePointer& pSoundSource) { |
26 |
QString ChromaPrinter::calcFingerPrint(const Mixxx::SoundSourcePointer& pSoundSource) { |
27 |
|
27 |
|
|
|
28 |
// Type declarations of *fprint and *encoded pointers need to account for Chromaprint API version |
29 |
// (void* -> uint32_t*) and (void* -> char*) changed in versions v1.4.0 or later -- alyptik 12/2016 |
30 |
#if (CHROMAPRINT_VERSION_MINOR > 3) || (CHROMAPRINT_VERSION_MAJOR > 1) |
31 |
typedef uint32_t* uint32_p; |
32 |
typedef char* char_p; |
33 |
#else |
34 |
typedef void* uint32_p; |
35 |
typedef void* char_p; |
36 |
#endif |
37 |
|
28 |
// this is worth 2min of audio, multiply by 2 because we have 2 channels |
38 |
// this is worth 2min of audio, multiply by 2 because we have 2 channels |
29 |
// AcoustID only stores a fingerprint for the first two minutes of a song |
39 |
// AcoustID only stores a fingerprint for the first two minutes of a song |
30 |
// on their server so we need only a fingerprint of the first two minutes |
40 |
// on their server so we need only a fingerprint of the first two minutes |
Lines 57-68
Link Here
|
57 |
} |
67 |
} |
58 |
chromaprint_finish(ctx); |
68 |
chromaprint_finish(ctx); |
59 |
|
69 |
|
60 |
void* fprint = NULL; |
70 |
uint32_p fprint = NULL; |
61 |
int size = 0; |
71 |
int size = 0; |
62 |
int ret = chromaprint_get_raw_fingerprint(ctx, &fprint, &size); |
72 |
int ret = chromaprint_get_raw_fingerprint(ctx, &fprint, &size); |
63 |
QByteArray fingerprint; |
73 |
QByteArray fingerprint; |
64 |
if (ret == 1) { |
74 |
if (ret == 1) { |
65 |
void* encoded = NULL; |
75 |
char_p encoded = NULL; |
66 |
int encoded_size = 0; |
76 |
int encoded_size = 0; |
67 |
chromaprint_encode_fingerprint(fprint, size, |
77 |
chromaprint_encode_fingerprint(fprint, size, |
68 |
CHROMAPRINT_ALGORITHM_DEFAULT, |
78 |
CHROMAPRINT_ALGORITHM_DEFAULT, |