Tempo ramps - fix music-locked meter drags.
[ardour.git] / libs / ardour / ardour / luaproc.h
index d0560e9953f40f72ec7697de045451f74d10a7d8..67c4432087b91cba0cc44ebb75af5e44ac46cf38 100644 (file)
 #include "ardour/dsp_filter.h"
 
 #include "lua/luastate.h"
-#include "LuaBridge/LuaBridge.h"
+
+namespace luabridge {
+       class LuaRef;
+}
 
 namespace ARDOUR {
 
@@ -60,6 +63,8 @@ public:
        std::string get_docs () const { return _docs; }
        std::string get_parameter_docs (uint32_t) const;
 
+       PluginOutputConfiguration possible_output () const { return _output_configs; }
+
        std::set<Evoral::Parameter> automatable() const;
 
        void activate () { }
@@ -87,23 +92,23 @@ public:
        int set_state (const XMLNode&, int version);
        int set_script_from_state (const XMLNode&);
 
-       bool load_preset (PresetRecord) { return false; }
+       bool load_preset (PresetRecord);
+       std::string do_save_preset (std::string);
+       void do_remove_preset (std::string);
+
        bool has_editor() const { return false; }
 
-       bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
+       bool can_support_io_configuration (const ChanCount& in, ChanCount& out, ChanCount* imprecise);
        bool configure_io (ChanCount in, ChanCount out);
 
        ChanCount output_streams() const { return _configured_out; }
        ChanCount input_streams() const { return _configured_in; }
 
-       std::string do_save_preset (std::string) { return ""; }
-       void do_remove_preset (std::string) { }
-
        bool has_inline_display () { return _lua_has_inline_display; }
        void setup_lua_inline_gui (LuaState *lua_gui);
 
 private:
-       void find_presets () { }
+       void find_presets ();
 
        /* END Plugin interface */
 protected:
@@ -113,7 +118,6 @@ private:
        PBD::ReallocPool _mempool;
        LuaState lua;
        luabridge::LuaRef * _lua_dsp;
-       luabridge::LuaRef * _lua_params;
        std::string _script;
        std::string _docs;
        bool _lua_does_channelmapping;
@@ -127,12 +131,22 @@ private:
        bool load_script ();
        void lua_print (std::string s);
 
+       std::string preset_name_to_uri (const std::string&) const;
+       std::string presets_file () const;
+       XMLTree* presets_tree () const;
+
+       boost::shared_ptr<ScalePoints> parse_scale_points (luabridge::LuaRef*);
+
        std::vector<std::pair<bool, int> > _ctrl_params;
+       std::map<int, ARDOUR::ParameterDescriptor> _param_desc;
+       std::map<int, std::string> _param_doc;
+
        float* _control_data;
        float* _shadow_data;
 
        ChanCount _configured_in;
        ChanCount _configured_out;
+       PluginOutputConfiguration _output_configs;
 
        bool _has_midi_input;
        bool _has_midi_output;
@@ -153,8 +167,13 @@ class LIBARDOUR_API LuaPluginInfo : public PluginInfo
        PluginPtr load (Session& session);
        std::vector<Plugin::PresetRecord> get_presets (bool user_only) const;
 
-       bool is_instrument () const { return false; }
+       bool in_category (const std::string &c) const {
+               return (category == c);
+       }
+       bool is_instrument () const { return _is_instrument; }
        bool reconfigurable_io() const { return true; }
+
+       bool _is_instrument;
 };
 
 typedef boost::shared_ptr<LuaPluginInfo> LuaPluginInfoPtr;