SOUND4 x1.CLOUD Library [1.2.6]
Classes | Public Member Functions | Protected Member Functions | List of all members
sound4::cloudx1::CInstance Class Reference

#include <sound4.x1.cloud.hpp>

Classes

class  CClient
 

Public Member Functions

 CInstance ()
 
 CInstance (const CInstance &)=delete
 
CInstance & operator= (const CInstance &)=delete
 
 ~CInstance ()
 
bool IsOk () const
 
void SetParam (const std::string &name, const std::string &value)
 
std::string GetParam (const std::string &name)
 
bool Create (const std::string &LoginKey, const std::string &RadioName, const std::string &AWS_Access_ID, const std::string &AWS_Access_Secret, const std::string &save_path, int json_port=0)
 
bool StartWebServer (int http_port, int https_port=0)
 
void StopWebServer ()
 
void Stop ()
 
uint GetEstimatedDelay ()
 
std::array< float, InputSampleSize > & GetBufferIn ()
 
std::array< float, OutputSampleSize > & GetBufferOut ()
 
void ProcessAudio ()
 
void ProcessAudio_Planar (float const *const (&input)[InputChannels], float *const (&output)[OutputChannels])
 
template<typename T >
std::vector< T > ProcessAnyAudio (const std::vector< T > input)
 
std::shared_ptr< CClient > NewClient ()
 

Protected Member Functions

template<typename T >
uint AddAudio (const T *payload, uint nFrame)
 
template<typename T >
uint GetAudio (T *payload, uint max_nFrame)
 

Detailed Description

Instance handling class

Definition at line 249 of file sound4.x1.cloud.hpp.

Constructor & Destructor Documentation

◆ CInstance() [1/2]

sound4::cloudx1::CInstance::CInstance ( )
inline

Creates the instance, with default parameters

Definition at line 254 of file sound4.x1.cloud.hpp.

◆ CInstance() [2/2]

sound4::cloudx1::CInstance::CInstance ( const CInstance &  )
delete

◆ ~CInstance()

sound4::cloudx1::CInstance::~CInstance ( )
inline

Destructor, stopping any running tasks

Definition at line 266 of file sound4.x1.cloud.hpp.

Member Function Documentation

◆ AddAudio()

template<typename T >
uint sound4::cloudx1::CInstance::AddAudio ( const T *  payload,
uint  nFrame 
)
inlineprotected

Definition at line 542 of file sound4.x1.cloud.hpp.

◆ Create()

bool sound4::cloudx1::CInstance::Create ( const std::string &  LoginKey,
const std::string &  RadioName,
const std::string &  AWS_Access_ID,
const std::string &  AWS_Access_Secret,
const std::string &  save_path,
int  json_port = 0 
)
inline

Creates and initialize the instance, and starts its update thread

See also
cloudx1_InitProcess2
Parameters
LoginKeySOUND4 Login key
RadioNameSOUND4 RadioName
AWS_Access_IDSOUND4 AWS access ID
AWS_Access_SecretSOUND4 AWS access Secret
save_pathPath where we can load/save the configuration
json_portOptional json listening port
Returns
false if failed

Definition at line 311 of file sound4.x1.cloud.hpp.

◆ GetAudio()

template<typename T >
uint sound4::cloudx1::CInstance::GetAudio ( T *  payload,
uint  max_nFrame 
)
inlineprotected

Definition at line 548 of file sound4.x1.cloud.hpp.

◆ GetBufferIn()

std::array<float,InputSampleSize>& sound4::cloudx1::CInstance::GetBufferIn ( )
inline

Gets the input buffer used in ProcessAudio

Input has GetAudioInputCount() * GetChannelCount() channels

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 397 of file sound4.x1.cloud.hpp.

◆ GetBufferOut()

std::array<float,OutputSampleSize>& sound4::cloudx1::CInstance::GetBufferOut ( )
inline

Gets the output buffer used in ProcessAudio

Output has GetAudioOutputCount() * GetChannelCount() channels

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 414 of file sound4.x1.cloud.hpp.

◆ GetEstimatedDelay()

uint sound4::cloudx1::CInstance::GetEstimatedDelay ( )
inline

Gets an estimated delay of current processing

See also
cloudx1_GetEstimatedDelay

Definition at line 381 of file sound4.x1.cloud.hpp.

◆ GetParam()

std::string sound4::cloudx1::CInstance::GetParam ( const std::string &  name)
inline

Gets a parameter value

See also
cloudx1_GetParameter

Definition at line 290 of file sound4.x1.cloud.hpp.

◆ IsOk()

bool sound4::cloudx1::CInstance::IsOk ( ) const
inline

Returns true if an instance has been created and not stopped.

Definition at line 274 of file sound4.x1.cloud.hpp.

◆ NewClient()

std::shared_ptr<CClient> sound4::cloudx1::CInstance::NewClient ( )
inline

Creates a low-level JSON client

See also
JSON syntax
Returns
a new client to communicate with the processing

Definition at line 534 of file sound4.x1.cloud.hpp.

◆ operator=()

CInstance& sound4::cloudx1::CInstance::operator= ( const CInstance &  )
delete

◆ ProcessAnyAudio()

template<typename T >
std::vector<T> sound4::cloudx1::CInstance::ProcessAnyAudio ( const std::vector< T >  input)
inline

Process audio (different formats, less optimized)

Supports for int16_t, int32_t and float (32) in native endianness

Attention
the return count is independent from the input count due to CLOUDX1_AUDIOFRAME_COUNT
Template Parameters
Tthe C type for one audio sample
Parameters
inputaudio to process
Returns
processed audio

Definition at line 462 of file sound4.x1.cloud.hpp.

◆ ProcessAudio()

void sound4::cloudx1::CInstance::ProcessAudio ( )
inline

Process one audio chunk, from GetBufferIn() to GetBufferOut()

See also
cloudx1_ProcessAudio

Definition at line 425 of file sound4.x1.cloud.hpp.

◆ ProcessAudio_Planar()

void sound4::cloudx1::CInstance::ProcessAudio_Planar ( float const *const (&)  input[InputChannels],
float *const (&)  output[OutputChannels] 
)
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...], ... ]

See also
cloudx1_ProcessAudio_Planar
Parameters
inputhas GetAudioInputCount() * GetChannelCount() channels
outputhas GetAudioOutputCount() * GetChannelCount() channels

Definition at line 444 of file sound4.x1.cloud.hpp.

◆ SetParam()

void sound4::cloudx1::CInstance::SetParam ( const std::string &  name,
const std::string &  value 
)
inline

Set a parameter value

See also
cloudx1_SetParameter

Definition at line 280 of file sound4.x1.cloud.hpp.

◆ StartWebServer()

bool sound4::cloudx1::CInstance::StartWebServer ( int  http_port,
int  https_port = 0 
)
inline

Starts a Web server on requested ports

See also
cloudx1_Webserver

Definition at line 330 of file sound4.x1.cloud.hpp.

◆ Stop()

void sound4::cloudx1::CInstance::Stop ( )
inline

Stops the instance and its web server and its update thread.

See also
cloudx1_ExitProcess,
cloudx1_StopUpdateThread and
cloudx1_Webserver_Stop

Definition at line 364 of file sound4.x1.cloud.hpp.

◆ StopWebServer()

void sound4::cloudx1::CInstance::StopWebServer ( )
inline

Stops the Web server

See also
cloudx1_Webserver_Stop

Definition at line 352 of file sound4.x1.cloud.hpp.


The documentation for this class was generated from the following file: