Add API to update port resampler
Previously resampler ratio could only set when creating an audio port. This is in preparation for setting resampler quality when the session rate mismatches. The session's rate is only known after basic session-setup is performed. At this time Click-IO already exists.
This commit is contained in:
parent
2ff05d9e9d
commit
53cfbe9c7f
|
@ -43,7 +43,7 @@ public:
|
|||
void cycle_split ();
|
||||
|
||||
/* reset SRC, clear out any state */
|
||||
void reinit ();
|
||||
void reinit (bool with_ratio);
|
||||
|
||||
Buffer& get_buffer (pframes_t nframes) {
|
||||
return get_audio_buffer (nframes);
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
virtual void cycle_start (pframes_t);
|
||||
virtual void cycle_end (pframes_t) = 0;
|
||||
virtual void cycle_split () = 0;
|
||||
virtual void reinit () {}
|
||||
virtual void reinit (bool) {}
|
||||
virtual Buffer& get_buffer (pframes_t nframes) = 0;
|
||||
virtual void flush_buffers (pframes_t /*nframes*/) {}
|
||||
virtual void transport_stopped () {}
|
||||
|
|
|
@ -189,6 +189,9 @@ public:
|
|||
|
||||
void remove_all_ports ();
|
||||
|
||||
/** reset port-buffers. e.g. after freewheeling */
|
||||
void reinit (bool with_ratio = false);
|
||||
|
||||
void clear_pending_port_deletions ();
|
||||
|
||||
virtual void add_pending_port_deletion (Port*) = 0;
|
||||
|
@ -303,8 +306,6 @@ protected:
|
|||
*/
|
||||
void cycle_end (pframes_t nframes, Session* s = 0);
|
||||
|
||||
void reinit ();
|
||||
|
||||
void cycle_end_fade_out (gain_t, gain_t, pframes_t, Session* s = 0);
|
||||
|
||||
static std::string port_info_file ();
|
||||
|
|
|
@ -127,8 +127,15 @@ AudioPort::cycle_split ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioPort::reinit ()
|
||||
AudioPort::reinit (bool with_ratio)
|
||||
{
|
||||
/* must not be called concurrently with processing */
|
||||
if (with_ratio) {
|
||||
/* Note: latency changes with quality, caller
|
||||
* must take care of updating port latencies */
|
||||
_src.setup (resampler_quality ());
|
||||
_src.set_rrfilt (10);
|
||||
}
|
||||
_src.reset ();
|
||||
}
|
||||
|
||||
|
|
|
@ -1316,11 +1316,12 @@ PortManager::silence (pframes_t nframes, Session* s)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PortManager::reinit ()
|
||||
PortManager::reinit (bool with_ratio)
|
||||
{
|
||||
for (auto const& p : *_ports.reader ()) {
|
||||
p.second->reinit ();
|
||||
p.second->reinit (with_ratio);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user