diff options
author | Carl Hetherington <carl@carlh.net> | 2012-06-19 00:25:26 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-06-19 00:25:26 +0000 |
commit | 4d1246e0ee7267ae935c1cd4a0b6087978fab0c2 (patch) | |
tree | 9c0b929c6c22fc8e730b497ad265af2dfb7e1abb /libs/ardour/test/profiling | |
parent | 508b5fa34126bc144e263da52f8bb7fcbdb42f4a (diff) |
Add load_session to profiling.
git-svn-id: svn://localhost/ardour2/branches/3.0@12775 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/test/profiling')
-rw-r--r-- | libs/ardour/test/profiling/load_session.cc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/ardour/test/profiling/load_session.cc b/libs/ardour/test/profiling/load_session.cc new file mode 100644 index 0000000000..3c6bd9bb10 --- /dev/null +++ b/libs/ardour/test/profiling/load_session.cc @@ -0,0 +1,48 @@ +#include "test_util.h" +#include "pbd/failed_constructor.h" +#include "ardour/ardour.h" +#include "ardour/audioengine.h" +#include "ardour/session.h" +#include "midi++/manager.h" +#include <iostream> +#include <cstdlib> + +using namespace std; +using namespace ARDOUR; + +int main (int argc, char* argv[]) +{ + if (argc != 3) { + cerr << "Syntax: " << argv[0] << " <dir> <snapshot-name>\n"; + exit (EXIT_FAILURE); + } + + ARDOUR::init (false, true); + + Session* s = 0; + + try { + s = load_session (argv[1], argv[2]); + } catch (failed_constructor& e) { + cerr << "failed_constructor: " << e.what() << "\n"; + exit (EXIT_FAILURE); + } catch (AudioEngine::PortRegistrationFailure& e) { + cerr << "PortRegistrationFailure: " << e.what() << "\n"; + exit (EXIT_FAILURE); + } catch (exception& e) { + cerr << "exception: " << e.what() << "\n"; + exit (EXIT_FAILURE); + } catch (...) { + cerr << "unknown exception.\n"; + exit (EXIT_FAILURE); + } + + AudioEngine::instance()->remove_session (); + delete s; + AudioEngine::instance()->stop (true); + + MIDI::Manager::destroy (); + AudioEngine::destroy (); + + return 0; +} |