-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMuError.cpp
executable file
·109 lines (86 loc) · 2.3 KB
/
MuError.cpp
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
//*********************************************
//***************** NCM-UnB *******************
//******** (c) Carlos Eduardo Mello ***********
//*********************************************
// This softwre may be freely reproduced,
// copied, modified, and reused, as long as
// it retains, in all forms, the above credits.
//*********************************************
/** @file MuError.cpp
* @brief Error Class Interface
* @details
* MuM's Error information facility
* @author Carlos Eduardo Mello
* @date 3/5/2009
**/
#include "MuError.h"
MuError::MuError(void)
{
e = MuERROR_NONE;
}
MuError::MuError(short newError)
{
e = newError;
}
short MuError::Get(void)
{
return e;
}
void MuError::Set(short newError)
{
e = newError;
}
void MuError::Set(MuError inError)
{
e = inError.Get();
}
string MuError::Message(void)
{
string message = "";
switch(e)
{
case MuERROR_INSUF_MEM:
message = "Insuficient memory to complete task!";
break;
case MuERROR_INVALID_PARAMETER:
message = "Parameter number is out of range!";
break;
case MuERROR_PARAM_BLOCK_NOT_INITIALIZED:
message = "Parameter Block is not initialized!";
break;
case MuERROR_CANNOT_INIT:
message = "Parameter Block contains data!";
break;
case MuERROR_INVALID_PARAMBLOCK_SIZE:
message = "Invalid size for Parameter Block!";
break;
case MuERROR_NOTE_LIST_IS_EMPTY:
message = "Note list is empty!";
break;
case MuERROR_NOTE_NOT_FOUND:
message = "Couldn't find requested note!";
break;
case MuERROR_COULDNT_INIT_MATERIAL:
message = "Couldn't allocate array of voices!";
break;
case MuERROR_MATERIAL_IS_EMPTY:
message = "Material contains no data!";
break;
case MuERROR_INVALID_VOICE_NUMBER:
message = "Requested voice doesnt exist!";
break;
case MuERROR_COULDNT_OPEN_INPUT_FILE:
message = "Couldn't open input file!";
break;
case MuERROR_COULDNT_OPEN_OUTPUT_FILE:
message = "Couldn't open output file!";
break;
case MuERROR_INVALID_SCALE_DEGREE:
message = "Invalid scale degree!";
break;
case MuERROR_INVALID_NOTE_RANGE:
message = "Invalid note range!";
break;
}
return message;
}