document buffer requirement, add sidechain constraint.
[ardour.git] / libs / lua / lua / luastate.h
1 /*
2  * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18
19 #ifndef LUA_STATE_H
20 #define LUA_STATE_H
21
22 #include <string>
23 #include <sigc++/sigc++.h>
24
25 #include "lua/liblua_visibility.h"
26 #include "lua/lua.h"
27
28 class LIBLUA_API LuaState {
29 public:
30         LuaState();
31         LuaState(lua_State *ls);
32         ~LuaState();
33
34         int do_command (std::string);
35         int do_file (std::string);
36         void collect_garbage ();
37
38         sigc::signal<void,std::string> Print;
39
40         lua_State* getState () { return L; }
41
42 protected:
43         lua_State* L;
44
45 private:
46         void init ();
47   static int _print (lua_State *L);
48         void print (std::string text);
49
50 };
51
52 #endif