-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions21.h
More file actions
134 lines (120 loc) · 4.35 KB
/
exceptions21.h
File metadata and controls
134 lines (120 loc) · 4.35 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//music21 CPP Copyright 2022 George Charles Rosar II
//exceptions21.h
#pragma once
#include <Arduino.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <Audio.h>
#include <string.h>
#include <Bounce.h>
#include "utility/imxrt_hw.h"
#include <core_pins.h>
#include "utility/dspinst.h"
#include <teensy_sample_data.h>
#include <teensy_synth_wavetable.h>
#include <Easing.h>
#include <Music21CPPScreenConfig.h>
//determine which ones needed
#ifdef Music21_Adafruit_I2C
#include <Adafruit_I2CDevice.h>
#elif Music21_Adafruit_SPI
#include <Adafruit_SPIDevice.h>
#endif
#include <Adafruit_GFX.h>
#ifdef Music21ScreenType
#if Music21ScreenType == 0 //Adafruit_SSD1306
#elif Music21ScreenType == 1 //Adafruit_GP9002
#elif Music21ScreenType == 2 //Adafruit_HX8340B
#elif Music21ScreenType == 3 //Adafruit_PCD8544
#elif Music21ScreenType == 4 //Adafruit_SSD1331
#elif Music21ScreenType == 5 //Adafruit_SSD1351
#include <Adafruit_SSD1351.h>
#elif Music21ScreenType == 6 //Adafruit_ST77xx
#elif Music21ScreenType == 7 //Adafruit_ILI9341
#else
//error message
#endif
#else
//error message
#endif
#include <iostream>
#include <vector>
class Exception {
public:
Exception(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
void throwException(String theMessageIn);
void terminateException();
bool objectThrowsException = false;
#ifdef Music21ScreenType
#if Music21ScreenType == 0 //Adafruit_SSD1306
#elif Music21ScreenType == 1 //Adafruit_GP9002
#elif Music21ScreenType == 2 //Adafruit_HX8340B
#elif Music21ScreenType == 3 //Adafruit_PCD8544
#elif Music21ScreenType == 4 //Adafruit_SSD1331
#elif Music21ScreenType == 5 //Adafruit_SSD1351
Adafruit_SSD1351* theScreen;
#elif Music21ScreenType == 6 //Adafruit_ST77xx
#elif Music21ScreenType == 7 //Adafruit_ILI9341
#else
//error message
#endif
#else
//error message
#endif
String theExceptionMessage;
uint8_t theExceptionID; //the ID in the exceptions vector
}
class Music21Exception : public Exception {
public:
Music21Exception(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class StreamException : public Music21Exception {
public:
StreamException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class ImmutableStreamException : public StreamException {
public:
ImmutableStreamException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class MetadataException : public Music21Exception {
public:
MetadataException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class AnalysisException : public Music21Exception {
public:
AnalysisException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class TreeException : public Music21Exception {
public:
TreeException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class InstrumentException : public Music21Exception {
public:
InstrumentException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class Music21CommonException : public Music21Exception {
public:
Music21CommonException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class CorpusException : public Music21Exception {
public:
CorpusException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class GroupException : public Music21Exception {
public:
GroupException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class MeterException : public Music21Exception {
public:
MeterException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class TimeSignatureException: public MeterException {
public:
TimeSignatureException(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};
class Music21DeprecationWarning : public UserWarning {
public:
Music21DeprecationWarning(String theMessageIn, Adafruit_SPITFT *theOLEDIN, std::vector<Exception> theExceptionsListIN);
};