Babel  1
The voip software that only works on your local network
Loading...
Searching...
No Matches
Controls::ThreadCapsule Class Reference

Manages a thread for user controls. More...

#include <ThreadCapsule.hpp>

Collaboration diagram for Controls::ThreadCapsule:
Collaboration graph

Public Member Functions

 ThreadCapsule ()
 
 ~ThreadCapsule ()
 
void startThread ()
 Starts the thread to run the spamUserChoice function.
 
void stopThread (const unsigned int delay=2)
 Stops the thread safely.
 
const bool isRunning () const
 Checks if the thread is running.
 
const std::string getInfo (const unsigned int indent=0) const
 Dumps the current state of the variables for debugging purposes.
 
void setEcho (const bool echo)
 Sets the echo state.
 
void setHelp (const bool help)
 Sets the help state.
 
void setPlaying (const bool playing)
 Sets the playing state.
 
void setLooping (const bool looping)
 Sets the looping state.
 
void setRecording (const bool recording)
 Sets the recording state.
 
void setUserChoice (const std::string &userChoice)
 Processes the user choice.
 
const bool isEcho () const
 Checks if echo is enabled.
 
const bool isHelp () const
 Checks if help is enabled.
 
const bool isPlaying () const
 Checks if playing is enabled.
 
const bool isLooping () const
 Checks if looping is enabled.
 
const bool isRecording () const
 Checks if recording is enabled.
 
const bool hangUpTheCall () const
 Checks if the call should be hung up.
 
void showPrompt () const
 Displays the prompt to the user.
 
void toggleEcho ()
 Toggles the echo state.
 
void toggleHelp ()
 Toggles the help state.
 
void togglePlaying ()
 Toggles the playing state.
 
void toggleLooping ()
 Toggles the looping state.
 
void toggleRecording ()
 Toggles the recording state.
 

Detailed Description

Manages a thread for user controls.

Definition at line 28 of file ThreadCapsule.hpp.

Constructor & Destructor Documentation

◆ ThreadCapsule()

Controls::ThreadCapsule::ThreadCapsule ( )

Definition at line 15 of file ThreadCapsule.cpp.

◆ ~ThreadCapsule()

Controls::ThreadCapsule::~ThreadCapsule ( )

Definition at line 21 of file ThreadCapsule.cpp.

Member Function Documentation

◆ getInfo()

const std::string Controls::ThreadCapsule::getInfo ( const unsigned int indent = 0) const

Dumps the current state of the variables for debugging purposes.

Parameters
indentThe level to which the class should be indented in the dump.
Returns
The formatted output.

Definition at line 279 of file ThreadCapsule.cpp.

◆ hangUpTheCall()

const bool Controls::ThreadCapsule::hangUpTheCall ( ) const

Checks if the call should be hung up.

Returns
True if the call should be hung up, false otherwise.

Definition at line 220 of file ThreadCapsule.cpp.

◆ isEcho()

const bool Controls::ThreadCapsule::isEcho ( ) const

Checks if echo is enabled.

Returns
True if echo is enabled, false otherwise.

Definition at line 170 of file ThreadCapsule.cpp.

◆ isHelp()

const bool Controls::ThreadCapsule::isHelp ( ) const

Checks if help is enabled.

Returns
True if help is enabled, false otherwise.

Definition at line 180 of file ThreadCapsule.cpp.

◆ isLooping()

const bool Controls::ThreadCapsule::isLooping ( ) const

Checks if looping is enabled.

Returns
True if looping is enabled, false otherwise.

Definition at line 200 of file ThreadCapsule.cpp.

◆ isPlaying()

const bool Controls::ThreadCapsule::isPlaying ( ) const

Checks if playing is enabled.

Returns
True if playing is enabled, false otherwise.

Definition at line 190 of file ThreadCapsule.cpp.

◆ isRecording()

const bool Controls::ThreadCapsule::isRecording ( ) const

Checks if recording is enabled.

Returns
True if recording is enabled, false otherwise.

Definition at line 210 of file ThreadCapsule.cpp.

◆ isRunning()

const bool Controls::ThreadCapsule::isRunning ( ) const

Checks if the thread is running.

Returns
True if the thread is running, false otherwise.

Definition at line 100 of file ThreadCapsule.cpp.

◆ setEcho()

void Controls::ThreadCapsule::setEcho ( const bool echo)

Sets the echo state.

Parameters
echoThe new echo state.

Definition at line 110 of file ThreadCapsule.cpp.

◆ setHelp()

void Controls::ThreadCapsule::setHelp ( const bool help)

Sets the help state.

Parameters
helpThe new help state.

Definition at line 120 of file ThreadCapsule.cpp.

◆ setLooping()

void Controls::ThreadCapsule::setLooping ( const bool looping)

Sets the looping state.

Parameters
loopingThe new looping state.

Definition at line 140 of file ThreadCapsule.cpp.

◆ setPlaying()

void Controls::ThreadCapsule::setPlaying ( const bool playing)

Sets the playing state.

Parameters
playingThe new playing state.

Definition at line 130 of file ThreadCapsule.cpp.

◆ setRecording()

void Controls::ThreadCapsule::setRecording ( const bool recording)

Sets the recording state.

Parameters
recordingThe new recording state.

Definition at line 150 of file ThreadCapsule.cpp.

◆ setUserChoice()

void Controls::ThreadCapsule::setUserChoice ( const std::string & userChoice)

Processes the user choice.

Sets the user choice and performs the corresponding action.

Parameters
userChoiceThe user choice.

Definition at line 160 of file ThreadCapsule.cpp.

◆ showPrompt()

void Controls::ThreadCapsule::showPrompt ( ) const

Displays the prompt to the user.

Shows the prompt to the user.

Definition at line 228 of file ThreadCapsule.cpp.

◆ startThread()

void Controls::ThreadCapsule::startThread ( )

Starts the thread to run the spamUserChoice function.

Starts the thread for user controls.

Definition at line 31 of file ThreadCapsule.cpp.

◆ stopThread()

void Controls::ThreadCapsule::stopThread ( const unsigned int delay = 2)

Stops the thread safely.

Stops the thread for user controls.

Definition at line 43 of file ThreadCapsule.cpp.

◆ toggleEcho()

void Controls::ThreadCapsule::toggleEcho ( )

Toggles the echo state.

Definition at line 236 of file ThreadCapsule.cpp.

◆ toggleHelp()

void Controls::ThreadCapsule::toggleHelp ( )

Toggles the help state.

Definition at line 244 of file ThreadCapsule.cpp.

◆ toggleLooping()

void Controls::ThreadCapsule::toggleLooping ( )

Toggles the looping state.

Definition at line 260 of file ThreadCapsule.cpp.

◆ togglePlaying()

void Controls::ThreadCapsule::togglePlaying ( )

Toggles the playing state.

Definition at line 252 of file ThreadCapsule.cpp.

◆ toggleRecording()

void Controls::ThreadCapsule::toggleRecording ( )

Toggles the recording state.

Definition at line 268 of file ThreadCapsule.cpp.


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