[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PSound update



I went over the PSound code regarding that error message / exception
throwing stuff. Here's the changelog:

* Changed "#ifdef __linux__" to "#ifdef PP_SYS_OS_LINUX"
* Changed "#ifdef WIN32" to "#ifdef PP_SYS_OS_WIN32"
* Changed throw clauses to use ppThrow (). Needs still much more work though (I often didn't know what exception types are most appropriate)
* Changed debug output to use ppWarning () & Co
* Fixed WORDS_BIGENDIAN in Codec.cpp to PP_WORDS_BIGENDIAN
* Changed some "throw \"allocation failure\"" statements to "throw std::bad_alloc"
* Added new exception EUnsupported (File format / feature / operation not supported by LibPP)
* fixed #include "PenguinPlay/..." to #include <PenguinPlay/...>
* Moved EHardwareUnavailable from AudioExceptions.h to exceptions.h
* Added #include <PenguinPlay/PenguinPlay.h> where it seemed neccessary. I might have missed some however (which means some macros are not defined when they should be)
* Slightly changed the definition of ppThrow () so that it can be used also for exceptions which are not only for debugging (yup, that was a bug)
* The exceptions in AudioException.h behaved according to long obsolete rules (parameter const char *line instead of int line). Fixed.
* Moved ENullPointer from AudioExceptions.h to exceptions.h
* Some exceptions in Dsp.cpp are not converted to ppThrow, as they'd need support for merging error strings (ala ppWarning & Co))
  Update: Fixed by replacing the throw statements with ppWarning (); ppThrow (). Should be fine theoretically.


Some notes:

* I didn't fix the stuff in the PSound headers yet. I'll try to do that
  tomorrow (yawn ;)
* I tried to use the exception type most appropriate for the situation, so
  there might be some methods that trow a rather wide range of different
  exceptions. You might want to reduce that a bit.
* I wasn't always sure what exception type is the most appropriate for the
  given situation. You should have a look over it yourself (especially look
  for EMethodFailure (which is just an 
  I-don't-know-what-proper-exception-to-use thing))
* some of the #include <string> statements might be unneccessary now (as
  all throw string (...) things have been replaced. I haven't checked for
  this.
* I get some nontrivial warnings in Sequencer.cpp (control reaching end of
  non-void function bla bla) and AudioFile.cpp (structure declared but never
  used...)


	Christian
-- 

Drive A: not responding...Formatting C: instead