wchess minor

This commit is contained in:
Fraxy V 2023-11-28 16:21:46 +02:00
parent 8dba8204eb
commit 02ade14f67
4 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(libwchess)

View File

@ -48,9 +48,8 @@ bool WChess::check_running() const {
return false;
}
bool WChess::clear_audio() const {
if (m_cb.clear_audio) return (*m_cb.clear_audio)();
return false;
void WChess::clear_audio() const {
if (m_cb.clear_audio) (*m_cb.clear_audio)();
}
void WChess::get_audio(int ms, std::vector<float>& pcmf32) const {

View File

@ -12,14 +12,14 @@ public:
using CheckRunningCb = bool (*)();
using GetAudioCb = void (*)(int, std::vector<float> &);
using SetMovesCb = void (*)(const std::string &);
using CleartAudioCb = bool (*)();
using ClearAudioCb = void (*)();
struct callbacks {
SetStatusCb set_status = nullptr;
CheckRunningCb check_running = nullptr;
GetAudioCb get_audio = nullptr;
SetMovesCb set_moves = nullptr;
CleartAudioCb clear_audio = nullptr;
ClearAudioCb clear_audio = nullptr;
};
struct settings {
@ -46,7 +46,7 @@ private:
void set_status(const std::string& msg) const;
void set_moves(const std::string& moves) const;
bool check_running() const;
bool clear_audio() const;
void clear_audio() const;
std::string transcribe(
const std::vector<float> & pcmf32,
float & logprob_min,

View File

@ -118,7 +118,7 @@ void get_audio(int ms, std::vector<float> & pcmf32_cur) {
g_audio.get(ms, pcmf32_cur);
}
bool clear_audio() {
void clear_audio() {
g_audio.clear();
}