#pragma once #include #include #include #include #include #include namespace fs = std::filesystem; struct AudioData { float* data; int len; AudioData(int start, int len) : data{reinterpret_cast(start)}, len{len} {} }; enum UntarStatus { Successful, IncorrectFormat, IncorrectFiletype, FailedOpen, FailedWrite, FailedClose }; struct WorkerPool; struct Worker { int handle; std::function fn; static void startup(int _self, int _pool); }; #ifndef MAX_WORKERS #define MAX_WORKERS 1 #endif struct WorkerPool { bool qLock{true}; // True is locked, false is unlocked bool done{}; std::queue> taskQ; std::array workers; WorkerPool(); ~WorkerPool(); void exec(std::function fn); }; void fireEv(int index, const char* _content, const char* _type = nullptr); int untar(unsigned char* tar, int tarSize, const std::string& storepath); extern WorkerPool globalPool;