Tempo
Tempo is an app that allows users to create and manage timers, stopwatches, and alarms.
Menu.hpp
Go to the documentation of this file.
1 #ifndef MENU_HPP
2 #define MENU_HPP
3 
4 #include <iostream>
5 #include <conio.h>
6 #include <cstdlib>
7 #include <fstream>
8 
9 #include "Timer.hpp"
10 #include "Stopwatch.hpp"
11 #include "Alarm.hpp"
12 #include "Display.hpp"
13 #include "Notification.hpp"
14 
15 
16 using namespace std;
17 
21 class Menu
22 {
23 public:
27  Menu(bool testing);
28 
37  char getMenuInput(int& selected);
38 
47  char getSettingsInput(int& selected);
48 
57  void wait(double seconds);
58 
64  void waitForInput();
65 
74  void checkTimerInput(Timer &timer, bool &run);
75 
84  void checkStopwatchInput(Stopwatch &stopwatch, bool &run);
85 
94  void checkAlarmInput(Alarm& alarm, bool& run);
95 
103  void mainMenu(int selected);
104 
112  void settingsMenu(int selected);
113 
117  void loadSettings();
118 
122  void saveSettings();
123 
127  void credits();
128 
132  void timerSequence();
133 
137  void stopwatchSequence();
138 
142  void alarmSequence();
143 
153  Timer createTimer(bool& run);
154 
164  Alarm createAlarm(bool& run);
165 
175  void printTimerInput(int,int,int);
176 
186  void printArt(vector<string> art, string formatting);
187 
188 private:
190  bool _run;
191  bool _testing;
192 
193  vector<string> _menuFormats;
194  vector<string> _settingsFormats;
195 
198 
199 
200  vector<string> _logoArt = {
201  " ",
202  " &&&&&&&&&&&&&&&& ",
203  " &&&&&&&&&&&&&&& ",
204  " &&&&&& &&&&&&&&&&&&& &&&&&& &&&&&&& &&&&&&&& &&&&&&&&&&& &&&&&&&&&&&&& ",
205  " &&&&&% &&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&& &&&&&&&&&&&&&&& ",
206  " &&&&&& &&&&&& &&&&&& &&&&&& &&&&&& &&&&&& &&&&&& &&&&&& &&&&& &&&&&& ",
207  " &&&&&& &&&&&&&&&&&&&&& &&&&&& &&&&&&& &&&&&& &&&&&& &&&&&& &&&&&& &&&&&& ",
208  " &&&&&&& &&&&&& &&&&&& &&&&&& &&&&&& &&&&&&& &&&&&& &&&&&& &&&&&& ",
209  " &&&&&& &&&&&&& &&&& &&&&&& &&&&&&# &&&&&& &&&&&&&&&&&&&&& &&&&&&&&&&&&&&& ",
210  " &&&&&&& %&&&&&&&&&&&&& &&&&&& &&&&&& #&&&&&& &&&&&&&&&&&& &&&&&&&&&&&& ",
211  " &&&&&& ",
212  " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ",
213  " &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ",
214  " "
215  };
216 
217 
218  vector<string> _credits = {
219  "-------------------------------------",
220  " Tempo v1.0 ",
221  "-------------------------------------",
222  " A lightweight timer, stopwatch,",
223  " and alarm terminal app.",
224  "-------------------------------------",
225  " Developed by:",
226  " William Donnelly",
227  " Kevin Albert",
228  " Rowan Zeszut",
229  " Ben Sampson",
230  "-------------------------------------",
231  "",
232  " Press any key to continue...",
233  };
234 
235  vector<string> _menuArt = {
236  " ___ _ ",
237  " |\\/| /\\ | |\\ | |\\/| |_ |\\ | | | ",
238  " | | /--\\ _|_ | \\| | | |_ | \\| |_| ",
239  "________________________________________________",
240  "",
241  };
242 
243  vector<string> _menuTimer = {
244  " ___ ___ _ _ ",
245  " /| o | | |\\/| |_ |_) ",
246  " | o | _|_ | | |_ | \\ ",
247  " ",
248  };
249  vector<string> _menuStopwatch = {
250  " _ __ ___ _ _ ___ _ ",
251  " ) o (_ | / \\ |_) \\ / /\\ | / |_| ",
252  " /_ o __) | \\_/ | \\/\\/ /--\\ | \\_ | | ",
253  " ",
254  };
255  vector<string> _menuAlarm = {
256  " _ _ ",
257  " _) o /\\ | /\\ |_) |\\/| ",
258  " _) o /--\\ |_ /--\\ | \\ | | ",
259  " ",
260  };
261  vector<string> _menuSettings = {
262  " __ __ _ ___ ___ ___ __ __ ",
263  "(_ o (_ |_ | | | |\\ | /__ (_ ",
264  "__) o __) |_ | | _|_ | \\| \\_| __) ",
265  " ",
266  };
267  vector<string> _menuQuit = {
268  " _ _ ___ ___ ",
269  "/ \\ o / \\ | | | | ",
270  "\\_X o \\_X |_| _|_ | ",
271  " ",
272  };
273  vector<string> _menuBlank = {
274  " ",
275  " ",
276  " ",
277  " ",
278  " ",
279  " ",
280  " ",
281  " ",
282  " ",
283  " ",
284  " ",
285  " ",
286  " ",
287  " ",
288  " ",
289  " ",
290  " ",
291  " ",
292  " ",
293  " ",
294  " ",
295  " ",
296  " ",
297  " ",
298  " ",
299  " ",
300  " ",
301  " ",
302  " ",
303  " ",
304  " ",
305  " ",
306  };
307 
308  vector<string> _settingsArt = {
309  " __ _ ___ ___ ___ __ __ ",
310  " (_ |_ | | | |\\ | /__ (_ ",
311  " __) |_ | | _|_ | \\| \\_| __) ",
312  "____________________________________ ",
313  " ",
314  };
315 
316  vector<string> _settingsFont1 = {
317  " $$\\ ",
318  " $$$$ | ",
319  " _ ___ __ ___ ___ _ _ ___ \\_$$ | ",
320  " /| o | \\ | /__ | | |_ / \\ |\\ | | __ $$ | ",
321  " | o |_/ _|_ \\_| _|_ | | \\_/ | \\| | $$ | ",
322  " $$ | ",
323  " $$$$$$\\ ",
324  " \\______| ",
325 
326  };
327  vector<string> _settingsFont2 = {
328  " _ ___ __ ___ ___ _ _ ___ _ ",
329  " /| o | \\ | /__ | | |_ / \\ |\\ | | __ ) ",
330  " | o |_/ _|_ \\_| _|_ | | \\_/ | \\| | /_ ",
331  " ",
332  };
333  vector<string> _settingsFont3 = {
334  " .--. ",
335  " / \\ ",
336  " (___)`. | ",
337  " _ ___ __ ___ ___ _ _ ___ .-' / ",
338  " /| o | \\ | /__ | | |_ / \\ |\\ | | __ '. \\ ",
339  " | o |_/ _|_ \\_| _|_ | | \\_/ | \\| | ___ \\ ' ",
340  " ( ) ; | ",
341  " \\ `-' / ",
342  " ',__.' ",
343  };
344  vector<string> _settingsFont4 = {
345  " d8888 ",
346  " d8P888 ",
347  " _ ___ __ ___ ___ _ _ ___ d8P 888 ",
348  " /| o | \\ | /__ | | |_ / \\ |\\ | | __ d8P 888 ",
349  " | o |_/ _|_ \\_| _|_ | | \\_/ | \\| | d88 888 ",
350  " 8888888888 ",
351  " 888 ",
352  " 888 ",
353  };
354 
355  vector<string> _settingsNotiOn = {
356  " _ _ ___ ___ _ ___ _ ___ ___ _ __ _ ",
357  " ) o |\\ | / \\ | | |_ | / /\\ | | / \\ |\\ | (_ __ / \\ |\\ | ",
358  " /_ o | \\| \\_/ | _|_ | _|_ \\_ /--\\ | _|_ \\_/ | \\| __) \\_/ | \\| ",
359  " ",
360  };
361  vector<string> _settingsNotiOff = {
362  " _ _ ___ ___ _ ___ _ ___ ___ _ __ _ _ _ ",
363  " ) o |\\ | / \\ | | |_ | / /\\ | | / \\ |\\ | (_ __ / \\ |_ |_ ",
364  " /_ o | \\| \\_/ | _|_ | _|_ \\_ /--\\ | _|_ \\_/ | \\| __) \\_/ | | ",
365  " ",
366  };
367  vector<string> _settingsCredits = {
368  " _ _ _ _ _ ___ ___ __ ",
369  " _) o / |_) |_ | \\ | | (_ ",
370  " _) o \\_ | \\ |_ |_/ _|_ | __) ",
371  " ",
372  };
373  vector<string> _settingsBack = {
374  " _ _ _ ",
375  "/ \\ o |_) /\\ / |/ ",
376  "\\_X o |_) /--\\ \\_ |\\ ",
377  " ",
378 
379  };
380  vector<string> _settingsBlank = {
381  " ",
382  " ",
383  " ",
384  " ",
385  " ",
386  " ",
387  " ",
388  " ",
389  " ",
390  " ",
391  " ",
392  " ",
393  " ",
394  " ",
395  " ",
396  " ",
397  " ",
398  " ",
399  " ",
400  " ",
401  " ",
402  " ",
403  " ",
404  " ",
405  " ",
406  " ",
407  " ",
408  " ",
409  " ",
410  " ",
411  " ",
412  " ",
413  };
414 
415  vector<string> _stopMessages = {
416  "EXACTLY ON THE DOT! YOU MUST BE A TIME WIZARD.",
417  "THERE'S NO WAY YOU MEANT TO DO THAT...",
418  "YOU'VE ACHIEVED STOPWATCH ZEN.",
419  "IF YOU DID THAT ON PURPOSE, I'M IMPRESSED.",
420  "DAMN, NICE REFLEXES.",
421  "YOU'RE A MEAN GREEN STOPWATCH MACHINE.",
422  "MEAN GREEN STOPWATCH MACHINE",
423  "YOU HAVE TO BE A ROBOT, RIGHT?",
424  "EVEN QUICKSILVER COULDN'T HAVE DONE IT BETTER.",
425  "YOU ARE A BUM, GO HOME LOSER!!!!"
426  };
427 
428 };
429 
430 #endif // MENU_HPP
A class to manage alarms with time-based triggers.
Definition: Alarm.hpp:13
The Timer class provides a countdown timer with start, pause, resume, reset, and time adjustment func...
Definition: Timer.hpp:12
The Menu class manages the main menu and user input for the Timer Stopwatch and Alarm.
Definition: Menu.hpp:21
The Stopwatch class provides a simple timer with start, pause, resume, and reset functionalities.
Definition: Stopwatch.hpp:13
bool _run
Boolean to control the main loop execution.
Definition: Menu.hpp:190
STL namespace.
vector< string > _menuFormats
Definition: Menu.hpp:193
vector< string > _settingsFormats
Definition: Menu.hpp:194
bool _notiSetting
Definition: Menu.hpp:196
int _fontSetting
Definition: Menu.hpp:197
bool _testing
Definition: Menu.hpp:191
Display _display
Instance of Display to manage the visual representation.
Definition: Menu.hpp:189
The Display class manages the visual representation and interaction logic for timers, stopwatches, and alarms.
Definition: Display.hpp:23