lib/chromaprint/DecoderClient: replace method PrintResult()
This commit is contained in:
parent
9f1c23e217
commit
a30af2ba42
@ -26,7 +26,7 @@ ChromaprintDecoderClient::ChromaprintDecoderClient() = default;
|
|||||||
ChromaprintDecoderClient::~ChromaprintDecoderClient() noexcept = default;
|
ChromaprintDecoderClient::~ChromaprintDecoderClient() noexcept = default;
|
||||||
|
|
||||||
void
|
void
|
||||||
ChromaprintDecoderClient::PrintResult()
|
ChromaprintDecoderClient::Finish()
|
||||||
{
|
{
|
||||||
if (!ready)
|
if (!ready)
|
||||||
throw std::runtime_error("Decoding failed");
|
throw std::runtime_error("Decoding failed");
|
||||||
@ -38,8 +38,6 @@ ChromaprintDecoderClient::PrintResult()
|
|||||||
}
|
}
|
||||||
|
|
||||||
chromaprint.Finish();
|
chromaprint.Finish();
|
||||||
|
|
||||||
printf("%s\n", chromaprint.GetFingerprint().c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -45,7 +45,11 @@ public:
|
|||||||
ChromaprintDecoderClient();
|
ChromaprintDecoderClient();
|
||||||
~ChromaprintDecoderClient() noexcept;
|
~ChromaprintDecoderClient() noexcept;
|
||||||
|
|
||||||
void PrintResult();
|
void Finish();
|
||||||
|
|
||||||
|
std::string GetFingerprint() const {
|
||||||
|
return chromaprint.GetFingerprint();
|
||||||
|
}
|
||||||
|
|
||||||
/* virtual methods from DecoderClient */
|
/* virtual methods from DecoderClient */
|
||||||
void Ready(AudioFormat audio_format,
|
void Ready(AudioFormat audio_format,
|
||||||
|
@ -135,7 +135,8 @@ try {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
client.PrintResult();
|
client.Finish();
|
||||||
|
printf("%s\n", client.GetFingerprint().c_str());
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
PrintException(std::current_exception());
|
PrintException(std::current_exception());
|
||||||
|
Loading…
Reference in New Issue
Block a user