Babel
Epitech's C++ VoIP project
|
Go to the documentation of this file.
6 #ifndef SOUNDHANDLER_HPP_
7 #define SOUNDHANDLER_HPP_
12 #include <condition_variable>
13 #include <QApplication>
38 void addClient(
const std::string &userid,
const std::string &ipAddres, std::uint16_t port);
48 std::shared_ptr<Babel::IAudioManager>
_audio;
50 std::shared_ptr<Babel::ICodec>
_codec;
52 std::shared_ptr<Babel::UDPSocket>
_socket;
54 std::map<std::string, std::pair<std::string, std::uint16_t>>
_userlist;
std::mutex _exit_mtx
mutex for should exit variable
Definition: SoundHandler.hpp:62
std::mutex _userlist_mtx
mutex to access the userlist
Definition: SoundHandler.hpp:56
std::map< std::string, std::pair< std::string, std::uint16_t > > _userlist
list of all users used in current call
Definition: SoundHandler.hpp:54
void startCall()
notify the sound handler to start to send data and to receive it
Definition: SoundHandler.cpp:70
std::shared_ptr< Babel::UDPSocket > _socket
pointer to the udp socket for input and output on network
Definition: SoundHandler.hpp:52
void removeClient(const std::string &userid)
remove a client to the current call
Definition: SoundHandler.cpp:89
std::thread _execthread
thread for broadcasting data from audio library to udp
Definition: SoundHandler.hpp:68
std::condition_variable _blocker
@condition variable for stopping or enabling thread
Definition: SoundHandler.hpp:58
std::mutex _play_mtx
mutex for should exit variable
Definition: SoundHandler.hpp:66
~SoundHandler()
sound handler destructor
Definition: SoundHandler.cpp:59
Definition: IAudioManager.hpp:13
SoundHandler(std::uint16_t port)
sound handler constructor
Definition: SoundHandler.cpp:15
void addClient(const std::string &userid, const std::string &ipAddres, std::uint16_t port)
add a client to the current call
Definition: SoundHandler.cpp:84
bool _shouldExit
boolean to tell when the thread should exit;
Definition: SoundHandler.hpp:60
bool _shouldPlay
boolean to tell when the thread should record;
Definition: SoundHandler.hpp:64
std::shared_ptr< Babel::ICodec > _codec
pointer to the codec
Definition: SoundHandler.hpp:50
Definition: SoundHandler.hpp:23
uint16_t getLocalPort() const
get the port that the soundHandler is listening
Definition: SoundHandler.cpp:94
void stopCall()
notify the sound handler to stop
Definition: SoundHandler.cpp:76
std::shared_ptr< Babel::IAudioManager > _audio
pointer to audio input and outputs
Definition: SoundHandler.hpp:48
std::mutex _condVarMutex
mutex used for the condition variable
Definition: SoundHandler.hpp:70