-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefine.h
112 lines (94 loc) · 7.02 KB
/
define.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef DEFINE_LIBRARY
#define DEFINE_LIBRARY
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <string.h>
#include <dirent.h>
#include <iterator>
#include <map>
#include <stdlib.h>
#include <conio.h>
#include <time.h>// to check clockticks. (Here) Used to delay program the wait for user input and for srand(), Functions -> clock() and time()
#include <string.h>
#include <windows.h>
using namespace std;
#define UP 72 // Up arrow key. When arrow keys are pressed 2 values are returned and 2nd value is used to identify which key is pressed.
#define DOWN 80 // Down arrow key
#define LEFT 75// Left arrow key
#define RIGHT 77// Right arrow key
#define ESC 27
#define SPACE 32// Space key
#define leftBorder 10
#define rightBorder 100
#define topBorder 10
#define bottomBorder 50
#define xZero 0
#define yZero 1
//#define xMargin cout<<" "; //20
#define xMargin cout<<" "; //50
#define gotoxy(x,y) printf("\033[%d;%dH",(y),(x)); // terminal ANSI excape sequence to take cursor to x(%dH),y(%d) coordinate
#define gotoy(y) printf("\033[%d;%dH",(y),(xZero));
#define cLine cout<<"\x1b[2K";
#define clearLine(x,y) gotoxy(x,y) cLine ;
#define clearLineY(y) gotoxy(xZero,y) cLine ;
#define clear system("cls");// clearing terminal screen
#define pixelWidth 54
#define pixelHeight 18
#define blackTextForegroundColor cout<<"\x1b[30m";
#define redTextForegroundColor cout<<"\x1b[31m";
#define greenTextForegroundColor cout<<"\x1b[32m";
#define yellowTextForegroundColor cout<<"\x1b[33m";
#define blueTextForegroundColor cout<<"\x1b[34m";
#define magentaTextForegroundColor cout<<"\x1b[35m";
#define cyanTextForegroundColor cout<<"\x1b[36m";
#define whiteTextForegroundColor cout<<"\x1b[37m";
#define defaultTextForegroundColor cout<<"\x1b[39m";
#define blackTextBackgroundColor cout<<"\x1b[40m";
#define redTextBackgroundColor cout<<"\x1b[41m";
#define greenTextBackgroundColor cout<<"\x1b[42m";
#define yellowTextBackgroundColor cout<<"\x1b[43m";
#define blueTextBackgroundColor cout<<"\x1b[44m";
#define magentaTextBackgroundColor cout<<"\x1b[45m";
#define cyanTextBackgroundColor cout<<"\x1b[46m";
#define whiteTextBackgroundColor cout<<"\x1b[47m";
#define defaultTextBackgroundColor cout<<"\x1b[49m";
#define yellowColor blackTextForegroundColor yellowTextBackgroundColor
#define defaultColor defaultTextBackgroundColor defaultTextForegroundColor
#define showCursor fputs("\e[?25h",stdout);
#define hideCursor fputs("\e[?25l",stdout);
#define horizontalFill xMargin cout<<"****************************************************\n";
#define horizontalBlank xMargin cout<<"* *\n";
#define instruction1 xMargin cout<<"* - Use Arrow Keys To Move *\n";
#define instruction2 xMargin cout<<"* - Space to Select *\n";
#define instructions instruction1 instruction2;
#define instructionBox horizontalFill instructions horizontalFill;
#define PlayingBackSelected clearLineY(yZero+1) xMargin cout<<"* ";yellowColor cout<<"<";defaultColor cout<<" "; greenTextForegroundColor cout<<"C L I M P";defaultTextForegroundColor cout<<" ";redTextBackgroundColor cout<<"X";defaultTextBackgroundColor cout<<" *\n";
#define PlayingExitSelected clearLineY(yZero+1) xMargin cout<<"* < "; greenTextForegroundColor cout<<"C L I M P";defaultTextForegroundColor cout<<" ";yellowColor cout<<"X";defaultColor cout<<" *\n";
#define PlayingBackAndExitUnselected clearLineY(yZero+1) xMargin cout<<"* < "; greenTextForegroundColor cout<<"C L I M P";defaultTextForegroundColor cout<<" ";redTextBackgroundColor cout<<"X";defaultTextBackgroundColor cout<<" *\n";
#define nowPlaying clearLineY(yZero+3) xMargin cout<<"* Now Playing: *\n";
#define pauseUnselected clearLineY(yZero+9) xMargin cout<<"* ";cyanTextForegroundColor cout<<"||";defaultTextForegroundColor cout<<" *\n";
#define pauseSelected clearLineY(yZero+9) xMargin cout<<"* ";yellowColor cout<<"||";defaultColor cout<<" *\n";
#define playSelected clearLineY(yZero+9) xMargin cout<<"* ";yellowColor cout<<" >";defaultColor cout<<" *\n";
#define playUnselected clearLineY(yZero+9) xMargin cout<<"* ";cyanTextForegroundColor cout<<" >";defaultTextForegroundColor cout<<" *\n";
#define shuffleSelected clearLineY(yZero+6) xMargin cout<<"* ",yellowColor cout<<"Shuffle";defaultColor cout<<" *\n";
#define shuffleUnselected clearLineY(yZero+6) xMargin cout<<"* Shuffle *\n";
#define showListSelected clearLineY(yZero+10) xMargin cout<<"* ",yellowColor cout<<"Show List";defaultColor cout<<" *\n";
#define showListUnselected clearLineY(yZero+10) xMargin cout<<"* Show List *\n";
#define welcomeExitSelected clearLineY(yZero+1) xMargin cout<<"* "; greenTextForegroundColor cout<<"C L I M P";defaultTextForegroundColor cout<<" ";yellowColor cout<<"X";defaultColor cout<<" *\n";
#define welcomeExitUnselected clearLineY(yZero+1) xMargin cout<<"* "; greenTextForegroundColor cout<<"C L I M P";defaultTextForegroundColor cout<<" ";redTextBackgroundColor cout<<"X";defaultTextBackgroundColor cout<<" *\n";
#define prevAndNextUnselected clearLineY(yZero+13) xMargin cout<<"* <Previous Next> *\n";
#define prevSelected clearLineY(yZero+13) xMargin cout<<"* ";yellowColor cout<<"<Previous";defaultColor cout<<" Next> *\n";
#define nextSelected clearLineY(yZero+13) xMargin cout<<"* <Previous ";yellowColor cout<<"Next>";defaultColor cout<<" *\n";
#define replayUnselected clearLineY(yZero+11) xMargin cout<<"* Replay *\n";
#define replaySelected clearLineY(yZero+11) xMargin cout<<"* ";yellowColor cout<<"Replay";defaultColor cout<<" *\n";
#define track1 clearLineY(yZero+6) xMargin cout<<"* Track: ";
#define track2 cout<<" *\n";
#define duration1 clearLineY(yZero+7) xMargin cout<<"* Duration: ";
#define duration2 cout<<" *\n";
#define selectSongUnselected clearLineY(yZero+3) xMargin cout<<"* Select Song *\n";
#define selectSongSelected clearLineY(yZero+3) xMargin cout<<"* ";yellowColor cout<<"Select Song";defaultColor cout<<" *\n";
#define heading clearLineY(yZero+4) xMargin cout<<"* Track Title Artist Duration *\n";
////////////////////////////////////////////////////////////////////////////////////////////
#endif