![]() |
SOUND4 IMPACT.CL Library [1.3.6]
|
Instance handling class. More...
#include <sound4.impact.cl.hpp>
Classes | |
class | CClient |
Public Member Functions | |
CInstance () | |
CInstance (const CInstance &)=delete | |
CInstance & | operator= (const CInstance &)=delete |
virtual | ~CInstance () |
bool | IsOk () const |
void | SetParam (const std::string &name, const std::string &value) |
std::string | GetParam (const std::string &name) |
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) |
unsigned int | GetChunkFrames () |
void | PresetManager_InformChange (const std::filesystem::path &relative_path, PresetChange_Kind change_kind) |
void | SetMetadata (const std::string &key, const char *value) |
void | SetMetadataMulti (const std::unordered_map< std::string, const char * > &list) |
std::vector< std::tuple< std::string, std::string > > | GetMetadataInfos () |
virtual void | OnUpdateThreadStart () |
virtual void | OnUpdateThreadStop () |
bool | StartWebServer (int http_port, int https_port=0) |
void | StopWebServer (int timeout_ms=1000) |
void | SetWebServerAppHealth (int httpcode, const std::string &contenttype, const std::string &content) |
void | GetWebServerAppHealth (int &httpcode, std::string &contenttype, std::string &content) |
int | Terminate () |
void | Stop () |
unsigned int | GetEstimatedDelay () |
std::array< float, InputSampleSize > & | GetBufferIn () |
std::array< float, OutputSampleSize > & | GetBufferOut () |
void | ProcessAudio () |
void | ProcessAudio_Planar (float const *const *input, float *const *output) |
template<typename T > | |
std::vector< T > | ProcessAnyAudio (const std::vector< T > input) |
std::shared_ptr< CClient > | NewClient () |
bool | SaveState () |
Protected Member Functions | |
template<typename T > | |
unsigned int | AddAudio (const T *payload, unsigned int nFrame) |
template<typename T > | |
unsigned int | GetAudio (T *payload, unsigned int max_nFrame) |
Holds an instance of processing
Definition at line 468 of file sound4.impact.cl.hpp.
|
inline |
Creates the instance, with default parameters
Definition at line 473 of file sound4.impact.cl.hpp.
|
delete |
|
inlinevirtual |
Destructor, stopping any running tasks
Definition at line 484 of file sound4.impact.cl.hpp.
|
inlineprotected |
Definition at line 1018 of file sound4.impact.cl.hpp.
|
inline |
Creates and initialize the instance, and starts its update thread
If used in a container, we recommend to put a volume for this path, so it will survive updates.
LICENSE_SERVER
in the parameters.LoginKey | SOUND4 Login key |
RadioName | SOUND4 RadioName |
Access_Key_ID | SOUND4 AWS access ID |
Access_Key_Secret | SOUND4 AWS access Secret |
save_path | Path where we can load/save the configuration |
json_port | Optional json listening port |
frames_per_chunk | The number of audio frames in each chunk of processing. Must be in the list returned by impact_GetPossibleChunkSizeInFrames, or 0 to set default |
Definition at line 587 of file sound4.impact.cl.hpp.
|
inlineprotected |
Definition at line 1024 of file sound4.impact.cl.hpp.
|
inline |
Get preallocated aligned buffer for audio input for ProcessAudio
The buffer is a big enough for all supported chunk sizes.
Each sample is a native 32-bit floating-point number where 1.0 is full scale. Channels are interlaced, so the buffers are [L0,R0,L1,R1,...,Ln,Rn] (L=Left, R=Right)
In case of multiple audio input/output, buffer is [aL0,aR0,bL0,bR0,...,aLn,aRn,bLn,bRn]
Definition at line 859 of file sound4.impact.cl.hpp.
|
inline |
Get preallocated aligned buffer for audio output for ProcessAudio
The buffer is a big enough for all supported chunk sizes.
Each sample is a native 32-bit floating-point number where 1.0 is full scale. Channels are interlaced, so the buffers are [L0,R0,L1,R1,...,Ln,Rn] (L=Left, R=Right)
In case of multiple audio input/output, buffer is [aL0,aR0,bL0,bR0,...,aLn,aRn,bLn,bRn]
Definition at line 877 of file sound4.impact.cl.hpp.
|
inline |
Get the number of audio frames in each chunk of processing.
The value reflects the frames_per_chunk parameter passed to Create
Definition at line 624 of file sound4.impact.cl.hpp.
|
inline |
Get the delay (estimated) of current processing algorithm
Definition at line 841 of file sound4.impact.cl.hpp.
|
inline |
Get information on known metadata keys.
Definition at line 702 of file sound4.impact.cl.hpp.
|
inline |
Gets a parameter value
name | the parameter name |
Definition at line 513 of file sound4.impact.cl.hpp.
|
inline |
Get the web server /apphealth status info
Definition at line 788 of file sound4.impact.cl.hpp.
|
inline |
Returns true if an instance has been created and not stopped.
Definition at line 492 of file sound4.impact.cl.hpp.
|
inline |
Creates a low-level JSON client
See also JSON syntax
Definition at line 992 of file sound4.impact.cl.hpp.
|
inlinevirtual |
Can be overloaded, called at start of UpdateThread in the thread
Definition at line 724 of file sound4.impact.cl.hpp.
|
inlinevirtual |
Can be overloaded to call at end of UpdateThread in the thread
Definition at line 728 of file sound4.impact.cl.hpp.
|
inline |
Inform that a change happened in the storage. This must be used only in conjonction with SetPresetManager
relative_path | The path which changed, relative to the root storage |
change_kind | What happened to this path |
Definition at line 638 of file sound4.impact.cl.hpp.
|
inline |
Process audio (different formats, less optimized)
Supports for int16_t, int32_t and float (32) in native endianness
T | the C type for one audio sample |
input | audio to process |
Definition at line 920 of file sound4.impact.cl.hpp.
|
inline |
Process one audio chunk, from GetBufferIn() to GetBufferOut()
Definition at line 886 of file sound4.impact.cl.hpp.
|
inline |
Process one audio chunk, but with planar audio
Each sample is a native 32-bit floating-point number where 1.0 is full scale. Channels are NOT interlaced, so the buffers are arrays of planar audio : [ [L0,L1,...,Ln] , [R0,R1,...,Rn] ] (L=Left, R=Right)
In case of multiple audio input/output, buffer are [ [aL...], [aR...], [bL...], [bR...], ... ]
input | has GetAudioInputCount() * GetChannelCount() channels |
output | has GetAudioOutputCount() * GetChannelCount() channels |
Definition at line 902 of file sound4.impact.cl.hpp.
|
inline |
Save the current state
Needed when CClient::ProcessJson returned with need_save to true. However it can be postponed as much as wanted.
Definition at line 1008 of file sound4.impact.cl.hpp.
|
inline |
Adds the specific metadata to the process.
It can come from any thread, and will be used as soon as possible. Setting a null value erase the metadata, which is different from setting an empty string.
key | the metadata key If key contains a dot (like wm.KEY), it will be sent only to the matching plugin (ie wm here) without the prefix (ie KEY here) Use empty prefix for routing to main only. |
value | the metadata value or nullptr to erase it. |
Definition at line 654 of file sound4.impact.cl.hpp.
|
inline |
Adds multiple metadata to the process.
This works like SetMetadata but with multiple metadata at once.
list | a map of key/value pair. |
Definition at line 672 of file sound4.impact.cl.hpp.
|
inline |
Set a parameter value
Must be done before Create See also Environment variables and parameters
name | the parameter name |
value | the parameter value |
Definition at line 502 of file sound4.impact.cl.hpp.
|
inline |
Sets a custom preset manager Optional, this overrides the save_path
in Create
To dynamically update when storage change, see PresetManager_InformChange
Must be done before Create
preset_manager | The custom preset manager |
Definition at line 547 of file sound4.impact.cl.hpp.
|
inline |
Set the web server /apphealth status info
Definition at line 780 of file sound4.impact.cl.hpp.
|
inline |
Starts a Web server on requested ports
For secure connection, it will use privatekey.pem and certificate.pem from current directory. Environment variables SSL_PRIVATE_PATH
and SSL_CERTIFICATE_PATH
can override those (see Environment variables and parameters). If none is valid, it will try also /etc/ssl/certs/server.key and /etc/ssl/certs/server.crt.
http_port | The port to listen for HTTP connections (0 to disable) |
https_port | The port to listen for HTTPS connections (0 to disable) |
Definition at line 744 of file sound4.impact.cl.hpp.
|
inline |
Stops the instance, its web server and its update thread.
Definition at line 818 of file sound4.impact.cl.hpp.
|
inline |
Stop a web server started with StartWebServer
timeout_ms | The timeout to wait gracefull shutdown |
Definition at line 769 of file sound4.impact.cl.hpp.
|
inline |
Terminate the processing.
This is useful only with file processing, to get the final status. For some plugins, this is mandatory
Definition at line 809 of file sound4.impact.cl.hpp.