Babel  1
The voip software that only works on your local network
Loading...
Searching...
No Matches
UserControls.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** epitech-ratrappage-babel (Workspace)
4** File description:
5** Controls.hpp
6*/
7
13#pragma once
14#include <atomic>
15#include <string>
16
17#include "Logging.hpp"
18#include "Recoded.hpp"
19#include "CustomExceptions.hpp"
20
21namespace Controls
22{
27 public:
30
35 void setEcho(const bool echo);
36
41 void setHelp(const bool help);
42
47 void setPlaying(const bool playing);
48
53 void setLooping(const bool looping);
54
59 void setRecording(const bool recording);
60
65 void setUserChoice(const std::string &userChoice);
66
71 const bool isEcho() const;
72
77 const bool isHelp() const;
78
83 const bool isPlaying() const;
84
89 const bool isLooping() const;
90
95 const bool isRecording() const;
96
101 const bool hangUpTheCall() const;
102
106 void toggleEcho();
107
111 void toggleHelp();
112
116 void togglePlaying();
117
121 void toggleLooping();
122
126 void toggleRecording();
127
132 const bool getEcho() const;
133
138 const bool getHelp() const;
139
144 const bool getPlaying() const;
145
150 const bool getLooping() const;
151
156 const bool getRecording() const;
157
161 void spamUserChoice();
162
169 const std::string getInfo(const unsigned int indent = 0) const;
170
174 void showPrompt() const;
175
176 private:
180 void _displayHelp() const;
181
182 const std::string _gatherResponse() const;
183
188 const std::string _getUserChoice() const;
189
190 std::atomic<bool> _echo = false;
191 std::atomic<bool> _help = false;
192 std::atomic<bool> _hangUp = false;
193 std::atomic<bool> _playing = false;
194 std::atomic<bool> _looping = true;
195 std::atomic<bool> _recording = false;
196 };
197
205 std::ostream &operator<<(std::ostream &os, const UserControls &network);
206}
Aggregates custom exception headers.
Aggregates logging-related headers.
Aggregates headers from the Recoded folder.
Manages user input and control states.
void spamUserChoice()
Continuously prompts the user for input and processes it.
const bool getEcho() const
Gets the echo state.
void togglePlaying()
Toggles the playing state.
void setUserChoice(const std::string &userChoice)
Processes the user choice.
const bool getRecording() const
Gets the recording state.
const bool isRecording() const
Checks if recording is enabled.
const bool isPlaying() const
Checks if playing is enabled.
void setRecording(const bool recording)
Sets the recording state.
void toggleLooping()
Toggles the looping state.
const bool getHelp() const
Gets the help state.
void setHelp(const bool help)
Sets the help state.
void setPlaying(const bool playing)
Sets the playing state.
const bool getLooping() const
Gets the looping state.
void setLooping(const bool looping)
Sets the looping state.
const bool hangUpTheCall() const
Checks if the call should be hung up.
void toggleHelp()
Toggles the help state.
const bool isHelp() const
Checks if help is enabled.
const bool getPlaying() const
Gets the playing state.
void setEcho(const bool echo)
Sets the echo state.
void toggleRecording()
Toggles the recording state.
const bool isEcho() const
Checks if echo is enabled.
void toggleEcho()
Toggles the echo state.
const bool isLooping() const
Checks if looping is enabled.
void showPrompt() const
Displays the prompt to the user.
const std::string getInfo(const unsigned int indent=0) const
Dumps the current state of the variables for debugging purposes.
std::ostream & operator<<(std::ostream &os, const ThreadCapsule &network)
Overloads the stream insertion operator for ThreadCapsule.