mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Add API to query plugin tail duration
So far only VST3 plugins have an actual implementation.
This commit is contained in:
parent
b4fca7bc1c
commit
15c7603fdd
5 changed files with 42 additions and 0 deletions
|
|
@ -175,6 +175,9 @@ public:
|
||||||
/** the max possible latency a plugin will have */
|
/** the max possible latency a plugin will have */
|
||||||
virtual samplecnt_t max_latency () const { return 0; }
|
virtual samplecnt_t max_latency () const { return 0; }
|
||||||
|
|
||||||
|
samplecnt_t effective_tail() const;
|
||||||
|
PBD::Signal0<void> TailChanged;
|
||||||
|
|
||||||
virtual int set_block_size (pframes_t nframes) = 0;
|
virtual int set_block_size (pframes_t nframes) = 0;
|
||||||
virtual bool requires_fixed_sized_buffers () const { return false; }
|
virtual bool requires_fixed_sized_buffers () const { return false; }
|
||||||
virtual bool inplace_broken () const { return false; }
|
virtual bool inplace_broken () const { return false; }
|
||||||
|
|
@ -423,6 +426,11 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual samplecnt_t plugin_latency () const = 0;
|
virtual samplecnt_t plugin_latency () const = 0;
|
||||||
|
/** tail duration in samples. e.g. for reverb or delay plugins.
|
||||||
|
*
|
||||||
|
* The default when unknown is 2 sec */
|
||||||
|
virtual samplecnt_t plugin_tail () const;
|
||||||
|
|
||||||
|
|
||||||
/** Fill _presets with our presets */
|
/** Fill _presets with our presets */
|
||||||
virtual void find_presets () = 0;
|
virtual void find_presets () = 0;
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,9 @@ CONFIG_VARIABLE (uint32_t, plugin_scan_timeout, "plugin-scan-timeout", 150) /* d
|
||||||
CONFIG_VARIABLE (uint32_t, limit_n_automatables, "limit-n-automatables", 512)
|
CONFIG_VARIABLE (uint32_t, limit_n_automatables, "limit-n-automatables", 512)
|
||||||
CONFIG_VARIABLE (uint32_t, plugin_cache_version, "plugin-cache-version", 0)
|
CONFIG_VARIABLE (uint32_t, plugin_cache_version, "plugin-cache-version", 0)
|
||||||
|
|
||||||
|
CONFIG_VARIABLE (float, tail_duration_sec, "tail-duration-sec", 2.0)
|
||||||
|
CONFIG_VARIABLE (uint32_t, max_tail_samples, "max-tail-samples", 0xffffffff) // aka kInfiniteTail
|
||||||
|
|
||||||
/* custom user plugin paths */
|
/* custom user plugin paths */
|
||||||
CONFIG_VARIABLE (std::string, plugin_path_vst, "plugin-path-vst", "@default@")
|
CONFIG_VARIABLE (std::string, plugin_path_vst, "plugin-path-vst", "@default@")
|
||||||
CONFIG_VARIABLE (std::string, plugin_path_lxvst, "plugin-path-lxvst", "@default@")
|
CONFIG_VARIABLE (std::string, plugin_path_lxvst, "plugin-path-lxvst", "@default@")
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,7 @@ public:
|
||||||
|
|
||||||
/* API for Ardour -- Setup/Processing */
|
/* API for Ardour -- Setup/Processing */
|
||||||
uint32_t plugin_latency ();
|
uint32_t plugin_latency ();
|
||||||
|
uint32_t plugin_tail ();
|
||||||
bool set_block_size (int32_t);
|
bool set_block_size (int32_t);
|
||||||
bool activate ();
|
bool activate ();
|
||||||
bool deactivate ();
|
bool deactivate ();
|
||||||
|
|
@ -326,6 +327,7 @@ private:
|
||||||
bool _add_to_selection;
|
bool _add_to_selection;
|
||||||
|
|
||||||
boost::optional<uint32_t> _plugin_latency;
|
boost::optional<uint32_t> _plugin_latency;
|
||||||
|
boost::optional<uint32_t> _plugin_tail;
|
||||||
|
|
||||||
int _n_bus_in;
|
int _n_bus_in;
|
||||||
int _n_bus_out;
|
int _n_bus_out;
|
||||||
|
|
@ -440,6 +442,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
samplecnt_t plugin_latency () const;
|
samplecnt_t plugin_latency () const;
|
||||||
|
samplecnt_t plugin_tail () const;
|
||||||
void init ();
|
void init ();
|
||||||
void find_presets ();
|
void find_presets ();
|
||||||
void forward_resize_view (int w, int h);
|
void forward_resize_view (int w, int h);
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,19 @@ Plugin::input_streams () const
|
||||||
return ChanCount::ZERO;
|
return ChanCount::ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
samplecnt_t
|
||||||
|
Plugin::effective_tail () const
|
||||||
|
{
|
||||||
|
/* consider adding a user-override per plugin; compare to HasLatency, Latent */
|
||||||
|
return max<samplecnt_t> (0, min<samplecnt_t> (plugin_tail (), Config->get_max_tail_samples ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
samplecnt_t
|
||||||
|
Plugin::plugin_tail () const
|
||||||
|
{
|
||||||
|
return _session.sample_rate () * Config->get_tail_duration_sec ();
|
||||||
|
}
|
||||||
|
|
||||||
Plugin::IOPortDescription
|
Plugin::IOPortDescription
|
||||||
Plugin::describe_io_port (ARDOUR::DataType dt, bool input, uint32_t id) const
|
Plugin::describe_io_port (ARDOUR::DataType dt, bool input, uint32_t id) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -819,6 +819,12 @@ VST3Plugin::set_block_size (pframes_t n_samples)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
samplecnt_t
|
||||||
|
VST3Plugin::plugin_tail () const
|
||||||
|
{
|
||||||
|
return _plug->plugin_tail ();
|
||||||
|
}
|
||||||
|
|
||||||
samplecnt_t
|
samplecnt_t
|
||||||
VST3Plugin::plugin_latency () const
|
VST3Plugin::plugin_latency () const
|
||||||
{
|
{
|
||||||
|
|
@ -1951,6 +1957,15 @@ VST3PI::plugin_latency ()
|
||||||
return _plugin_latency.value ();
|
return _plugin_latency.value ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
VST3PI::plugin_tail ()
|
||||||
|
{
|
||||||
|
if (!_plugin_tail) { // XXX this is currently never reset
|
||||||
|
_plugin_tail = _processor->getTailSamples ();
|
||||||
|
}
|
||||||
|
return _plugin_tail.value ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VST3PI::set_owner (SessionObject* o)
|
VST3PI::set_owner (SessionObject* o)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue