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
use thiserror::Error;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum InitializationError {
#[error("Pure Data is already initialized.")]
AlreadyInitialized,
#[error("Failed to initialize ring buffers which are needed for the message queue.")]
RingBufferInitializationError,
#[error("An unknown error occurred in Pure Data initialization.")]
InitializationFailed,
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum AudioInitializationError {
#[error("An unknown error occurred in Pure Data audio initialization.")]
InitializationFailed,
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum PatchLifeCycleError {
#[error("Failed to open patch.")]
FailedToOpenPatch,
#[error("Failed to close patch, because the handle which was provided is null.")]
FailedToClosePatch,
#[error("The string which is passed could not be evaluated as a patch.")]
FailedToEvaluateAsPatch { content: String, msg: String },
#[error("The patch which is trying to be communicated with is not open.")]
PatchIsNotOpen,
#[error("The path you have provided does not exist in the file system. Path: {0}")]
PathDoesNotExist(String),
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum GuiLifeCycleError {
#[error("Failed to open gui, please provide a valid path to the pd binary.")]
FailedToOpenGui,
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum IoError {
#[error("The path you have provided does not exist in the file system. Path: {0}")]
PathDoesNotExist(String),
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum SendError {
#[error("No destination found for receiver: `{0}` in loaded pd patch.")]
MissingDestination(String),
#[error("Values which are being sent are out of range.")]
OutOfRange,
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum SubscriptionError {
#[error("Failed to subscribe to sender: `{0}` in loaded pd patch.")]
FailedToSubscribeToSender(String),
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum SizeError {
#[error("The maximum size specified is too large.")]
TooLarge,
#[error("Could not determine the size.")]
CouldNotDetermine,
}
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum ArrayError {
#[error("The array which you're trying to access doesn't exist.")]
FailedToFindArray,
#[error("The position in array which you're trying to write is out of bounds.")]
OutOfBounds,
}