1 // wmmixer - A mixer designed for WindowMaker
4 // Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
5 // Copyright (C) 2002 Gordon Fraser <gordon@debian.org>
6 // This software comes with ABSOLUTELY NO WARRANTY
7 // This software is free software, and you are welcome to redistribute it
8 // under certain conditions
9 // See the COPYING file for details.
11 #include "exception.h"
14 //--------------------------------------------------------------------
15 Exception::Exception()
17 error_message_
= NULL
;
20 //--------------------------------------------------------------------
21 Exception::Exception(const Exception
& exc
)
23 char* other_message
= exc
.getErrorMessage();
25 if(other_message
!= NULL
)
27 error_message_
= new char[strlen(other_message
)+1];
28 strcpy(error_message_
, other_message
);
31 error_message_
= NULL
;
34 //--------------------------------------------------------------------
35 Exception::~Exception()
37 if(error_message_
!= NULL
)
38 delete[] error_message_
;
41 //--------------------------------------------------------------------
42 char* Exception::getErrorMessage() const
44 return error_message_
;
47 //--------------------------------------------------------------------
48 MixerDeviceException::MixerDeviceException(char* device
)
50 error_message_
= new char[256];
51 strcpy(error_message_
, "Unable to open mixer device ");
52 strcat(error_message_
, device
);