Comment remaining unsolved bug.
[ardour.git] / libs / backends / wavesaudio / wavesapi / MiscUtils / WUErrors.h
1 /*
2     Copyright (C) 2014 Waves Audio Ltd.
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __WUErrors_h__
21     #define __WUErrors_h__
22
23 /* Copy to include:
24 #include "WUErrors.h"
25 */
26
27 #include "BasicTypes/WUTypes.h"
28
29 // General errors
30 //const WTErr eNoErr =  0; // moved to #include "WavesPublicAPI/WTErr.h"
31 const WTErr eGenericErr                                         = -1;
32 const WTErr eUserCanceled                       = -2;
33 const WTErr eUnknownErr                                         = -3;
34 const WTErr eExceptionErr                                       = -4;
35 const WTErr eEndianError                                        = -5;
36 const WTErr eThreadSafeError                            = -6;
37 const WTErr eSomeThingNotInitailzed                     = -7;
38 const WTErr eWrongObjectState                           = -8; //!< object was not in an acceptable state
39 const WTErr eUninitalized                                       = -9;
40 const WTErr eDeprecated                                         = -10;
41 const WTErr eCommandLineParameter                       = -11;
42 const WTErr eNotANumber                                         = -12; //!< expected a number but none was found
43 const WTErr eNotJustANumber                                     = -13; //!< expected a number and found one but also other stuff (e.g. "123XYZ")
44 const WTErr eNegativeNumber                                     = -14; //!< expected a positive number and found a negative
45 const WTErr eTimeOut                        = -15; //!< something timed out
46 const WTErr eCoreAudioFailed                            = -16; //!< Error in a core audio call
47 const WTErr eSomeThingInitailzedTwice           = -17;
48 const WTErr eGenerateHelpInfo                           = -18;
49 const WTErr eOutOfRangeNumber                           = -19;
50 const WTErr eMacOnlyCode                                = -20;
51 const WTErr eWinOnlyCode                                    = -21;
52 const WTErr eAppLaunchFailed                        = -22; //!< failed to launch an application
53 const WTErr eAppTerminateFailed                     = -23; //!< failed to terminate an application
54 const WTErr eAppReturnedError               = -24; //!< Non zero exit code from application
55 const WTErr eNotImplemented                 = -25; //!< Function is not implmemented
56 const WTErr eNotEmpty                           = -26; //!< Something was expected to be empty but is not
57 const WTErr eAsioFailed                                         = -27;
58
59 // File Manager errors
60 const WTErr eFMNoSuchVolume                                     = -1001;
61 const WTErr eFMFileNotFound                                     = -1002;
62 const WTErr eFMFileAllreadyExists                       = -1003;
63 const WTErr eFMAllreadyOpenWithWritePerm        = -1004;
64 const WTErr eFMEndOfFile                                        = -1005;
65 const WTErr eFMPermissionErr                            = -1006;
66 const WTErr eFMBusyErr                                          = -1007;
67 const WTErr eFMOpenFailed                                       = -1008;
68 const WTErr eFMTranslateFileNameFailed          = -1009;
69 const WTErr eFMWTPathRefCreationFailed          = -1010;
70 const WTErr eFMReadFailed                                       = -1011;
71 const WTErr eFMIllegalPathRef                           = -1012;
72 const WTErr eFMFileNotOpened                            = -1013;
73 const WTErr eFMFileSizeTooBig                           = -1014;
74 const WTErr eFMNoSuchDomain                                     = -1015;
75 const WTErr eFMNoSuchSystemFolder                       = -1016;
76 const WTErr eFMWrongParameters                          = -1017;
77 const WTErr eFMIsNotAFolder                                     = -1018;
78 const WTErr eFMIsAFolder                                        = -1019;
79 const WTErr eFMIsNotAFile                                       = -1020;
80 const WTErr eFMIsAFile                                          = -1021;
81 const WTErr eFMDeleteFailed                                     = -1022;
82 const WTErr eFMCreateFailed                                     = -1023;
83 const WTErr eFMPathTooLong                                      = -1024;
84 const WTErr eFMIOError                                          = -1025;
85 const WTErr eFMIllegalOpenFileRef                       = -1026;
86 const WTErr eFMDiskFull                                         = -1027;
87 const WTErr eFMFileNotEmpty                                     = -1028;
88 const WTErr eFMEndOfFolder                                      = -1029;
89 const WTErr eFMSamePath                                         = -1030;
90 const WTErr eFMPathTooShort                                     = -1031;
91 const WTErr eFMIncompletePath                           = -1032;
92 const WTErr eFMIsNoAFileSystemLink                      = -1033;
93 const WTErr eFMSymlinkBroken                            = -1034;
94 const WTErr eFMMoveFailed                                       = -1035;
95 const WTErr eFMWriteFailed                  = -1036;
96 const WTErr eFMTooManyOpenFiles                         = -1037;
97 const WTErr eFMTooManySymlinks                          = -1038;
98
99 // System errors
100 const WTErr     eGenericSystemError                             = -2000;
101 const WTErr eSysNoEnvironmentVariable       = -2001;
102 const WTErr eDLLLoadingFailed                           = -2002;
103 const WTErr eFuncPoinerNotFound                         = -2003;
104 const WTErr eDLLNotFound                                        = -2004;
105 const WTErr eBundleNotLoaded                            = -2005;
106 const WTErr eBundleCreateFailed                         = -2006;
107 const WTErr eBundleExecutableNotFound           = -2007;
108 const WTErr     eNotABundle                                             = -2008;
109 const WTErr     eInvalideDate                                   = -2009;
110 const WTErr eNoNetDevice                    = -2010;
111 const WTErr eCacheCreatedFromResource       = -2011;
112 const WTErr eNotAValidApplication           = -2012;
113
114 // Resource Manager errors
115 const WTErr eRMResNotFound              = -3000;
116 const WTErr eRMResExists                = -3001; //!< a resource exist even though it's not expected to
117 const WTErr eRMContainerNotFound        = -3002; //!< The container was not found in the list of containers
118 const WTErr eRMResRefNotFound           = -3003; //!< The resRef was not found in container's resource list
119 const WTErr eRMInvalidResRef                    = -3004;
120 const WTErr eRMInvalidResContainer  = -3005;
121 const WTErr eRMInvalidNativeResContainer  = -3006;
122 const WTErr eRMAttachResContainerFailed   = -3007;
123 const WTErr eRMInvalidResID                     = -3008;
124 const WTErr eRMResUpdateFailed          = -3009;
125
126 // Graphic Manager & GUI errors
127 const WTErr eGMIsNotInitailzed          = -3500;
128 const WTErr eGMInvalidImage                     = -3501;
129 const WTErr eGMGenericErr                       = -3502;
130 const WTErr eGMNoCurrentContext         = -3503;
131 const WTErr eGUISkinNotFound            = -3504;
132 const WTErr eGMNoVertices           = -3505;
133 const WTErr eGMNoColors             = -3506;
134 const WTErr eGMNoTexture            = -3507;
135 const WTErr eGMIncompatibleOGLVersion   = -3508;
136 const WTErr eGMNoDeviceContext          = -3509;
137 const WTErr eGMNoPixelFormat            = -3510;
138 const WTErr eGMNoOGLContext             = -3511;
139 const WTErr eGMNoOGLContextSharing      = -3512;
140 const WTErr eGMUnsupportedImageFormat   = -3513;
141 const WTErr eGMUninitializedContext     = -3514;
142 const WTErr eControlOutOfRange                  = -3515;
143 const WTErr eGMUninitializedFont        = -3516;
144 const WTErr eGMInvalidFontDrawMethod    = -3517;
145 const WTErr eGMUnreleasedTextures       = -3518;
146 const WTErr eGMWrongThread                      = -3519;
147 const WTErr eGMDontCommitDraw                   = -3520;
148 // Errors in the -5000 -> -5999 are defined in Waves-incs.h
149
150 // Memory errors
151 const WTErr eMemNewFailed           = -4001; //!< Something = new CSomething, returned null
152 const WTErr eMemNewTPtrFailed       = -4002; //!< NewTPtr or NewTPtrClear failed
153 const WTErr eMemNullPointer         = -4003; //!< a null pointer was encountered where it should not
154 const WTErr eMemObjNotInitialized   = -4004;
155 const WTErr eMemBuffTooShort        = -4005; //!< the buffer in question did not have enough space for the operation
156 const WTErr eInstanciationFailed    = -4006;
157 const WTErr eMemAddressSpaceError   = -4007; //!< memory falls outside the legal address space
158 const WTErr eMemBadPointer          = -4008;
159 const WTErr eMemOutOfMemory         = -4009;
160
161 // XML Errors
162 const WTErr eXMLParserFailed        = -6001;
163 const WTErr eXMLTreeNotValid        = -6002;
164 const WTErr eXMLTreeEmpty           = -6003;
165 const WTErr eXMLElementMissing      = -6004;
166 const WTErr eXMLElementUninitalized  = -6005; //!< element was default constructed it has not element name, etc..
167 const WTErr eXMLElementIncomplete  = -6006;             //!< XML parser did not complete building the element
168 const WTErr eXMLAttribMissing      = -6007;
169
170 // Preset errors
171 const WTErr ePresetFileProblem                  = -7860;
172 const WTErr eInvalidFileFormatProblem           = -7861;
173 const WTErr ePresetLockedProblem                = -7862;
174 const WTErr ePresetInfoNotFound                 = -7863;
175 const WTErr eDuplicatePluginSpecificTag     = -7959;
176 const WTErr ePluginSpecifcNotExisting       = -7960;
177 const WTErr eBuffSizeToSmall                = -7961;
178 const WTErr eCreatingPopupWhereAnItemExists = -7962;
179 const WTErr eDeletePluginSpecifcFailed      = -7963;
180 const WTErr eFactoryPresetNumOutOfRange     = -7964;
181 const WTErr eNoFactoryPresets               = -7965;
182 const WTErr eLoadPresetToPlugin_vec_empty   = -7966;
183 const WTErr eFactoryPresetNotFound          = -7967;
184 const WTErr eCantCreateUserPrefFile         = -7968;
185 const WTErr eDataFormatNotSupported         = -7969;
186 const WTErr eCantLoadProcessFunction        = -7970;
187 const WTErr eIllegalChunkIndex                          = -7971;
188 const WTErr eIllegalChunkID                                     = -7972;
189 const WTErr     eIllegalChunkVersion            = -7973;
190
191
192 // Shell errors
193 const WTErr eNotAPluginFile                 = -8001;
194 const WTErr eFaildToLoadPluginDLL                       = -8002;
195 const WTErr eNoPluginManager                = -8003;
196 const WTErr eGetAvailablePluginsFailed      = -8004;
197 const WTErr eNoPluginsAvailable             = -8005;
198 const WTErr ePluginSubComponentNotFound     = -8006;
199 const WTErr ePluginOpenFailed               = -8007;
200 const WTErr eSubComponentRejected               = -8009; //!< user did not want this sub-component - probably through preferences
201 const WTErr eIncompatibleNumOfIOs           = -8010; //!< e.g. surround sub-component in stereo only shell
202 const WTErr eStemProblem                                        = -8011; //!< Some problem with stems
203 const WTErr     eComponentTypeNotSupported              = -8012;
204 const WTErr     ePluginNotLoaded                                = -8013;
205 const WTErr     ePluginInstanceNotCreate                = -8014;
206 const WTErr     ePluginAlgNotCreate                             = -8015;
207 const WTErr     ePluginGUINotCreate                             = -8016;
208 const WTErr     eMissmatchChannelCount                  = -8017;
209 const WTErr eIncompatibleVersion            = -8018;
210 const WTErr eIncompatibleAffiliation        = -8019;
211 const WTErr eNoSubComponentsFound           = -8020;
212
213 // Net-shell errors
214 const WTErr eNetShellInitFailed             = -9001;
215
216 // Protection errors
217 const WTErr eWLSLicenseFileNotFound  = -10001;
218 const WTErr eWLSPluginNotAuthorized  = -10002;
219 const WTErr eWLSNoLicenseForPlugin   = -10003;
220 const WTErr eWLSInvalidLicenseFileName   = -10004;
221 const WTErr eWLSInvalidLicenseFileContents   = -10005;
222 const WTErr eWLSInvalidDeviceID     = -10006;
223 const WTErr eWLSInvalidClientID     = -10007;
224 const WTErr eWLSLicenseFileDownloadFailed     = -10008;
225 const WTErr eWLSNoLicensesForClientOrDevice   = -10009;
226 const WTErr eWLSNoLicensesForSomePlugins   = -10010;
227
228 // Communication errors
229 const WTErr eCommEndOfRecievedMessage           = -11001;
230 const WTErr eCommSocketDisconnected                     = -11002;
231
232 // Window Manager Errors
233 const WTErr eWMEventNotHandled                          = -12001;
234 const WTErr eWMDisposeViewFailed                        = -12002;
235
236 // Plugin View Manager Errors
237 const WTErr ePVMPlatformNotSupported            = -13001;
238 const WTErr ePVMAlreadyInitialized              = -13002;
239 const WTErr ePVMIllegalParent                   = -13003;
240 const WTErr ePVMCannotCreateView                = -13004;
241 const WTErr ePVMNothingSelected                 = -13005;
242 const WTErr ePVMDisabledItemChosen              = -13006;
243 const WTErr ePVMMenuItemNotFound                = -13007;
244 const WTErr ePVMMenuItemNotASubMenu             = -13008;
245 const WTErr ePVMUnknownMenu                     = -13009;
246 const WTErr ePVMEmptyNativeViewRef              = -13010;
247 const WTErr ePVMGenericError                    = -13011;
248 const WTErr ePVMFunctionNotImplemented          = -13012;
249
250 // Plugin View Manager  - Menu Errors
251 const WTErr ePVMCannotCreateMenu                = -13501;
252 const WTErr ePVMCannotSetMenuFont               = -13502;
253 const WTErr ePVMCannotSetMenu                   = -13503;
254 const WTErr ePVMItemParentNotExists             = -13504;
255
256 // Plugin View Manager  - TextField Errors
257 const WTErr ePVMCannotCreateTextField           = -13553;
258 const WTErr ePVMCannotEmbedTextField            = -13554;
259 const WTErr ePVMNoTextToValidate                = -13555;
260 const WTErr ePVMTextTooLong                     = -13556;
261 const WTErr ePVMIllegalCharacter                = -13557;
262
263
264 // Meter Manager Errors
265 const WTErr eMM_MeterGetMeterValueForParameterNotConnected      = -14000 ;
266
267
268 //Surface Driver Manager Errors
269 const WTErr eSDM_SurfaceDriverAPIFailed = -14101;
270
271 // IPC Errors
272 const WTErr eIPC_CreateNamedPipeFailed         = -14200;
273 const WTErr eIPC_OpenPipeTimeout               = -14201;
274 const WTErr eIPC_DeleteNamedPipeFailed         = -14202;
275 const WTErr eIPC_SelectOnNamedPipeFailed       = -14203;
276 const WTErr eIPC_ReadFromNamedPipeFailed       = -14204;
277 const WTErr eIPC_ReadEndOfFileFromNamedPipe    = -14205;
278 const WTErr eIPC_CloseNamedPipeFailed          = -14206;
279 const WTErr eIPC_ParseArgsFailed               = -14207;
280 const WTErr eIPC_OpenPipeFailed                = -14208;
281 const WTErr eIPC_SendMsgFailed                 = -14209;
282 const WTErr eIPC_SendCommandInvalid            = -14210;
283 const WTErr eIPC_QtTestMode                                    = -14211;
284 const WTErr eIPC_ChangePermissionOnPipe            = -14212;
285 const WTErr eIPC_ConnectionLost                    = -14213;
286
287 const WTErr eIPC_InvalidRole                       = -14213;
288 const WTErr eIPC_CreateNamedPipeM2SFailed      = -14214;
289 const WTErr eIPC_CreateNamedPipeS2MFailed      = -14215;
290 const WTErr eIPC_ChangePermissionOnPipeM2S     = -14216;
291 const WTErr eIPC_ChangePermissionOnPipeS2M     = -14217;
292 const WTErr eIPC_OpenReadPipeFailed            = -14218;
293 const WTErr eIPC_OpenReadPipeDIsableSigPipe    = -14219;
294 const WTErr eIPC_OpenWritePipeFailed           = -14220;
295 const WTErr eIPC_WritePipeFailed               = -14221;
296 const WTErr eIPC_WritePipeNotOpen              = -14222;
297 const WTErr eIPC_WriteBufferResizeFailed       = -14223;
298 const WTErr eIPC_NotConnectedSendMsgFailed     = -14224;
299 const WTErr eIPC_OpenWritePipeWorkerStoping    = -14225;
300 const WTErr eIPC_SoketSendFailed               = -14226;
301 const WTErr eIPC_PtonFailed                    = -14227;
302 const WTErr eIPC_SocketFailed                  = -14228;
303 const WTErr eIPC_BindFailed                    = -14229;
304 const WTErr eIPC_ListenFailed                  = -14230;
305 const WTErr eIPC_ConnectFailed                 = -14231;
306 const WTErr eIPC_WsaStartupFailed              = -14232;
307 const WTErr eIPC_UdpSocketCreateFailed         = -14233;
308 const WTErr eIPC_UdpSocketConnectFailed        = -14234;
309 const WTErr eIPC_UdpSocketBinFailed            = -14235;
310 const WTErr eIPC_SetBufferPreambleFailed       = -14226;
311
312 // Database errors
313 const WTErr eDB_BatchRollback = -15501;
314
315 // inventory related errors
316 const WTErr eUnknown_Device = -16001;
317 const WTErr eInvNoDevice    = -16002;
318
319 // SG protocol service errors
320 const WTErr eSGProtocolService_Not_Running      = -17001;
321 const WTErr eSGProtocolService_Version_MisMatch = -17002;
322
323 // Error code related to Param
324 const WTErr eInvalidParam  = -18001;
325
326 #define WUIsError(theErrorCode) (eNoErr != (theErrorCode))
327 #define WUNoError(theErrorCode) (eNoErr == (theErrorCode))
328 #define WUThrowError(theErrorCode) {if(WUIsError(theErrorCode))throw (theErrorCode);}
329 #define WUThrowErrorIfNil(thePtr , theErrorCode) {if (0 == thePtr )throw (theErrorCode);}
330 #define WUThrowErrorIfFalse(theBool , theErrorCode) {if (!(theBool))throw (theErrorCode);}
331 #define WUThrowErrorCodeIfError(err,theErrorCode) {if(WUIsError(err))throw (theErrorCode);}
332
333 // Get the error string that match the error code.
334 DllExport const char* WTErrName(WTErr wtErr);
335
336 #endif //__WUErrors_h__: