#include "libardour-config.h"
+#include <exception>
#include <list>
#include <map>
#include <set>
extern void setup_enum_writer ();
+class LIBARDOUR_API SessionException: public std::exception {
+public:
+ explicit SessionException(const std::string msg) : _message(msg) {}
+ virtual ~SessionException() throw() {}
+
+ virtual const char* what() const throw() { return _message.c_str(); }
+
+private:
+ std::string _message;
+};
+
class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager
{
public:
#endif
if (ensure_engine (sr)) {
destroy ();
- throw failed_constructor ();
+ throw SessionException (_("Cannot connect to audio/midi engine"));
}
if (create (mix_template, bus_profile)) {
destroy ();
- throw failed_constructor ();
+ throw SessionException (_("Session initialization failed"));
}
/* if a mix template was provided, then ::create() will
if (!mix_template.empty()) {
if (load_state (_current_snapshot_name)) {
- throw failed_constructor ();
+ throw SessionException (_("Failed to load template/snapshot state"));
}
store_recent_templates (mix_template);
}
} else {
if (load_state (_current_snapshot_name)) {
- throw failed_constructor ();
+ throw SessionException (_("Failed to load state"));
}
/* try to get sample rate from XML state so that we
if (ensure_engine (sr)) {
destroy ();
- throw failed_constructor ();
+ throw SessionException (_("Cannot connect to audio/midi engine"));
}
}
if (post_engine_init ()) {
destroy ();
- throw failed_constructor ();
+ throw SessionException (_("Cannot configure audio/midi engine with session parameters"));
}
store_recent_sessions (_name, _path);