Babel
Epitech's C++ VoIP project
Public Member Functions | Private Attributes | List of all members
Babel::SoundHandler Class Reference

#include <SoundHandler.hpp>

Collaboration diagram for Babel::SoundHandler:

Public Member Functions

 SoundHandler (std::uint16_t port)
 sound handler constructor More...
 
 ~SoundHandler ()
 sound handler destructor More...
 
void startCall ()
 notify the sound handler to start to send data and to receive it More...
 
void stopCall ()
 notify the sound handler to stop More...
 
void addClient (const std::string &userid, const std::string &ipAddres, std::uint16_t port)
 add a client to the current call More...
 
void removeClient (const std::string &userid)
 remove a client to the current call More...
 
uint16_t getLocalPort () const
 get the port that the soundHandler is listening More...
 

Private Attributes

std::shared_ptr< Babel::IAudioManager_audio
 pointer to audio input and outputs More...
 
std::shared_ptr< Babel::ICodec_codec
 pointer to the codec More...
 
std::shared_ptr< Babel::UDPSocket_socket
 pointer to the udp socket for input and output on network More...
 
std::map< std::string, std::pair< std::string, std::uint16_t > > _userlist
 list of all users used in current call More...
 
std::mutex _userlist_mtx
 mutex to access the userlist More...
 
std::condition_variable _blocker
 @condition variable for stopping or enabling thread More...
 
bool _shouldExit
 boolean to tell when the thread should exit; More...
 
std::mutex _exit_mtx
 mutex for should exit variable More...
 
bool _shouldPlay
 boolean to tell when the thread should record; More...
 
std::mutex _play_mtx
 mutex for should exit variable More...
 
std::thread _execthread
 thread for broadcasting data from audio library to udp More...
 
std::mutex _condVarMutex
 mutex used for the condition variable More...
 

Constructor & Destructor Documentation

◆ SoundHandler()

Babel::SoundHandler::SoundHandler ( std::uint16_t  port)
explicit

sound handler constructor

◆ ~SoundHandler()

Babel::SoundHandler::~SoundHandler ( )

sound handler destructor

Member Function Documentation

◆ addClient()

void Babel::SoundHandler::addClient ( const std::string &  userid,
const std::string &  ipAddres,
std::uint16_t  port 
)

add a client to the current call

◆ getLocalPort()

uint16_t Babel::SoundHandler::getLocalPort ( ) const

get the port that the soundHandler is listening

◆ removeClient()

void Babel::SoundHandler::removeClient ( const std::string &  userid)

remove a client to the current call

◆ startCall()

void Babel::SoundHandler::startCall ( )

notify the sound handler to start to send data and to receive it

◆ stopCall()

void Babel::SoundHandler::stopCall ( )

notify the sound handler to stop

Member Data Documentation

◆ _audio

std::shared_ptr<Babel::IAudioManager> Babel::SoundHandler::_audio
private

pointer to audio input and outputs

◆ _blocker

std::condition_variable Babel::SoundHandler::_blocker
private

@condition variable for stopping or enabling thread

◆ _codec

std::shared_ptr<Babel::ICodec> Babel::SoundHandler::_codec
private

pointer to the codec

◆ _condVarMutex

std::mutex Babel::SoundHandler::_condVarMutex
private

mutex used for the condition variable

◆ _execthread

std::thread Babel::SoundHandler::_execthread
private

thread for broadcasting data from audio library to udp

◆ _exit_mtx

std::mutex Babel::SoundHandler::_exit_mtx
private

mutex for should exit variable

◆ _play_mtx

std::mutex Babel::SoundHandler::_play_mtx
private

mutex for should exit variable

◆ _shouldExit

bool Babel::SoundHandler::_shouldExit
private

boolean to tell when the thread should exit;

◆ _shouldPlay

bool Babel::SoundHandler::_shouldPlay
private

boolean to tell when the thread should record;

◆ _socket

std::shared_ptr<Babel::UDPSocket> Babel::SoundHandler::_socket
private

pointer to the udp socket for input and output on network

◆ _userlist

std::map<std::string, std::pair<std::string, std::uint16_t> > Babel::SoundHandler::_userlist
private

list of all users used in current call

◆ _userlist_mtx

std::mutex Babel::SoundHandler::_userlist_mtx
private

mutex to access the userlist


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