Optimize plugin-processing for non-automated params
[ardour.git] / libs / ardour / ardour / luascripting.h
index b48aaa9a69949e25f6fb8654e64893cb7e7cb72b..7570ff1bc84716100090f85ae71d2f96d75fef50 100644 (file)
@@ -38,22 +38,35 @@ class LIBARDOUR_API LuaScriptInfo {
                EditorHook,
                EditorAction,
                Snippet,
+               SessionInit,
+       };
+
+       /* binary flags, valid for ActionScripts */
+       enum ScriptSubType {
+               None          = 0x00,
+               RouteSetup    = 0x01,
+               SessionSetup  = 0x02,
        };
 
        static std::string type2str (const ScriptType t);
        static ScriptType str2type (const std::string& str);
 
-       LuaScriptInfo (ScriptType t, const std::string &n, const std::string &p)
+       LuaScriptInfo (ScriptType t, const std::string &n, const std::string &p, const std::string &uid)
        : type (t)
+       , subtype (0)
        , name (n)
        , path (p)
+       , unique_id (uid)
        { }
 
        virtual ~LuaScriptInfo () { }
 
        ScriptType type;
+       uint32_t   subtype;
+
        std::string name;
        std::string path;
+       std::string unique_id;
 
        std::string author;
        std::string license;
@@ -67,11 +80,12 @@ struct LIBARDOUR_API LuaScriptParam {
                                const std::string& n,
                                const std::string& t,
                                const std::string& d,
-                               bool o)
+                               bool o, bool p)
                        : name (n)
                        , title (t)
                        , dflt (d)
                        , optional (o)
+                       , preseeded (p)
                        , is_set (false)
                        , value (d)
        {}
@@ -80,6 +94,7 @@ struct LIBARDOUR_API LuaScriptParam {
                std::string title;
                std::string dflt;
                bool optional;
+               bool preseeded;
                bool is_set;
                std::string value;
 };
@@ -105,7 +120,7 @@ public:
 
        static LuaScriptInfoPtr script_info (const std::string &script);
        static bool try_compile (const std::string&, const LuaScriptParamList&);
-       static std::string get_factory_bytecode (const std::string&);
+       static std::string get_factory_bytecode (const std::string&, const std::string& ffn = "factory", const std::string& fp = "f");
        static std::string user_script_dir ();
 
 private:
@@ -121,6 +136,8 @@ private:
        LuaScriptList *_sl_hook;
        LuaScriptList *_sl_action;
        LuaScriptList *_sl_snippet;
+       LuaScriptList *_sl_setup;
+       LuaScriptList *_sl_tracks;
        LuaScriptList  _empty_script_info;
 
        Glib::Threads::Mutex _lock;