Tempo
Tempo is an app that allows users to create and manage timers, stopwatches, and alarms.
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
Display Class Reference

The Display class manages the visual representation and interaction logic for timers, stopwatches, and alarms. More...

#include <Display.hpp>

Collaboration diagram for Display:
Collaboration graph
[legend]

Public Member Functions

 Display ()
 Constructs a new Display object. More...
 
void tickTimerSetup (string to_print)
 Updates the timer setup display, showing the current input with a blinking cursor. More...
 
void tickAlarmSetup (string to_print, bool isAM)
 Updates the alarm setup display, showing the current input with a blinking cursor. More...
 
void tickTimer (Timer &timer)
 Updates the display based on the state of the provided Timer object. More...
 
void tickStopwatch (Stopwatch &stopwatch)
 Updates the display based on the state of the provided Stopwatch object. More...
 
void tickAlarm (Alarm &alarm)
 Updates the display based on the state of the provided Alarm object. More...
 
void stageTimerDisplay (int hours, int minutes, int seconds, int tenths)
 Stages the timer display with provided time values. More...
 
void stageAlarmDisplay (string time)
 Converts the alarm time into an ASCII representation and stages it for display. More...
 
void stageArt (vector< string > art)
 Stages the controls for the timer. More...
 
void stageTimerBar (double percentage)
 Stages the progress bar for the timer. More...
 
void stageAlarmBar (double percentage)
 Creates a visual progress bar for the alarm based on the percentage completed. More...
 
void stageStopwatchDisplay (int hours, int minutes, int seconds, int hundredths)
 Stages the stopwatch display with provided time values. More...
 
void stageStopwatchSplits (vector< int > splits)
 Stages the splits block to be displayed. More...
 
void stageAlarmDisplay ()
 Stages the display for the alarm. More...
 
void setSplash (string str)
 Sets the splash screen text. More...
 
void clearSplash ()
 Clears the splash screen. More...
 
void printSplash (int splashIndex, string formatting)
 Prints the splash screen to the terminal. More...
 
void printAscii (int asciiIndex, string formatting)
 Prints ASCII art to the terminal. More...
 
void printArt (int controlIndex, string formatting)
 Prints controls to the terminal. More...
 
void printBar (int barIndex, string formatting)
 Prints the progress bar to the terminal. More...
 
void printSplits (int splitsIndex, string formatting)
 Prints the stopwatch splits to the terminal. More...
 
void clearScreen ()
 Clears the terminal screen. More...
 
void setFormat (const string &code)
 Sets the terminal text color. More...
 
void clearFormat ()
 Clears the terminal text color. More...
 
void setCursor (int x, int y)
 Sets the cursor position in the terminal. More...
 
void clearLine (int lineIndex)
 Clears a specific line in the terminal. More...
 
void setFont (int num)
 Sets the font style for the terminal. More...
 

Static Public Member Functions

template<typename char_type >
static auto fast_print (const basic_string< char_type > &sss) -> void
 Efficiently prints a string to the terminal. More...
 

Static Public Attributes

static const string SELECTED = "\033[1;30;46m"
 
static const string BOLD = "\033[1m"
 
static const string BLACK = "\033[30m"
 
static const string RED = "\033[31m"
 
static const string GREEN = "\033[32m"
 
static const string YELLOW = "\033[33m"
 
static const string BLUE = "\033[34m"
 
static const string MAGENTA = "\033[35m"
 
static const string CYAN = "\033[36m"
 
static const string WHITE = "\033[37m"
 
static const string BOLD_BLACK = "\033[1;30m"
 
static const string BOLD_RED = "\033[1;31m"
 
static const string BOLD_GREEN = "\033[1;32m"
 
static const string BOLD_YELLOW = "\033[1;33m"
 
static const string BOLD_BLUE = "\033[1;34m"
 
static const string BOLD_MAGENTA = "\033[1;35m"
 
static const string BOLD_CYAN = "\033[1;36m"
 
static const string BOLD_WHITE = "\033[1;37m"
 

Private Attributes

string _asciiBuffer
 Buffer for ASCII art. More...
 
string _barBuffer
 Buffer for progress bar. More...
 
string _controlBuffer
 Buffer for controls. More...
 
string _splitBuffer
 Buffer for the splits block. More...
 
string _splash
 String for splash screen. More...
 
string _oldAscii
 Previous ASCII art for comparison. More...
 
string _oldControls
 Previous controls for comparison. More...
 
string _oldBar
 Previous progress bar for comparison. More...
 
string _oldSplash
 Previous splash screen for comparison. More...
 
string _oldSplits
 Previous splits for comparison. More...
 
vector< vector< vector< string > > > _fonts
 List of font ascii. More...
 
vector< int > _fontHeights
 List of font heights. More...
 
vector< vector< string > > _currFont
 current font ascii More...
 
int ASCII_HEIGHT
 
string PADDING
 
string _formatting
 
string _oldFormatting
 
int _asciiWidth
 Width of the ASCII art. More...
 
vector< string > _timerSetupControls
 
vector< string > _alarmSetupControls
 
vector< string > _alarmSetupAM
 
vector< string > _alarmSetupPM
 
vector< string > _alarmControls
 
vector< string > _timerControls
 
vector< string > _stopwatchControls
 

Detailed Description

The Display class manages the visual representation and interaction logic for timers, stopwatches, and alarms.

Handles the terminal display for a timer and stopwatch, including ASCII art and controls.

Definition at line 23 of file Display.hpp.

Constructor & Destructor Documentation

◆ Display()

Display::Display ( )

Constructs a new Display object.

Definition at line 39 of file Display.cpp.

References f1_ascii, f1_height, f2_ascii, f2_height, f3_ascii, f3_height, f4_ascii, and f4_height.

40 {
41  _splash = "";
42  _asciiBuffer = "";
43  _barBuffer = "";
44  _controlBuffer = "";
45  _splitBuffer = "";
46 
47  _oldAscii = "";
48  _oldControls = "";
49  _oldSplash = "";
50  _oldSplits = "";
51 
54 
55  setFont(1);
56 
57  _asciiWidth = 0;
58 }
int f2_height
Definition: font2.cpp:117
string _oldAscii
Previous ASCII art for comparison.
Definition: Display.hpp:211
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
string _splitBuffer
Buffer for the splits block.
Definition: Display.hpp:208
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
string _splash
String for splash screen.
Definition: Display.hpp:209
void setFont(int num)
Sets the font style for the terminal.
Definition: Display.cpp:79
vector< vector< string > > f3_ascii
Definition: font3.cpp:199
string _oldSplits
Previous splits for comparison.
Definition: Display.hpp:215
vector< int > _fontHeights
List of font heights.
Definition: Display.hpp:218
string _barBuffer
Buffer for progress bar.
Definition: Display.hpp:206
string _oldSplash
Previous splash screen for comparison.
Definition: Display.hpp:214
int f1_height
Definition: font1.cpp:161
vector< vector< vector< string > > > _fonts
List of font ascii.
Definition: Display.hpp:217
int f4_height
Definition: font4.cpp:185
int f3_height
Definition: font3.cpp:200
string _oldControls
Previous controls for comparison.
Definition: Display.hpp:212
string _controlBuffer
Buffer for controls.
Definition: Display.hpp:207
vector< vector< string > > f4_ascii
Definition: font4.cpp:184
vector< vector< string > > f2_ascii
Definition: font2.cpp:116
vector< vector< string > > f1_ascii
Definition: font1.cpp:160

Member Function Documentation

◆ clearFormat()

void Display::clearFormat ( )

Clears the terminal text color.

Clears the formatting for the text to be displayed.

Definition at line 147 of file Display.cpp.

147  {
149  _formatting = "\033[0m";
150 
152 }
string _oldFormatting
Definition: Display.hpp:225
string _formatting
Definition: Display.hpp:224
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124

◆ clearLine()

void Display::clearLine ( int  row)

Clears a specific line in the terminal.

Parameters
lineIndexThe index of the line to clear.
rowThe row number to clear.

Definition at line 111 of file Display.cpp.

112 {
113  string clearline = "\033[K";
114  setCursor(row, 1);
115  fast_print(clearline);
116 }
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124

◆ clearScreen()

void Display::clearScreen ( )

Clears the terminal screen.

Clears the terminal screen and resets the old buffers.

Definition at line 67 of file Display.cpp.

68 {
69  string clearscreen = "\033[2J\033[H";
70 
71  _oldAscii = "";
72  _oldControls = "";
73  _oldSplash = "";
74  _oldBar = "";
75 
76  fast_print(clearscreen);
77 }
string _oldAscii
Previous ASCII art for comparison.
Definition: Display.hpp:211
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124
string _oldSplash
Previous splash screen for comparison.
Definition: Display.hpp:214
string _oldBar
Previous progress bar for comparison.
Definition: Display.hpp:213
string _oldControls
Previous controls for comparison.
Definition: Display.hpp:212

◆ clearSplash()

void Display::clearSplash ( )

Clears the splash screen.

Clears the splash text from the screen.

Definition at line 170 of file Display.cpp.

171 {
172  _splash = "";
173 }
string _splash
String for splash screen.
Definition: Display.hpp:209

◆ fast_print()

template<typename char_type >
auto Display::fast_print ( const basic_string< char_type > &  sss) -> void
static

Efficiently prints a string to the terminal.

Prints a string to the console efficiently using the Windows API.

Template Parameters
char_typeThe character type of the string.
Parameters
sssThe string to print.
Template Parameters
char_typeThe character type (either char or wchar_t).
Parameters
sssThe string to print.

Definition at line 124 of file Display.cpp.

125 {
126  HANDLE const output_handle = GetStdHandle(STD_OUTPUT_HANDLE);
127  const auto char_count = static_cast<DWORD>(sss.length());
128  if constexpr (std::is_same_v<char_type, char>)
129  WriteConsoleA(output_handle, sss.c_str(), char_count, nullptr, nullptr);
130  else
131  WriteConsoleW(output_handle, sss.c_str(), char_count, nullptr, nullptr);
132 }

◆ printArt()

void Display::printArt ( int  row,
string  formatting 
)

Prints controls to the terminal.

Prints the controls for the timer or stopwatch to the terminal.

Parameters
controlIndexThe index used for control display.
rowThe row position to print.

Definition at line 588 of file Display.cpp.

589 {
590  setFormat(formatting);
591 
593  {
594  setCursor(row, 1);
597  }
598  _controlBuffer = "";
599 
600  clearFormat();
601 }
string _oldFormatting
Definition: Display.hpp:225
string _formatting
Definition: Display.hpp:224
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void setFormat(const string &code)
Sets the terminal text color.
Definition: Display.cpp:138
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124
string _oldControls
Previous controls for comparison.
Definition: Display.hpp:212
string _controlBuffer
Buffer for controls.
Definition: Display.hpp:207

◆ printAscii()

void Display::printAscii ( int  row,
string  formatting 
)

Prints ASCII art to the terminal.

Prints the ASCII art representation of the timer or stopwatch to the terminal.

Parameters
asciiIndexThe index used for ASCII control.
rowThe row position to print.

Definition at line 569 of file Display.cpp.

570 {
571  setFormat(formatting);
572 
574  {
575  setCursor(row, 1);
578  }
579  _asciiBuffer = "";
580 
581  clearFormat();
582 }
string _oldFormatting
Definition: Display.hpp:225
string _oldAscii
Previous ASCII art for comparison.
Definition: Display.hpp:211
string _formatting
Definition: Display.hpp:224
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void setFormat(const string &code)
Sets the terminal text color.
Definition: Display.cpp:138
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124

◆ printBar()

void Display::printBar ( int  row,
string  formatting 
)

Prints the progress bar to the terminal.

Prints the progress bar for the timer to the terminal.

Parameters
barIndexThe index used for bar control.
rowThe row position to print.

Definition at line 607 of file Display.cpp.

608 {
609  setFormat(formatting);
610 
612  {
613  setCursor(row, 1);
616  }
617  _barBuffer = "";
618 
619  clearFormat();
620 }
string _oldFormatting
Definition: Display.hpp:225
string _formatting
Definition: Display.hpp:224
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void setFormat(const string &code)
Sets the terminal text color.
Definition: Display.cpp:138
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124
string _barBuffer
Buffer for progress bar.
Definition: Display.hpp:206
string _oldBar
Previous progress bar for comparison.
Definition: Display.hpp:213

◆ printSplash()

void Display::printSplash ( int  row,
string  formatting 
)

Prints the splash screen to the terminal.

Prints the splash text to the terminal.

Parameters
splashIndexThe index used for splash screen control.
rowThe row position to print.

Definition at line 626 of file Display.cpp.

627 {
628  setFormat(formatting);
629 
631  {
632  clearLine(row);
633  setCursor(row, 1);
636  }
637 
638  clearFormat();
639 }
string _oldFormatting
Definition: Display.hpp:225
string _formatting
Definition: Display.hpp:224
string _splash
String for splash screen.
Definition: Display.hpp:209
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void setFormat(const string &code)
Sets the terminal text color.
Definition: Display.cpp:138
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124
string _oldSplash
Previous splash screen for comparison.
Definition: Display.hpp:214
void clearLine(int lineIndex)
Clears a specific line in the terminal.
Definition: Display.cpp:111

◆ printSplits()

void Display::printSplits ( int  row,
string  formatting 
)

Prints the stopwatch splits to the terminal.

Parameters
rowThe row position to print.

Definition at line 645 of file Display.cpp.

646 {
647  setFormat(formatting);
649  {
650  setCursor(row, 1);
653  }
654  _splitBuffer = "";
655 
656  clearFormat();
657 }
string _oldFormatting
Definition: Display.hpp:225
string _formatting
Definition: Display.hpp:224
string _splitBuffer
Buffer for the splits block.
Definition: Display.hpp:208
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void setFormat(const string &code)
Sets the terminal text color.
Definition: Display.cpp:138
string _oldSplits
Previous splits for comparison.
Definition: Display.hpp:215
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124

◆ setCursor()

void Display::setCursor ( int  row,
int  col 
)

Sets the cursor position in the terminal.

Parameters
xThe x-coordinate (column) to move the cursor to.
yThe y-coordinate (row) to move the cursor to.
rowThe row position.
colThe column position.

Definition at line 101 of file Display.cpp.

102 {
103  string setcursor = "\033[" + to_string(row) + ";" + to_string(col) + "H";
104  fast_print(setcursor);
105 }
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124

◆ setFont()

void Display::setFont ( int  num)

Sets the font style for the terminal.

Parameters
numThe font style to set.

Definition at line 79 of file Display.cpp.

80 {
81  _currFont = _fonts.at(num-1);
82 
83  ASCII_HEIGHT = _fontHeights.at(num-1);
84 
85  if(ASCII_HEIGHT >= 8){
86  PADDING = "";
87  for(int i=0; i< ASCII_HEIGHT/4; i++){
88  PADDING += " ";
89  }
90  }
91  else{
92  PADDING = "";
93  }
94 }
int ASCII_HEIGHT
Definition: Display.hpp:221
vector< int > _fontHeights
List of font heights.
Definition: Display.hpp:218
vector< vector< string > > _currFont
current font ascii
Definition: Display.hpp:219
vector< vector< vector< string > > > _fonts
List of font ascii.
Definition: Display.hpp:217
string PADDING
Definition: Display.hpp:222

◆ setFormat()

void Display::setFormat ( const string &  code)

Sets the terminal text color.

Sets the formatting for the text to be displayed.

Parameters
colorThe color to set the text to.
Template Parameters
codestring& The formatting code.

Definition at line 138 of file Display.cpp.

138  {
140  _formatting = code;
142 }
string _oldFormatting
Definition: Display.hpp:225
string _formatting
Definition: Display.hpp:224
static auto fast_print(const basic_string< char_type > &sss) -> void
Efficiently prints a string to the terminal.
Definition: Display.cpp:124

◆ setSplash()

void Display::setSplash ( string  str)

Sets the splash screen text.

Sets the splash text to be displayed at the top or bottom of the screen.

Parameters
strThe string to display as the splash screen.
strThe splash text to display.

Definition at line 162 of file Display.cpp.

163 {
164  _splash = "<< " + str + " >>";
165 }
string _splash
String for splash screen.
Definition: Display.hpp:209

◆ stageAlarmBar()

void Display::stageAlarmBar ( double  percentage)

Creates a visual progress bar for the alarm based on the percentage completed.

Parameters
percentageThe percentage of completion.

Definition at line 356 of file Display.cpp.

357 {
358  int width = _asciiWidth - 2;
359  int filled = (int)((percentage / 100) * width);
360 
361  string border = "";
362 
363  // Build the top and bottom borders of the bar
364  border += "+";
365  for (int i = 0; i < width; ++i)
366  {
367  border += "-";
368  }
369  border += "+\n";
370 
371  _barBuffer += border;
372 
373  _barBuffer += "|";
374 
375  // Fill the bar with '#' characters based on the percentage completed
376  for (int i = 0; i < width; ++i)
377  {
378  if (i < filled)
379  {
380  _barBuffer += "#";
381  }
382  else
383  {
384  _barBuffer += " ";
385  }
386  }
387 
388  _barBuffer += "|\n";
389  _barBuffer += border;
390 
391 }
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
string _barBuffer
Buffer for progress bar.
Definition: Display.hpp:206

◆ stageAlarmDisplay() [1/2]

void Display::stageAlarmDisplay ( string  time)

Converts the alarm time into an ASCII representation and stages it for display.

Parameters
timeThe alarm time string in "HH:MM" format.

Definition at line 247 of file Display.cpp.

247  {
248 
249  string to_print = "";
250 
251  int hours = stoi(time.substr(0,2));
252  int minutes = stoi(time.substr(3,2));
253 
254  // Determine AM/PM and convert 24-hour format to 12-hour format
255  string period = (hours >= 12) ? "pm" : "am";
256  hours = hours % 12; // Convert 24-hour to 12-hour format
257  if (hours == 0) { hours = 12; } // Handle the case where hour is 0 (midnight or noon)
258 
259  to_print += to_string(hours) + ":";
260 
261  // Add leading zero to minutes if needed
262  if (int(minutes / 10) != 0)
263  {
264  to_print += to_string(minutes);
265  }
266  else
267  {
268  to_print += "0" + to_string(minutes);
269  }
270 
271  // Add " am" or " pm"
272  to_print += period;
273 
274 
275  // Build the ASCII art for the alarm display
276  for (int i = 0; i < ASCII_HEIGHT; i++)
277  {
278  string line;
279  for (char ch : to_print)
280  {
281  if (ch == ':')
282  {
283  line += _currFont.at(10)[i];
284  line += PADDING;
285  }
286  else if (ch == 'a')
287  {
288  line += _currFont.at(12)[i];
289  line += PADDING;
290  }
291  else if (ch == 'p')
292  {
293  line += _currFont.at(13)[i];
294  line += PADDING;
295  }
296  else if (ch == 'm')
297  {
298  line += _currFont.at(14)[i];
299  line += PADDING;
300  }
301  else
302  {
303  line += _currFont.at(ch - '0')[i];
304  line += PADDING;
305  }
306  }
307  _asciiWidth = line.length();
308  _asciiBuffer += (line + "\n");
309  }
310 }
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
int ASCII_HEIGHT
Definition: Display.hpp:221
vector< vector< string > > _currFont
current font ascii
Definition: Display.hpp:219
string PADDING
Definition: Display.hpp:222

◆ stageAlarmDisplay() [2/2]

void Display::stageAlarmDisplay ( )

Stages the display for the alarm.

◆ stageArt()

void Display::stageArt ( vector< string >  art)

Stages the controls for the timer.

Stages vector<string> ascii art to be displayed in the terminal.

Definition at line 396 of file Display.cpp.

397 {
398  for(int i=0; i<art.size(); ++i){
399  _controlBuffer += (art.at(i) + "\n");
400  }
401 }
string _controlBuffer
Buffer for controls.
Definition: Display.hpp:207

◆ stageStopwatchDisplay()

void Display::stageStopwatchDisplay ( int  hours,
int  minutes,
int  seconds,
int  hundredths 
)

Stages the stopwatch display with provided time values.

Converts the stopwatch values into an ASCII representation and stages it for display.

Parameters
hoursHours to display.
minutesMinutes to display.
secondsSeconds to display.
hundredthsHundredths of a second to display.
hoursThe number of hours.
minutesThe number of minutes.
secondsThe number of seconds.
hundredthsThe number of hundredths of a second.

Definition at line 414 of file Display.cpp.

415 {
416  string to_print = "";
417 
418  // Only show hours if there are more than 0
419  if (hours != 0)
420  {
421  to_print += to_string(hours) + ":";
422  }
423 
424  // Show minutes with a leading zero if needed
425  if (hours)
426  {
427  if (int(minutes / 10) != 0)
428  {
429  to_print += to_string(minutes) + ":";
430  }
431  else
432  {
433  to_print += "0" + to_string(minutes) + ":";
434  }
435  }
436  else if (minutes)
437  {
438  to_print += to_string(minutes) + ":";
439  }
440 
441  // Show seconds with a leading zero if needed
442  if (hours || minutes)
443  {
444  if (int(seconds / 10) != 0)
445  {
446  to_print += to_string(seconds);
447  }
448  else
449  {
450  to_print += "0" + to_string(seconds);
451  }
452  }
453  else
454  {
455  to_print += to_string(seconds);
456  }
457 
458  // Show hundredths of a second if there are no hours
459  if (hours == 0)
460  {
461  to_print += ".";
462  if (int(hundredths / 10) != 0)
463  {
464  to_print += to_string(hundredths);
465  }
466  else
467  {
468  to_print += "0" + to_string(hundredths);
469  }
470  }
471 
472  // Build the ASCII art for the stopwatch display
473  for (int i = 0; i < ASCII_HEIGHT; i++)
474  {
475  string line;
476  for (char ch : to_print)
477  {
478  if (ch == ':')
479  {
480  line += _currFont.at(10)[i]; // Colon character
481  line += PADDING;
482  }
483  else if (ch == '.')
484  {
485  line += _currFont.at(11)[i]; // Period character
486  line += PADDING;
487  }
488  else
489  {
490  line += _currFont.at(ch - '0')[i]; // Numeric character
491  line += PADDING;
492  }
493  }
494  _asciiBuffer += (line + "\n");
495  }
496 }
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
int ASCII_HEIGHT
Definition: Display.hpp:221
vector< vector< string > > _currFont
current font ascii
Definition: Display.hpp:219
string PADDING
Definition: Display.hpp:222

◆ stageStopwatchSplits()

void Display::stageStopwatchSplits ( vector< int >  splits)

Stages the splits block to be displayed.

Definition at line 501 of file Display.cpp.

501  {
502  if (!splits.empty()) {
503  _splitBuffer += " SPLITS:\n\n";
504  int startIdx = (splits.size() > 10) ? splits.size() - 10 : 0;
505  for (int i = startIdx; i < splits.size(); ++i) {
506 
507  int milliseconds = splits.at(i);
508  int hours = milliseconds / 3600000;
509  milliseconds %= 3600000;
510  int minutes = milliseconds / 60000;
511  milliseconds %= 60000;
512  int seconds = milliseconds / 1000;
513  milliseconds %= 1000;
514  int hundredths = milliseconds / 10;
515  string to_print = "";
516 
517  // Only show hours if there are more than 0
518  if (hours != 0) {
519  to_print += to_string(hours) + ":";
520  }
521 
522  // Show minutes with a leading zero if needed
523  if (hours) {
524  if (int(minutes / 10) != 0) {
525  to_print += to_string(minutes) + ":";
526  } else {
527  to_print += "0" + to_string(minutes) + ":";
528  }
529  } else if (minutes) {
530  to_print += to_string(minutes) + ":";
531  }
532 
533  // Show seconds with a leading zero if needed
534  if (hours || minutes) {
535  if (int(seconds / 10) != 0) {
536  to_print += to_string(seconds);
537  } else {
538  to_print += "0" + to_string(seconds);
539  }
540  } else {
541  to_print += to_string(seconds);
542  }
543 
544  // Show hundredths of a second if there are no hours
545  if (hours == 0) {
546  to_print += ".";
547  if (int(hundredths / 10) != 0) {
548  to_print += to_string(hundredths);
549  } else {
550  to_print += "0" + to_string(hundredths);
551  }
552  }
553  string fullprint = "Split " + to_string(i + 1) + ": " + to_print + "\n";
554  _splitBuffer += fullprint;
555  }
556  } else {
557  _splitBuffer = "";
558  }
559 }
string _splitBuffer
Buffer for the splits block.
Definition: Display.hpp:208

◆ stageTimerBar()

void Display::stageTimerBar ( double  percentage)

Stages the progress bar for the timer.

Creates a visual progress bar for the timer based on the percentage completed.

Parameters
percentageThe percentage of the timer's progress to display.
percentageThe percentage of completion.

Definition at line 316 of file Display.cpp.

317 {
318  int width = _asciiWidth - 2;
319  int filled = (int)((percentage / 100) * width);
320 
321  string border = "";
322 
323  // Build the top and bottom borders of the bar
324  border += "+";
325  for (int i = 0; i < width; ++i)
326  {
327  border += "-";
328  }
329  border += "+\n";
330 
331  _barBuffer += border;
332 
333  _barBuffer += "|";
334 
335  // Fill the bar with '#' characters based on the percentage completed
336  for (int i = 0; i < width; ++i)
337  {
338  if (i < filled)
339  {
340  _barBuffer += "#";
341  }
342  else
343  {
344  _barBuffer += " ";
345  }
346  }
347 
348  _barBuffer += "|\n";
349  _barBuffer += border;
350 }
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
string _barBuffer
Buffer for progress bar.
Definition: Display.hpp:206

◆ stageTimerDisplay()

void Display::stageTimerDisplay ( int  hours,
int  minutes,
int  seconds,
int  tenths 
)

Stages the timer display with provided time values.

Converts the timer values into an ASCII representation and stages it for display.

Parameters
hoursHours to display.
minutesMinutes to display.
secondsSeconds to display.
tenthsTenths of a second to display.
hoursThe number of hours.
minutesThe number of minutes.
secondsThe number of seconds.
tenthsThe number of tenths of a second.

Definition at line 186 of file Display.cpp.

187 {
188  string to_print = "";
189 
190  // Only display hours if there is at least 1 hour left
191  if (hours != 0)
192  {
193  to_print += to_string(hours) + ":";
194  }
195 
196  // Add leading zero to minutes if needed
197  if (int(minutes / 10) != 0)
198  {
199  to_print += to_string(minutes) + ":";
200  }
201  else
202  {
203  to_print += "0" + to_string(minutes) + ":";
204  }
205 
206  // Add leading zero to seconds if needed
207  if (int(seconds / 10) != 0)
208  {
209  to_print += to_string(seconds);
210  }
211  else
212  {
213  to_print += "0" + to_string(seconds);
214  }
215 
216  // Build the ASCII art for the timer display
217  for (int i = 0; i < ASCII_HEIGHT; i++)
218  {
219  string line;
220  for (char ch : to_print)
221  {
222  if (ch == ':')
223  {
224  line += _currFont.at(10)[i]; // Colon character
225  line += PADDING;
226  }
227  else if (ch == '.')
228  {
229  line += _currFont.at(11)[i]; // Period character
230  line += PADDING;
231  }
232  else
233  {
234  line += _currFont.at(ch - '0')[i]; // Numeric character
235  line += PADDING;
236  }
237  }
238  _asciiWidth = line.length(); // Update ASCII width
239  _asciiBuffer += (line + "\n");
240  }
241 }
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
int ASCII_HEIGHT
Definition: Display.hpp:221
vector< vector< string > > _currFont
current font ascii
Definition: Display.hpp:219
string PADDING
Definition: Display.hpp:222

◆ tickAlarm()

void Display::tickAlarm ( Alarm alarm)

Updates the display based on the state of the provided Alarm object.

Updates the alarm display on each tick, showing the alarm time and progress bar.

Parameters
alarmReference to the Alarm object.
alarmThe Alarm object to get the alarm time and progress from.

Definition at line 899 of file Display.cpp.

References Alarm::getEndTime(), Alarm::isDone(), Alarm::percentElapsed(), and Alarm::timeToString().

899  {
900 
901  auto now = std::chrono::steady_clock::now();
902  auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
903  bool flash = ((millis / 500) % 2 == 0);
904 
905  string time = alarm.timeToString(alarm.getEndTime()).substr(0,5);
906 
907  stageAlarmDisplay(time);
908  stageAlarmBar(alarm.percentElapsed());
910 
911  string temp;
912  if(alarm.isDone() && flash){
913  temp = BOLD_RED;
914  }
915  else{
916  temp = BOLD_WHITE;
917  }
918  printAscii(1, temp);
919  printBar(ASCII_HEIGHT+2, temp);
920 
923 
924  clearFormat();
925  setCursor(1,1);
926 
927  return;
928 
929 }
string timeToString(chrono::time_point< chrono::system_clock > t)
Converts a given time point to a string format (HH:MM).
Definition: Alarm.cpp:59
chrono::time_point< chrono::system_clock > getEndTime()
Returns the alarm&#39;s end time.
Definition: Alarm.cpp:123
double percentElapsed()
Calculates the percentage of time that has elapsed from start to end.
Definition: Alarm.cpp:78
bool isDone()
Checks if the alarm has finished.
Definition: Alarm.cpp:134
static const string BOLD_WHITE
Definition: Display.hpp:47
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void stageAlarmDisplay()
Stages the display for the alarm.
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
int ASCII_HEIGHT
Definition: Display.hpp:221
static const string BOLD_RED
Definition: Display.hpp:41
static const string WHITE
Definition: Display.hpp:38
vector< string > _alarmControls
Definition: Display.hpp:256
void printBar(int barIndex, string formatting)
Prints the progress bar to the terminal.
Definition: Display.cpp:607
void stageArt(vector< string > art)
Stages the controls for the timer.
Definition: Display.cpp:396
void printSplash(int splashIndex, string formatting)
Prints the splash screen to the terminal.
Definition: Display.cpp:626
static const string BOLD_CYAN
Definition: Display.hpp:46
void stageAlarmBar(double percentage)
Creates a visual progress bar for the alarm based on the percentage completed.
Definition: Display.cpp:356
void printArt(int controlIndex, string formatting)
Prints controls to the terminal.
Definition: Display.cpp:588
void printAscii(int asciiIndex, string formatting)
Prints ASCII art to the terminal.
Definition: Display.cpp:569
Here is the call graph for this function:

◆ tickAlarmSetup()

void Display::tickAlarmSetup ( string  to_print,
bool  isAM 
)

Updates the alarm setup display, showing the current input with a blinking cursor.

Parameters
to_printThe current alarm setup input string.

Definition at line 705 of file Display.cpp.

706 {
707  auto now = std::chrono::steady_clock::now();
708  auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
709 
710  int tempHeight;
711 
712  bool showBar = ((millis / 500) % 2 == 0);
713  if(ASCII_HEIGHT < 4){
714  tempHeight = 4;
715  }
716  else{
717  tempHeight = ASCII_HEIGHT;
718  }
719  for (int i = 0; i < tempHeight; i++)
720  {
721  string line;
722  line += BOLD_WHITE;
723  for (char ch : to_print)
724  {
725  if (ch == ':')
726  {
727  line += _currFont.at(10)[i]; // Colon character
728  line += PADDING;
729  }
730  else
731  {
732  line += _currFont.at(ch - '0')[i]; // Numeric character
733  line += PADDING;
734  }
735  }
736 
737  if(showBar){
738  line += " | ";
739  }
740 
741  else{
742  line += " ";
743  }
744 
745  int linesLeft = tempHeight - i;
746 
747  if(linesLeft <= 4){
748 
749  line += " ";
750  if(isAM){
751  line += SELECTED;
752  }
753  else{
754  line += BOLD_WHITE;
755  }
756 
757  line += _alarmSetupAM[4-linesLeft];
758 
759  line += "\033[0m";
760 
761  line += " ";
762 
763  if(!isAM){
764  line += SELECTED;
765  }
766  else{
767  line += BOLD_WHITE;
768  }
769 
770  line += _alarmSetupPM[4-linesLeft];
771 
772  line += "\033[0m";
773 
774 
775  }
776 
777  _asciiWidth = line.length(); // Update ASCII width
778  _asciiBuffer += (line + "\n");
779 
780  }
781 
783 
784  printArt(1, BOLD_CYAN);
785 
787 
788  /*
789  stageArt(_alarmSetupAM);
790 
791 
792  if(isAM){
793  printArt(ASCII_HEIGHT + 6, SELECTED);
794  stageArt(_alarmSetupPM);
795  printArt(ASCII_HEIGHT + 10, BOLD_WHITE);
796  }
797  else{
798  printArt(ASCII_HEIGHT + 6, BOLD_WHITE);
799  stageArt(_alarmSetupPM);
800  printArt(ASCII_HEIGHT + 10, SELECTED);
801  }
802  */
803 
804  setCursor(1,1);
805 
806 }
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
vector< string > _alarmSetupAM
Definition: Display.hpp:241
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
static const string BOLD_WHITE
Definition: Display.hpp:47
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
vector< string > _alarmSetupControls
Definition: Display.hpp:235
static const string SELECTED
Definition: Display.hpp:27
int ASCII_HEIGHT
Definition: Display.hpp:221
vector< vector< string > > _currFont
current font ascii
Definition: Display.hpp:219
vector< string > _alarmSetupPM
Definition: Display.hpp:249
void stageArt(vector< string > art)
Stages the controls for the timer.
Definition: Display.cpp:396
static const string BOLD_CYAN
Definition: Display.hpp:46
void printArt(int controlIndex, string formatting)
Prints controls to the terminal.
Definition: Display.cpp:588
string PADDING
Definition: Display.hpp:222
void printAscii(int asciiIndex, string formatting)
Prints ASCII art to the terminal.
Definition: Display.cpp:569

◆ tickStopwatch()

void Display::tickStopwatch ( Stopwatch stopwatch)

Updates the display based on the state of the provided Stopwatch object.

Updates the stopwatch display on each tick, converting time into ASCII and updating the terminal.

Parameters
stopwatchReference to the Stopwatch object.
stopwatchThe Stopwatch object to get the current time from.

Definition at line 856 of file Display.cpp.

References Stopwatch::currentMilliseconds(), Stopwatch::getSplits(), and Stopwatch::isRunning().

856  {
857 
858  int milliseconds = stopwatch.currentMilliseconds();
859 
860  int hours = milliseconds / 3600000;
861  milliseconds %= 3600000;
862  int minutes = milliseconds / 60000;
863  milliseconds %= 60000;
864  int seconds = milliseconds / 1000;
865  milliseconds %= 1000;
866  int hundredths = milliseconds / 10;
867 
868  stageStopwatchDisplay(hours, minutes, seconds, hundredths);
870  stageStopwatchSplits(stopwatch.getSplits());
871 
872  string temp;
873  if(!stopwatch.isRunning()){
874  if ((stopwatch.currentMilliseconds() / 10) % 100 == 0 && stopwatch.currentMilliseconds() != 0){
875  temp = BOLD_GREEN;
876  }
877  else{
878  temp = BOLD_RED;
879  }
880  }
881  else{
882  temp = BOLD_WHITE;
883  }
884  printAscii(1, temp);
885 
889 
890  clearFormat();
891  setCursor(1,1);
892 
893 }
static const string BOLD_WHITE
Definition: Display.hpp:47
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
void clearFormat()
Clears the terminal text color.
Definition: Display.cpp:147
int ASCII_HEIGHT
Definition: Display.hpp:221
static const string BOLD_RED
Definition: Display.hpp:41
static const string WHITE
Definition: Display.hpp:38
void printSplits(int splitsIndex, string formatting)
Prints the stopwatch splits to the terminal.
Definition: Display.cpp:645
void stageStopwatchSplits(vector< int > splits)
Stages the splits block to be displayed.
Definition: Display.cpp:501
static const string BOLD_GREEN
Definition: Display.hpp:42
vector< string > _stopwatchControls
Definition: Display.hpp:268
void stageArt(vector< string > art)
Stages the controls for the timer.
Definition: Display.cpp:396
void printSplash(int splashIndex, string formatting)
Prints the splash screen to the terminal.
Definition: Display.cpp:626
static const string BOLD_CYAN
Definition: Display.hpp:46
int currentMilliseconds()
Returns the current elapsed time in milliseconds.
Definition: Stopwatch.cpp:44
vector< int > getSplits()
Returns the splits vector.
Definition: Stopwatch.cpp:90
void printArt(int controlIndex, string formatting)
Prints controls to the terminal.
Definition: Display.cpp:588
void stageStopwatchDisplay(int hours, int minutes, int seconds, int hundredths)
Stages the stopwatch display with provided time values.
Definition: Display.cpp:414
void printAscii(int asciiIndex, string formatting)
Prints ASCII art to the terminal.
Definition: Display.cpp:569
bool isRunning()
Checks if the stopwatch is currently running.
Definition: Stopwatch.cpp:163
Here is the call graph for this function:

◆ tickTimer()

void Display::tickTimer ( Timer timer)

Updates the display based on the state of the provided Timer object.

Updates the timer display on each tick, converting time into ASCII and updating the terminal.

Parameters
timerReference to the Timer object.
timerThe Timer object to get the remaining time from.

Definition at line 812 of file Display.cpp.

References Timer::isDone(), Timer::isRunning(), Timer::percentElapsed(), and Timer::remainingMilliseconds().

813 {
814  auto now = std::chrono::steady_clock::now();
815  auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
816  bool flash = ((millis / 500) % 2 == 0);
817 
818  int remaining = timer.remainingMilliseconds();
819  int hours = remaining / 3600000;
820  remaining %= 3600000;
821  int minutes = remaining / 60000;
822  remaining %= 60000;
823  int seconds = remaining / 1000;
824  remaining %= 1000;
825  int tenths = remaining / 100;
826 
827  stageTimerDisplay(hours, minutes, seconds, tenths);
828  stageTimerBar(timer.percentElapsed());
830 
831  string temp;
832  if(!timer.isRunning()){
833  if(timer.isDone() && flash){
834  temp = BOLD_WHITE;
835  }
836  else{
837  temp = BOLD_RED;
838  }
839  }
840  else{
841  temp = BOLD_WHITE;
842  }
843 
844  printAscii(1, temp);
845  printBar(ASCII_HEIGHT+2, temp);
848 
849  setCursor(1,1);
850 }
bool isDone()
Definition: Timer.cpp:147
double percentElapsed()
Returns the percentage of time that has elapsed since the timer started.
Definition: Timer.cpp:160
int remainingMilliseconds()
Returns the remaining time in milliseconds.
Definition: Timer.cpp:118
static const string BOLD_WHITE
Definition: Display.hpp:47
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
vector< string > _timerControls
Definition: Display.hpp:262
int ASCII_HEIGHT
Definition: Display.hpp:221
static const string BOLD_RED
Definition: Display.hpp:41
static const string WHITE
Definition: Display.hpp:38
void printBar(int barIndex, string formatting)
Prints the progress bar to the terminal.
Definition: Display.cpp:607
void stageTimerDisplay(int hours, int minutes, int seconds, int tenths)
Stages the timer display with provided time values.
Definition: Display.cpp:186
void stageArt(vector< string > art)
Stages the controls for the timer.
Definition: Display.cpp:396
void printSplash(int splashIndex, string formatting)
Prints the splash screen to the terminal.
Definition: Display.cpp:626
static const string BOLD_CYAN
Definition: Display.hpp:46
bool isRunning()
Checks if the timer is currently running.
Definition: Timer.cpp:143
void printArt(int controlIndex, string formatting)
Prints controls to the terminal.
Definition: Display.cpp:588
void printAscii(int asciiIndex, string formatting)
Prints ASCII art to the terminal.
Definition: Display.cpp:569
void stageTimerBar(double percentage)
Stages the progress bar for the timer.
Definition: Display.cpp:316
Here is the call graph for this function:

◆ tickTimerSetup()

void Display::tickTimerSetup ( string  to_print)

Updates the timer setup display, showing the current input with a blinking cursor.

Parameters
to_printThe current timer setup input string.

Definition at line 663 of file Display.cpp.

664 {
665  auto now = std::chrono::steady_clock::now();
666  auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
667 
668  bool showBar = ((millis / 500) % 2 == 0);
669 
670  _asciiBuffer.clear(); // Clear buffer before filling it with new content
671 
672  for (int i = 0; i < ASCII_HEIGHT; ++i)
673  {
674  string line;
675  for (char ch : to_print)
676  {
677  if (ch == ':')
678  {
679  line += _currFont.at(10)[i]; // Colon character
680  }
681  else
682  {
683  line += _currFont.at(ch - '0')[i]; // Numeric character
684  }
685  line += PADDING;
686  }
687  line += showBar ? " |" : " "; // Append progress bar indicator
688  _asciiWidth = line.length();
689  _asciiBuffer += (line + "\n");
690  }
692 
693  printArt(1, BOLD_CYAN);
695 
696 
697  setCursor(1,1);
698 
699 }
int _asciiWidth
Width of the ASCII art.
Definition: Display.hpp:227
string _asciiBuffer
Buffer for ASCII art.
Definition: Display.hpp:205
vector< string > _timerSetupControls
Definition: Display.hpp:229
static const string BOLD_WHITE
Definition: Display.hpp:47
void setCursor(int x, int y)
Sets the cursor position in the terminal.
Definition: Display.cpp:101
int ASCII_HEIGHT
Definition: Display.hpp:221
vector< vector< string > > _currFont
current font ascii
Definition: Display.hpp:219
void stageArt(vector< string > art)
Stages the controls for the timer.
Definition: Display.cpp:396
static const string BOLD_CYAN
Definition: Display.hpp:46
void printArt(int controlIndex, string formatting)
Prints controls to the terminal.
Definition: Display.cpp:588
string PADDING
Definition: Display.hpp:222
void printAscii(int asciiIndex, string formatting)
Prints ASCII art to the terminal.
Definition: Display.cpp:569

Field Documentation

◆ _alarmControls

vector<string> Display::_alarmControls
private
Initial value:
= {
"",
"A: New Alarm | Q: Main Menu",
"",
}

Definition at line 256 of file Display.hpp.

◆ _alarmSetupAM

vector<string> Display::_alarmSetupAM
private
Initial value:
= {
" ",
" /\\ |\\/| ",
" /--\\ | | ",
" ",
}

Definition at line 241 of file Display.hpp.

◆ _alarmSetupControls

vector<string> Display::_alarmSetupControls
private
Initial value:
= {
" _ ___ _ _ _ ___ ___ _ ",
"|_ |\\ | | |_ |_) /\\ | /\\ |_) |\\/| | | |\\/| |_ o ",
"|_ | \\| | |_ | \\ /--\\ |_ /--\\ | \\ | | | _|_ | | |_ o ",
}

Definition at line 235 of file Display.hpp.

◆ _alarmSetupPM

vector<string> Display::_alarmSetupPM
private
Initial value:
= {
" _ ",
" |_) |\\/| ",
" | | | ",
" ",
}

Definition at line 249 of file Display.hpp.

◆ _asciiBuffer

string Display::_asciiBuffer
private

Buffer for ASCII art.

Definition at line 205 of file Display.hpp.

◆ _asciiWidth

int Display::_asciiWidth
private

Width of the ASCII art.

Definition at line 227 of file Display.hpp.

◆ _barBuffer

string Display::_barBuffer
private

Buffer for progress bar.

Definition at line 206 of file Display.hpp.

◆ _controlBuffer

string Display::_controlBuffer
private

Buffer for controls.

Definition at line 207 of file Display.hpp.

◆ _currFont

vector<vector<string> > Display::_currFont
private

current font ascii

Definition at line 219 of file Display.hpp.

◆ _fontHeights

vector<int> Display::_fontHeights
private

List of font heights.

Definition at line 218 of file Display.hpp.

◆ _fonts

vector<vector<vector<string> > > Display::_fonts
private

List of font ascii.

Definition at line 217 of file Display.hpp.

◆ _formatting

string Display::_formatting
private

Definition at line 224 of file Display.hpp.

◆ _oldAscii

string Display::_oldAscii
private

Previous ASCII art for comparison.

Definition at line 211 of file Display.hpp.

◆ _oldBar

string Display::_oldBar
private

Previous progress bar for comparison.

Definition at line 213 of file Display.hpp.

◆ _oldControls

string Display::_oldControls
private

Previous controls for comparison.

Definition at line 212 of file Display.hpp.

◆ _oldFormatting

string Display::_oldFormatting
private

Definition at line 225 of file Display.hpp.

◆ _oldSplash

string Display::_oldSplash
private

Previous splash screen for comparison.

Definition at line 214 of file Display.hpp.

◆ _oldSplits

string Display::_oldSplits
private

Previous splits for comparison.

Definition at line 215 of file Display.hpp.

◆ _splash

string Display::_splash
private

String for splash screen.

Definition at line 209 of file Display.hpp.

◆ _splitBuffer

string Display::_splitBuffer
private

Buffer for the splits block.

Definition at line 208 of file Display.hpp.

◆ _stopwatchControls

vector<string> Display::_stopwatchControls
private
Initial value:
= {
"",
"S: Start/Stop | R: Reset | A: Add Split | Q: Main Menu",
"",
}

Definition at line 268 of file Display.hpp.

◆ _timerControls

vector<string> Display::_timerControls
private
Initial value:
= {
"",
"S: Start/Stop | R: Reset | A: New Timer | Q: Main Menu",
"",
}

Definition at line 262 of file Display.hpp.

◆ _timerSetupControls

vector<string> Display::_timerSetupControls
private
Initial value:
= {
" _ ___ _ _ ___ ___ _ _ _ __ ___ ",
" |_ |\\ | | |_ |_) | | |\\/| |_ |_) | |_ |\\ | /__ | |_| o ",
" |_ | \\| | |_ | \\ | _|_ | | |_ | \\ |_ |_ | \\| \\_| | | | o ",
}

Definition at line 229 of file Display.hpp.

◆ ASCII_HEIGHT

int Display::ASCII_HEIGHT
private

Definition at line 221 of file Display.hpp.

◆ BLACK

const string Display::BLACK = "\033[30m"
static

Definition at line 31 of file Display.hpp.

◆ BLUE

const string Display::BLUE = "\033[34m"
static

Definition at line 35 of file Display.hpp.

◆ BOLD

const string Display::BOLD = "\033[1m"
static

Definition at line 29 of file Display.hpp.

◆ BOLD_BLACK

const string Display::BOLD_BLACK = "\033[1;30m"
static

Definition at line 40 of file Display.hpp.

◆ BOLD_BLUE

const string Display::BOLD_BLUE = "\033[1;34m"
static

Definition at line 44 of file Display.hpp.

◆ BOLD_CYAN

const string Display::BOLD_CYAN = "\033[1;36m"
static

Definition at line 46 of file Display.hpp.

Referenced by Menu::credits(), Menu::mainMenu(), and Menu::settingsMenu().

◆ BOLD_GREEN

const string Display::BOLD_GREEN = "\033[1;32m"
static

Definition at line 42 of file Display.hpp.

◆ BOLD_MAGENTA

const string Display::BOLD_MAGENTA = "\033[1;35m"
static

Definition at line 45 of file Display.hpp.

◆ BOLD_RED

const string Display::BOLD_RED = "\033[1;31m"
static

Definition at line 41 of file Display.hpp.

◆ BOLD_WHITE

const string Display::BOLD_WHITE = "\033[1;37m"
static

Definition at line 47 of file Display.hpp.

Referenced by Menu::mainMenu(), Menu::Menu(), and Menu::settingsMenu().

◆ BOLD_YELLOW

const string Display::BOLD_YELLOW = "\033[1;33m"
static

Definition at line 43 of file Display.hpp.

◆ CYAN

const string Display::CYAN = "\033[36m"
static

Definition at line 37 of file Display.hpp.

◆ GREEN

const string Display::GREEN = "\033[32m"
static

Definition at line 33 of file Display.hpp.

◆ MAGENTA

const string Display::MAGENTA = "\033[35m"
static

Definition at line 36 of file Display.hpp.

◆ PADDING

string Display::PADDING
private

Definition at line 222 of file Display.hpp.

◆ RED

const string Display::RED = "\033[31m"
static

Definition at line 32 of file Display.hpp.

◆ SELECTED

const string Display::SELECTED = "\033[1;30;46m"
static

Definition at line 27 of file Display.hpp.

Referenced by Menu::mainMenu(), and Menu::settingsMenu().

◆ WHITE

const string Display::WHITE = "\033[37m"
static

Definition at line 38 of file Display.hpp.

Referenced by Menu::credits().

◆ YELLOW

const string Display::YELLOW = "\033[33m"
static

Definition at line 34 of file Display.hpp.


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