20#if defined(__unix__) || defined(__APPLE__)
29 #include <libloaderapi.h>
31 #error "Unsupported OS"
39 #include <stringapiset.h>
42 #define fs_strdup wcsdup
45 #define fs_strdup strdup
87 using DynFunc_t =
void *;
89 using DynFunc_t = FARPROC;
92 DynFunc_t m_ptr = NULL;
96 operator bool()
const {
return (m_ptr!=NULL); }
97 bool IsOk()
const {
return m_ptr!=NULL; }
98 operator T* ()
const {
return reinterpret_cast<T*
>(m_ptr); }
108 using DynLib_t =
void *;
110 using DynLib_t = HMODULE;
120 operator bool()
const {
121 return (m_lib!=NULL);
124 return (m_lib!=NULL);
129 #ifndef __SANITIZE_ADDRESS__
135 bool Load(
const std::filesystem::path& dynlib)
138 m_lib=dlopen(dynlib.c_str(), RTLD_NOW|RTLD_LOCAL);
141 template <
typename T>
142 DynFuncHolder<T>
GetSymbol(
const std::string& name) {
143 auto ptr=dlsym(m_lib, name.c_str());
145 throw std::runtime_error(
"Missing function in library");
147 return DynFuncHolder<T>(ptr);
149 template <
typename T>
151 auto ptr=dlsym(m_lib, name.c_str());
152 return DynFuncHolder<T>(ptr);
157 auto rp=realpath(
info.dli_fname, NULL);
158 std::filesystem::path p(rp);
173 #if defined(SOUND4_CALL_FREELIBRARYANDEXITTHREAD)
175 #elif defined(SOUND4_CALL_FREELIBRARY)
181 template <
typename T>
185 throw std::runtime_error(
"Missing function in library");
189 template <
typename T>
202 return std::filesystem::path(
path);
272#if IMPACT_HAS_WEBSERVER
298#if IMPACT_HAS_CLOUDBUS
308#if IMPACT_HAS_WEBSERVER
322 bool Load(
const std::filesystem::path& path = {}) {
323 std::string filename;
324 #if defined(__APPLE__)
325 filename=
"libsound4.impact.cl.dylib";
326 #elif defined(__unix__)
327 filename=
"libsound4.impact.cl.so";
329 filename=
"sound4.impact.cl.dll";
333 if (!path.empty() && !m_lib.
Load(path / filename)) {
335 }
else if (!m_lib.
IsOk()) {
339 if (!m_lib.
IsOk() && thisdir.filename()==
"bin") {
340 auto libdir = thisdir.parent_path() /
"lib";
341 m_lib.
Load(libdir / filename);
346 m_lib.
Load(thisdir / filename);
351 auto p = std::filesystem::current_path(ec);
353 m_lib.
Load(p / filename);
406#if IMPACT_HAS_WEBSERVER
418 }
catch (std::runtime_error& ) {
436#if IMPACT_HAS_CLOUDBUS
438 NewBus = m_lib.
GetSymbol<
decltype(impact_NewBus ) >(
"impact_NewBus" );
439 FreeBus = m_lib.
GetSymbol<
decltype(impact_FreeBus ) >(
"impact_FreeBus" );
440 SetInstanceBus = m_lib.
GetSymbol<
decltype(impact_SetInstanceBus ) >(
"impact_SetInstanceBus" );
446#if IMPACT_HAS_WEBSERVER
453 }
catch (std::runtime_error& ) {
519 if (
wstr.empty())
return {};
531 if (
str.empty())
return std::wstring();
711 std::vector<unsigned int> list;
714 list.push_back(*src);
783 throw std::runtime_error(
"Bad library sampling rate");
786 throw std::runtime_error(
"Bad library frame size");
789 throw std::runtime_error(
"Bad library channel count");
792 throw std::runtime_error(
"Bad library input count");
795 throw std::runtime_error(
"Bad library output count");
850 _log_cb(severity, std::string(c_msg));
869#if IMPACT_HAS_CLOUDBUS
877 CBus(CDynLib& dynlib)
880 if (m_dynlib.NewBus) {
881 m_bus=m_dynlib.NewBus();
886 if (m_bus && m_dynlib.FreeBus) {
887 m_dynlib.FreeBus(m_bus);
891 impact_CBus *Get()
const {
return m_bus; }
909 virtual bool Exists(
const std::filesystem::path &name) = 0;
910 virtual bool Remove(
const std::filesystem::path &name) = 0;
911 virtual bool Rename(
const std::filesystem::path &from,
const std::filesystem::path &to) = 0;
912 virtual std::vector<std::filesystem::path>
GetAll() = 0;
913 virtual std::string
Read(
const std::filesystem::path &filename) = 0;
914 virtual bool Write(
const std::filesystem::path &filename,
const std::string &content) =0;
932 if (!params)
throw std::bad_alloc();
948 bool IsOk()
const {
return instance!=
nullptr; }
958 void SetParam(
const std::string& name,
const std::string& value)
961 m_dynlib.
SetParameter(params, name.c_str(), value.c_str());
972 auto c_value=m_dynlib.
GetParameter(params, name.c_str());
973 std::string ret(c_value);
977#if IMPACT_HAS_CLOUDBUS
986 void SetBus(
const CBus& bus) {
988 if (m_dynlib.SetInstanceBus) {
989 m_dynlib.SetInstanceBus(params,bus.
Get());
1006 if (!preset_manager)
return;
1045 bool Create(
const std::string& LoginKey,
const std::string& RadioName,
const std::string& Access_Key_ID,
const std::string& Access_Key_Secret,
const std::filesystem::path& save_path,
int json_port = 0,
unsigned int frames_per_chunk=64)
1048 std::string l_save_path;
1049 if (!save_path.empty()) {
1050 l_save_path = save_path.u8string();
1053 instance = m_dynlib.
InitProcess3(LoginKey.c_str(), RadioName.c_str(), Access_Key_ID.c_str(), Access_Key_Secret.c_str(), l_save_path.c_str(), params, frames_per_chunk);
1054 }
else if (frames_per_chunk!=64) {
1057 instance = m_dynlib.
InitProcess2(LoginKey.c_str(), RadioName.c_str(), Access_Key_ID.c_str(), Access_Key_Secret.c_str(), l_save_path.c_str(), params);
1059 if (!instance)
return false;
1060 if (!init_metadata.empty()) {
1061 for (
auto&& [key,value]: init_metadata) {
1062 m_dynlib.
SetMetadata(instance, key.c_str(), value.c_str());
1064 init_metadata.clear();
1066 update_thread = std::thread([
this, json_port](){
1124 m_dynlib.
SetMetadata(instance, key.c_str(), value);
1126 init_metadata.push_back( {key, value} );
1145 typedef const char* pchar;
1146 pchar* keyvalue=
new pchar[2*list.size()+1];
1148 for (
auto&& [key,value]: list) {
1149 keyvalue[2*n+0]=key.c_str();
1150 keyvalue[2*n+1]=value;
1153 keyvalue[2*n+0]=
nullptr;
1159 for (
auto&& [key,value]: list) {
1164 for (
auto&& [key,value]: list) {
1166 init_metadata.push_back( {key, value} );
1179 std::vector< std::tuple<std::string,std::string> > values;
1183 for (
const char** c_value=c_values; *c_value; ) {
1184 std::string key(*c_value);
1187 std::string descr(*c_value);
1189 values.push_back( {key,descr} );
1207#if IMPACT_HAS_WEBSERVER
1225 webserver = m_dynlib.
Webserver(http_port,https_port,instance);
1270 char* c_contenttype=
nullptr;
1271 char* c_content=
nullptr;
1273 contenttype=c_contenttype;
1290 if (!instance)
return 0;
1299 if (!instance)
return;
1300#if IMPACT_HAS_WEBSERVER
1303 if (update_thread.joinable()) {
1305 update_thread.join();
1342 return reinterpret_cast< std::array<float,InputSampleSize>&
>(*buf);
1360 return reinterpret_cast< std::array<float,OutputSampleSize>&
>(*buf);
1398 template<
typename T>
1402 std::vector<T> output;
1403 unsigned int out_offset=0;
1404 unsigned int in_offset=0;
1405 unsigned int todo = input.size();
1407 unsigned int left =
AddAudio(&input[in_offset], todo);
1409 output.resize(out_offset + out_avail);
1410 GetAudio(&output[out_offset], out_avail);
1411 out_offset+=out_avail;
1412 in_offset += todo-left;
1430 if (!client)
throw std::bad_alloc();
1449 std::string
ProcessJson(
const std::string &request,
bool *NeedSave =
nullptr)
1453 const char *canswer = m_dynlib.
ProcessJson(client, request.c_str(), &need_save);
1454 if (!canswer)
return {};
1455 std::string answer(canswer);
1458 *NeedSave=(need_save!=0);
1476 return std::make_shared<CClient>(instance, m_dynlib);
1498 template<
typename T>
1499 unsigned int AddAudio(
const T* payload,
unsigned int nFrame)
1504 template<
typename T>
1505 unsigned int GetAudio(T* payload,
unsigned int max_nFrame)
1515 std::thread update_thread;
1516 std::vector< std::pair<std::string,std::string> > init_metadata;
1517#if IMPACT_HAS_WEBSERVER
1530 std::string content=preset_loader->
Read(filename);
1531 return strdup(content.c_str());
1534 if (!content)
return;
1539 auto res=preset_loader->
Write(filename,content);
1544 auto res=preset_loader->
Exists(filename);
1549 auto res=preset_loader->
GetAll();
1551 for (
size_t n=0;n<res.size();n++) {
1552 all[n]=fs_strdup(res[n].c_str());
1554 all[res.size()]=
nullptr;
1559 for (
fs_char** one=all;*one;one++) {
1566 auto res=preset_loader->
Remove(filename);
1571 auto res=preset_loader->
Rename(from,to);
sound4cl_CBus * Get() const
Dynamic library interface.
helper::DynFuncHolder< decltype(impact_FreeMetadataInfos) > FreeMetadataInfos
helper::DynFuncHolder< decltype(impact_GetBytesFromFormat) > GetBytesFromFormat
bool Load(const std::filesystem::path &path={})
Loads the library.
helper::DynFuncHolder< decltype(impact_FreeParameterValue) > FreeParameterValue
helper::DynFuncHolder< decltype(impact_SetMetadataMulti) > SetMetadataMulti
helper::DynFuncHolder< decltype(impact_SetParameter) > SetParameter
helper::DynFuncHolder< decltype(impact_GetBufferIn) > GetBufferIn
helper::DynFuncHolder< decltype(impact_FreeParameters) > FreeParameters
helper::DynFuncHolder< decltype(impact_InitProcess) > InitProcess
helper::DynFuncHolder< decltype(impact_GetAudio) > GetAudio
helper::DynFuncHolder< decltype(impact_GetFormatFromName) > GetFormatFromName
helper::DynFuncHolder< decltype(impact_GetAudioInputCount) > GetAudioInputCount
helper::DynFuncHolder< decltype(impact_AudioMonoToLiveStereo) > AudioMonoToLiveStereo
helper::DynFuncHolder< decltype(impact_InitProcess2) > InitProcess2
helper::DynFuncHolder< decltype(impact_Webserver_tcp) > Webserver_tcp
helper::DynFuncHolder< decltype(impact_DeleteClient) > DeleteClient
helper::DynFuncHolder< decltype(impact_GetBufferOut) > GetBufferOut
helper::DynFuncHolder< decltype(impact_GetEstimatedDelay) > GetEstimatedDelay
helper::DynFuncHolder< decltype(impact_NewParameters) > NewParameters
helper::DynFuncHolder< decltype(impact_SetPresetManager) > SetPresetManager
helper::DynFuncHolder< decltype(impact_SaveState) > SaveState
helper::DynFuncHolder< decltype(impact_WaitUpdateThreadReady) > WaitUpdateThreadReady
helper::DynFuncHolder< decltype(impact_SetLogSeverity) > SetLogSeverity
helper::DynFuncHolder< decltype(impact_StereoToMono_Planar) > StereoToMono_Planar
helper::DynFuncHolder< decltype(impact_FreeJsonAnswer) > FreeJsonAnswer
helper::DynFuncHolder< decltype(impact_StereoToMono) > StereoToMono
helper::DynFuncHolder< decltype(impact_StartUpdateThread) > StartUpdateThread
helper::DynFuncHolder< decltype(impact_GetMetadataInfos) > GetMetadataInfos
helper::DynFuncHolder< decltype(impact_ProcessAudio_Planar) > ProcessAudio_Planar
helper::DynFuncHolder< decltype(impact_ExitProcess) > ExitProcess
helper::DynFuncHolder< decltype(impact_GetFormatName) > GetFormatName
helper::DynFuncHolder< decltype(impact_GetPossibleChunkSizeInFrames) > GetPossibleChunkSizeInFrames
helper::DynFuncHolder< decltype(impact_SetMetadata) > SetMetadata
helper::DynFuncHolder< decltype(impact_MonoToStereo_Planar) > MonoToStereo_Planar
helper::DynFuncHolder< decltype(impact_Webserver_GetAppHealth) > Webserver_GetAppHealth
helper::DynFuncHolder< decltype(impact_GetChannelCount) > GetChannelCount
helper::DynFuncHolder< decltype(impact_ProcessJson) > ProcessJson
helper::DynFuncHolder< decltype(impact_AudioMonoFromLiveStereo) > AudioMonoFromLiveStereo
helper::DynFuncHolder< decltype(impact_GetChunkSizeInFrames) > GetChunkSizeInFrames
helper::DynFuncHolder< decltype(impact_GetAudioOutputCount) > GetAudioOutputCount
helper::DynFuncHolder< decltype(impact_Webserver_Stop) > Webserver_Stop
helper::DynFuncHolder< decltype(impact_NewClient) > NewClient
helper::DynFuncHolder< decltype(impact_MonoToStereo) > MonoToStereo
helper::DynFuncHolder< decltype(impact_Webserver_tcp2) > Webserver_tcp2
helper::DynFuncHolder< decltype(impact_AudioConvertFrom) > AudioConvertFrom
bool IsOk() const
Check if the library was loaded correctly.
helper::DynFuncHolder< decltype(impact_TerminateProcess) > TerminateProcess
helper::DynFuncHolder< decltype(impact_GetProcessChunkFrames) > GetProcessChunkFrames
helper::DynFuncHolder< decltype(impact_AudioConvertTo) > AudioConvertTo
helper::DynFuncHolder< decltype(impact_InitProcess3) > InitProcess3
helper::DynFuncHolder< decltype(impact_GetParameter) > GetParameter
helper::DynFuncHolder< decltype(impact_Webserver_FreeString) > Webserver_FreeString
helper::DynFuncHolder< decltype(impact_GetOutputCount) > GetOutputCount
helper::DynFuncHolder< decltype(impact_AddAudio) > AddAudio
helper::DynFuncHolder< decltype(impact_Webserver_SetAppHealth) > Webserver_SetAppHealth
helper::DynFuncHolder< decltype(impact_GetSampleRate) > GetSampleRate
helper::DynFuncHolder< decltype(impact_Webserver) > Webserver
helper::DynFuncHolder< decltype(impact_GetMaxPacketFrame) > GetMaxPacketFrame
helper::DynFuncHolder< decltype(impact_GetVersion) > GetVersion
helper::DynFuncHolder< decltype(impact_SetLoggerCallback) > SetLoggerCallback
helper::DynFuncHolder< decltype(impact_ProcessAudio) > ProcessAudio
helper::DynFuncHolder< decltype(impact_PresetManager_InformChange) > PresetManager_InformChange
helper::DynFuncHolder< decltype(impact_StopUpdateThread) > StopUpdateThread
helper::DynFuncHolder< decltype(impact_AddPadAudio) > AddPadAudio
helper::DynFuncHolder< decltype(impact_Webserver_Status) > Webserver_Status
std::string ProcessJson(const std::string &request, bool *NeedSave=nullptr)
Process a JSON request and returns the answer.
CClient(const CInstance &)=delete
CClient & operator=(const CInstance &)=delete
CClient(impact_CInstance *instance, CDynLib &dynlib)
virtual void OnUpdateThreadStop()
CInstance & operator=(const CInstance &)=delete
void SetMetadataMulti(const std::unordered_map< std::string, const char * > &list)
std::shared_ptr< CClient > NewClient()
void PresetManager_InformChange(const std::filesystem::path &relative_path, PresetChange_Kind change_kind)
std::vector< T > ProcessAnyAudio(const std::vector< T > input)
unsigned int GetEstimatedDelay()
void GetWebServerAppHealth(int &httpcode, std::string &contenttype, std::string &content)
bool StartWebServer(int http_port, int https_port=0)
unsigned int GetAudio(T *payload, unsigned int max_nFrame)
std::vector< std::tuple< std::string, std::string > > GetMetadataInfos()
std::string GetParam(const std::string &name)
unsigned int AddAudio(const T *payload, unsigned int nFrame)
CInstance(const CInstance &)=delete
std::array< float, OutputSampleSize > & GetBufferOut()
void StopWebServer(int timeout_ms=1000)
void ProcessAudio_Planar(float const *const *input, float *const *output)
void SetMetadata(const std::string &key, const char *value)
virtual void OnUpdateThreadStart()
CInstance(CDynLib &dynlib)
void SetPresetManager(CPresetLoader *preset_manager)
bool Create(const std::string &LoginKey, const std::string &RadioName, const std::string &Access_Key_ID, const std::string &Access_Key_Secret, const std::filesystem::path &save_path, int json_port=0, unsigned int frames_per_chunk=64)
void SetParam(const std::string &name, const std::string &value)
unsigned int GetChunkFrames()
std::array< float, InputSampleSize > & GetBufferIn()
void SetWebServerAppHealth(int httpcode, const std::string &contenttype, const std::string &content)
Custom preset handler helper.
virtual std::vector< std::filesystem::path > GetAll()=0
virtual std::string Read(const std::filesystem::path &filename)=0
virtual ~CPresetLoader()=default
virtual bool Rename(const std::filesystem::path &from, const std::filesystem::path &to)=0
virtual bool Remove(const std::filesystem::path &name)=0
virtual bool IsReadOnly()=0
virtual bool Exists(const std::filesystem::path &name)=0
virtual bool Write(const std::filesystem::path &filename, const std::string &content)=0
Helper to load dynamic library.
CDynLoader & operator=(CDynLoader const &)=delete
CDynLoader(CDynLoader &&)=default
DynFuncHolder< T > GetSymbol(const std::string &name)
DynFuncHolder< T > GetSymbol_safe(const std::string &name)
static std::filesystem::path GetThisLibraryPath(void)
CDynLoader(const CDynLoader &)=delete
bool Load(const std::filesystem::path &dynlib, uint32_t loadflags=LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR|LOAD_LIBRARY_SEARCH_APPLICATION_DIR|LOAD_LIBRARY_SEARCH_USER_DIRS|LOAD_LIBRARY_SEARCH_SYSTEM32)
Helper to wrap a function pointer.
DynFuncHolder(DynFunc_t a_ptr)
unsigned int impact_GetBytesFromFormat(const enum impact_SampleFormat fmt)
unsigned int impact_AddAudio(struct impact_CInstance *instance, const uint8_t *payload, unsigned int nFrame, enum impact_SampleFormat fmt)
const char * impact_GetFormatName(const enum impact_SampleFormat fmt)
enum impact_SampleFormat impact_GetFormatFromName(const char *name)
unsigned int impact_AddPadAudio(struct impact_CInstance *instance)
unsigned int impact_GetOutputCount(struct impact_CInstance *instance)
unsigned int impact_GetMaxPacketFrame(struct impact_CInstance *instance)
unsigned int impact_GetAudio(struct impact_CInstance *instance, uint8_t *payload, unsigned int max_nFrame, enum impact_SampleFormat fmt)
void impact_FreeJsonAnswer(const char *json_str)
const char * impact_ProcessJson(struct impact_CClientInstance *client, const char *json_str, int *need_save)
void impact_DeleteClient(struct impact_CClientInstance *client)
int impact_SaveState(struct impact_CInstance *instance)
struct impact_CClientInstance * impact_NewClient(struct impact_CInstance *instance)
void impact_AudioMonoFromLiveStereo(const uint8_t *payload, float *output)
void impact_AudioConvertFrom(const uint8_t *payload, float *output, size_t nSpl, enum impact_SampleFormat fmt)
void impact_MonoToStereo(const float *input, float *output, size_t nFrame)
void impact_MonoToStereo_Planar(const float *input, float *outputL, float *outputR, size_t nFrame)
void impact_AudioMonoToLiveStereo(const float *input, uint8_t *payload)
void impact_StereoToMono(const float *input, float *output, size_t nFrame)
void impact_StereoToMono_Planar(const float *inputL, const float *inputR, float *output, size_t nFrame)
void impact_AudioConvertTo(const float *input, uint8_t *payload, size_t nSpl, enum impact_SampleFormat fmt)
void impact_ProcessAudio(struct impact_CInstance *instance, const float *input, float *output)
unsigned int impact_GetEstimatedDelay(struct impact_CInstance *instance)
float * impact_GetBufferIn(struct impact_CInstance *instance)
float * impact_GetBufferOut(struct impact_CInstance *instance)
void impact_ProcessAudio_Planar(struct impact_CInstance *instance, float const *const *input, float *const *output)
#define IMPACT_AUDIO_INPUT_COUNT
#define IMPACT_SAMPLE_RATE
unsigned int * impact_GetPossibleChunkSizeInFrames()
unsigned int impact_GetAudioOutputCount()
const char * impact_GetVersion()
unsigned int impact_GetChunkSizeInFrames()
void impact_SetLoggerCallback(impact_loggerfn logger)
#define IMPACT_CHANNEL_COUNT
#define IMPACT_AUDIOFRAME_COUNT
unsigned int impact_GetChannelCount()
void impact_SetLogSeverity(enum impact_LogSeverity severity)
unsigned int impact_GetSampleRate()
unsigned int impact_GetAudioInputCount()
#define IMPACT_AUDIO_OUTPUT_COUNT
struct impact_CParameters * impact_NewParameters()
void impact_SetParameter(struct impact_CParameters *params, const char *name, const char *value)
struct impact_CInstance * impact_InitProcess2(const char *LoginKey, const char *RadioName, const char *Access_Key_ID, const char *Access_Key_Secret, const char *save_path, const struct impact_CParameters *parameters)
struct impact_CInstance * impact_InitProcess3(const char *LoginKey, const char *RadioName, const char *Access_Key_ID, const char *Access_Key_Secret, const char *save_path, const struct impact_CParameters *parameters, unsigned int frames_per_chunk)
int impact_TerminateProcess(struct impact_CInstance *instance)
void impact_FreeParameters(struct impact_CParameters *params)
void impact_ExitProcess(struct impact_CInstance *instance)
void impact_FreeParameterValue(const char *value)
unsigned int impact_GetProcessChunkFrames(struct impact_CInstance *instance)
const char * impact_GetParameter(struct impact_CParameters *params, const char *name)
struct impact_CInstance * impact_InitProcess(const char *LoginKey, const char *RadioName, const char *Access_Key_ID, const char *Access_Key_Secret, const char *save_path)
void impact_SetPresetManager(struct impact_CParameters *params, impact_storage_reader reader, impact_storage_reader_free, impact_storage_writer writer, impact_storage_exists exists, impact_storage_getall getall, impact_storage_getall_free getall_free, impact_storage_remove remove, impact_storage_rename rename, int IsReadOnly, void *userdata)
void impact_PresetManager_InformChange(struct impact_CInstance *instance, const fs_char *relative_path, enum impact_PresetChange_Kind change_kind)
void impact_StopUpdateThread(struct impact_CInstance *instance)
void impact_StartUpdateThread(struct impact_CInstance *instance, unsigned int port)
int impact_WaitUpdateThreadReady(struct impact_CInstance *instance, int milliseconds)
#define SOUND4_WEBSERVER_HTTPS_OK
int impact_Webserver_Stop(uint64_t id, int timeout_ms)
uint64_t impact_Webserver(unsigned int listenport, unsigned int listenport_secure, struct impact_CInstance *instance)
void impact_Webserver_GetAppHealth(struct impact_CInstance *instance, int *httpcode, char **contenttype, char **content)
int impact_Webserver_Status(uint64_t id)
#define SOUND4_WEBSERVER_HTTP_OK
uint64_t impact_Webserver_tcp(unsigned int listenport, unsigned int listenport_secure, const char *socket_ip, unsigned int socket_port)
#define SOUND4_INVALID_WEBSERVER_ID
void impact_Webserver_SetAppHealth(struct impact_CInstance *instance, int httpcode, const char *contenttype, const char *content)
void impact_Webserver_FreeString(char *str)
uint64_t impact_Webserver_tcp2(unsigned int listenport, unsigned int listenport_secure, const char *socket_ip, unsigned int socket_port, const struct impact_CParameters *parameters)
static void AudioConvertFrom(CDynLib &dynlib, const uint8_t *payload, float *output, size_t nSpl, impact_SampleFormat fmt)
static void AudioMonoFromLiveStereo(CDynLib &dynlib, const uint8_t *payload, float *output)
static void MonoToStereo_Planar(CDynLib &dynlib, const float *input, float *outputL, float *outputR, size_t nFrame)
static std::wstring UTF8ToWString(const std::string &str)
static void StereoToMono(CDynLib &dynlib, const float *input, float *output, size_t nFrame)
static void AudioConvertTo(CDynLib &dynlib, const float *input, uint8_t *payload, size_t nSpl, impact_SampleFormat fmt)
static void MonoToStereo(CDynLib &dynlib, const float *input, float *output, size_t nFrame)
static void AudioMonoToLiveStereo(CDynLib &dynlib, const float *input, uint8_t *payload)
static std::string WStringToUTF8(const std::wstring &wstr)
static void StereoToMono_Planar(CDynLib &dynlib, const float *inputL, const float *inputR, float *output, size_t nFrame)
static SampleFormat GetFormatFromName(CDynLib &dynlib, const std::string &name)
static constexpr const char * process_shortname
static constexpr const char * process_name
static unsigned int GetBytesFromFormat(CDynLib &dynlib, const SampleFormat fmt)
static std::string GetFormatName(CDynLib &dynlib, const SampleFormat fmt)
const size_t InputChannels
const size_t InputSampleSize
static void _log_cb_c(impact_LogSeverity severity, const char *c_msg)
const size_t OutputChannels
std::function< void(LogSeverity, const std::string &)> log_cb_t
const size_t OutputSampleSize
static void SetLogSeverity(CDynLib &dynlib, LogSeverity severity)
static void SetLoggerCallback(CDynLib &dynlib, log_cb_t cb)
static void SanityCheck(CDynLib &dynlib, bool a_bCheckFrames=true)
static unsigned int GetAudioOutputCount()
static std::string GetVersion()
static unsigned int GetChunkSizeInFrames()
static unsigned int GetAudioInputCount()
static std::vector< unsigned int > GetPossibleChunkSizeInFrames()
static unsigned int GetSampleRate()
static unsigned int GetChannelCount()
@ S32_NATIVE
32-bit signed integer, native
@ F32_NATIVE
32-bit floating-point, native
@ S16_NATIVE
16-bit signed integer, native
static int impact_custom_writer(const fs_char *filename, const char *content, void *userdata)
static int impact_custom_rename(const fs_char *from, const fs_char *to, void *userdata)
static fs_char ** impact_custom_getall(void *userdata)
static void impact_custom_reader_free(char *content, void *userdata)
static char * impact_custom_reader(const fs_char *filename, void *userdata)
static int impact_custom_exists(const fs_char *filename, void *userdata)
static void impact_custom_getall_free(fs_char **all, void *userdata)
static int impact_custom_remove(const fs_char *filename, void *userdata)
static int impact_custom_writer(const fs_char *filename, const char *content, void *userdata)
static int impact_custom_rename(const fs_char *from, const fs_char *to, void *userdata)
static fs_char ** impact_custom_getall(void *userdata)
static void impact_custom_reader_free(char *content, void *userdata)
static char * impact_custom_reader(const fs_char *filename, void *userdata)
static int impact_custom_exists(const fs_char *filename, void *userdata)
static void impact_custom_getall_free(fs_char **all, void *userdata)
static int impact_custom_remove(const fs_char *filename, void *userdata)