Wouldn't it be nice if plugin presets had a description/comment?
[ardour.git] / libs / ardour / ardour / plugin.h
index f51f34b099f1206efa7f90b1c3824e6e94359f2d..a22d138770c6ace95115c2dae9e1fb503cb3cb7d 100644 (file)
@@ -114,9 +114,9 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
        virtual bool inplace_broken() const { return false; }
 
        virtual int connect_and_run (BufferSet& bufs,
-                       framepos_t start, framepos_t end, double speed,
-                       ChanMapping in, ChanMapping out,
-                       pframes_t nframes, framecnt_t offset);
+                       samplepos_t start, samplepos_t end, double speed,
+                       ChanMapping const& in, ChanMapping const& out,
+                       pframes_t nframes, samplecnt_t offset);
 
        virtual std::set<Evoral::Parameter> automatable() const = 0;
        virtual std::string describe_parameter (Evoral::Parameter) = 0;
@@ -190,7 +190,8 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
 
        struct PresetRecord {
            PresetRecord () : valid (false) {}
-           PresetRecord (const std::string& u, const std::string& l, bool s = true) : uri (u), label (l), user (s), valid (true)  {}
+           PresetRecord (const std::string& u, const std::string& l, bool s = true, const std::string& d = "")
+                               : uri (u), label (l), description (d), user (s), valid (true)  {}
 
            bool operator!= (PresetRecord const & a) const {
                    return uri != a.uri || label != a.label;
@@ -198,6 +199,7 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
 
            std::string uri;
            std::string label;
+           std::string description;
            bool user;
            bool valid;
        };
@@ -249,7 +251,7 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
        }
 
        /** the max possible latency a plugin will have */
-       virtual framecnt_t max_latency () const { return 0; } // TODO = 0, require implementation
+       virtual samplecnt_t max_latency () const { return 0; } // TODO = 0, require implementation
 
        /** Emitted when a preset is added or removed, respectively */
        PBD::Signal0<void> PresetAdded;
@@ -383,7 +385,7 @@ private:
 
        PBD::ScopedConnection _preset_connection;
 
-       MidiRingBuffer<framepos_t> _immediate_events;
+       MidiRingBuffer<samplepos_t> _immediate_events;
 
        void resolve_midi ();
 };
@@ -425,9 +427,16 @@ class LIBARDOUR_API PluginInfo {
        std::string unique_id;
 
        virtual PluginPtr load (Session& session) = 0;
-       virtual bool is_instrument() const;
+
+       /* NOTE: it is possible for a plugin to be an effect AND an instrument.
+        * override these funcs as necessary to support that.
+        */
+       virtual bool is_effect () const;
+       virtual bool is_instrument () const;
+       virtual bool is_utility () const;  //this includes things like "generators" and "midi filters"
+       virtual bool is_analyzer () const;
+
        virtual bool needs_midi_input() const;
-       virtual bool in_category (const std::string &) const { return false; }
 
        virtual std::vector<Plugin::PresetRecord> get_presets (bool user_only) const = 0;