Fix fade-out at quit.
This commit is contained in:
parent
d6e96a688d
commit
b54db1cab7
@ -181,7 +181,6 @@ class LIBARDOUR_API PortManager
|
|||||||
*/
|
*/
|
||||||
boost::shared_ptr<Ports> _cycle_ports;
|
boost::shared_ptr<Ports> _cycle_ports;
|
||||||
|
|
||||||
void fade_out (gain_t, gain_t, pframes_t);
|
|
||||||
void silence (pframes_t nframes, Session *s = 0);
|
void silence (pframes_t nframes, Session *s = 0);
|
||||||
void silence_outputs (pframes_t nframes);
|
void silence_outputs (pframes_t nframes);
|
||||||
void check_monitoring ();
|
void check_monitoring ();
|
||||||
@ -198,6 +197,8 @@ class LIBARDOUR_API PortManager
|
|||||||
*/
|
*/
|
||||||
void cycle_end (pframes_t nframes, Session* s = 0);
|
void cycle_end (pframes_t nframes, Session* s = 0);
|
||||||
|
|
||||||
|
void cycle_end_fade_out (gain_t, gain_t, pframes_t, Session* s = 0);
|
||||||
|
|
||||||
typedef std::map<std::string,MidiPortInformation> MidiPortInfo;
|
typedef std::map<std::string,MidiPortInformation> MidiPortInfo;
|
||||||
|
|
||||||
mutable Glib::Threads::Mutex midi_port_info_mutex;
|
mutable Glib::Threads::Mutex midi_port_info_mutex;
|
||||||
|
@ -349,8 +349,7 @@ AudioEngine::process_callback (pframes_t nframes)
|
|||||||
if (_session == 0) {
|
if (_session == 0) {
|
||||||
|
|
||||||
if (!_freewheeling) {
|
if (!_freewheeling) {
|
||||||
PortManager::cycle_start (nframes);
|
PortManager::silence_outputs (nframes);
|
||||||
PortManager::cycle_end (nframes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_processed_samples = next_processed_samples;
|
_processed_samples = next_processed_samples;
|
||||||
@ -440,7 +439,7 @@ AudioEngine::process_callback (pframes_t nframes)
|
|||||||
|
|
||||||
if (session_remove_pending && session_removal_countdown) {
|
if (session_remove_pending && session_removal_countdown) {
|
||||||
|
|
||||||
PortManager::fade_out (session_removal_gain, session_removal_gain_step, nframes);
|
PortManager::cycle_end_fade_out (session_removal_gain, session_removal_gain_step, nframes, _session);
|
||||||
|
|
||||||
if (session_removal_countdown > nframes) {
|
if (session_removal_countdown > nframes) {
|
||||||
session_removal_countdown -= nframes;
|
session_removal_countdown -= nframes;
|
||||||
@ -449,9 +448,9 @@ AudioEngine::process_callback (pframes_t nframes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
session_removal_gain -= (nframes * session_removal_gain_step);
|
session_removal_gain -= (nframes * session_removal_gain_step);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
PortManager::cycle_end (nframes, _session);
|
PortManager::cycle_end (nframes, _session);
|
||||||
|
}
|
||||||
|
|
||||||
_processed_samples = next_processed_samples;
|
_processed_samples = next_processed_samples;
|
||||||
|
|
||||||
|
@ -869,13 +869,26 @@ PortManager::check_monitoring ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PortManager::fade_out (gain_t base_gain, gain_t gain_step, pframes_t nframes)
|
PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t nframes, Session* s)
|
||||||
{
|
{
|
||||||
for (Ports::iterator i = _cycle_ports->begin(); i != _cycle_ports->end(); ++i) {
|
if (s && s->rt_tasklist ()) {
|
||||||
|
RTTaskList::TaskList tl;
|
||||||
|
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||||
|
tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes));
|
||||||
|
}
|
||||||
|
s->rt_tasklist()->process (tl);
|
||||||
|
} else {
|
||||||
|
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||||
|
p->second->cycle_end (nframes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (i->second->sends_output()) {
|
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||||
|
p->second->flush_buffers (nframes);
|
||||||
|
|
||||||
boost::shared_ptr<AudioPort> ap = boost::dynamic_pointer_cast<AudioPort> (i->second);
|
if (p->second->sends_output()) {
|
||||||
|
|
||||||
|
boost::shared_ptr<AudioPort> ap = boost::dynamic_pointer_cast<AudioPort> (p->second);
|
||||||
if (ap) {
|
if (ap) {
|
||||||
Sample* s = ap->engine_get_whole_audio_buffer ();
|
Sample* s = ap->engine_get_whole_audio_buffer ();
|
||||||
gain_t g = base_gain;
|
gain_t g = base_gain;
|
||||||
@ -887,6 +900,8 @@ PortManager::fade_out (gain_t base_gain, gain_t gain_step, pframes_t nframes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_cycle_ports.reset ();
|
||||||
|
/* we are done */
|
||||||
}
|
}
|
||||||
|
|
||||||
PortEngine&
|
PortEngine&
|
||||||
|
Loading…
Reference in New Issue
Block a user