Add dedicated Exception for Plugin/Processor errors
This commit is contained in:
parent
5476aa336f
commit
88c796c8f2
|
@ -45,6 +45,18 @@ namespace ARDOUR {
|
|||
class Location;
|
||||
class Session;
|
||||
|
||||
class LIBARDOUR_API ProcessorException: public std::exception
|
||||
{
|
||||
public:
|
||||
explicit ProcessorException (const std::string msg) : _message(msg) {}
|
||||
virtual ~ProcessorException () throw() {}
|
||||
|
||||
virtual const char* what() const throw() { return _message.c_str(); }
|
||||
|
||||
private:
|
||||
std::string _message;
|
||||
};
|
||||
|
||||
/** A mixer strip element - plugin, send, meter, etc */
|
||||
class LIBARDOUR_API Processor : public SessionObject, public Automatable, public Latent
|
||||
{
|
||||
|
|
|
@ -461,6 +461,9 @@ Session::Session (AudioEngine &eng,
|
|||
case -6:
|
||||
throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Audio/MIDI Engine is not running or sample-rate mismatches.")));
|
||||
break;
|
||||
case -8:
|
||||
throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Required Plugin/Processor is missing.")));
|
||||
break;
|
||||
default:
|
||||
throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Unexpected exception during session setup, possibly invalid audio/midi engine parameters. Please see stdout/stderr for details")));
|
||||
break;
|
||||
|
|
|
@ -381,6 +381,9 @@ Session::post_engine_init ()
|
|||
} catch (AudioEngine::PortRegistrationFailure& err) {
|
||||
error << err.what() << endmsg;
|
||||
return -5;
|
||||
} catch (ProcessorException const & e) {
|
||||
error << e.what() << endmsg;
|
||||
return -8;
|
||||
} catch (std::exception const & e) {
|
||||
error << _("Unexpected exception during session setup: ") << e.what() << endmsg;
|
||||
return -6;
|
||||
|
|
Loading…
Reference in New Issue