use new action map API instead of ActionManager::get_action
[ardour.git] / session_utils / common.h
1 #ifndef _session_utils_common_h_
2 #define _session_utils_common_h_
3
4 #include "pbd/transmitter.h"
5 #include "pbd/receiver.h"
6
7 #include "ardour/ardour.h"
8 #include "ardour/session.h"
9
10 class TestReceiver : public Receiver
11 {
12   protected:
13     void receive (Transmitter::Channel chn, const char * str);
14 };
15
16 namespace SessionUtils {
17
18         /** initialize libardour */
19         void init (bool print_log = true);
20
21         /** clean up, stop Processing Engine
22          * @param s Session to close (may me NULL)
23          */
24         void cleanup ();
25
26         /** @param dir Session directory.
27          *  @param state Session state file, without .ardour suffix.
28          *  @returns an ardour session object (free with \ref unload_session) or NULL
29          */
30         ARDOUR::Session* load_session (std::string dir, std::string state, bool exit_at_failure = true);
31
32         /** @param dir Session directory.
33          *  @param state Session state file, without .ardour suffix.
34          *  @returns an ardour session object (free with \ref unload_session) or NULL on error
35          */
36         ARDOUR::Session* create_session (std::string dir, std::string state, float sample_rate);
37
38         /** close session and stop engine
39          * @param s Session to close (may me NULL)
40          */
41         void unload_session (ARDOUR::Session *s);
42
43 };
44
45 #endif /* _session_utils_misc_h_ */