2 * Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef _session_utils_common_h_
20 #define _session_utils_common_h_
22 #include "pbd/transmitter.h"
23 #include "pbd/receiver.h"
25 #include "ardour/ardour.h"
26 #include "ardour/session.h"
28 class TestReceiver : public Receiver
31 void receive (Transmitter::Channel chn, const char * str);
34 namespace SessionUtils {
36 /** initialize libardour */
37 void init (bool print_log = true);
39 /** clean up, stop Processing Engine
40 * @param s Session to close (may me NULL)
44 /** @param dir Session directory.
45 * @param state Session state file, without .ardour suffix.
46 * @returns an ardour session object (free with \ref unload_session) or NULL
48 ARDOUR::Session* load_session (std::string dir, std::string state, bool exit_at_failure = true);
50 /** @param dir Session directory.
51 * @param state Session state file, without .ardour suffix.
52 * @returns an ardour session object (free with \ref unload_session) or NULL on error
54 ARDOUR::Session* create_session (std::string dir, std::string state, float sample_rate);
56 /** close session and stop engine
57 * @param s Session to close (may me NULL)
59 void unload_session (ARDOUR::Session *s);
63 #endif /* _session_utils_misc_h_ */