*/
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_outputs (pframes_t nframes);
void check_monitoring ();
*/
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;
mutable Glib::Threads::Mutex midi_port_info_mutex;
if (_session == 0) {
if (!_freewheeling) {
- PortManager::cycle_start (nframes);
- PortManager::cycle_end (nframes);
+ PortManager::silence_outputs (nframes);
}
_processed_samples = next_processed_samples;
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) {
session_removal_countdown -= nframes;
}
session_removal_gain -= (nframes * session_removal_gain_step);
+ } else {
+ PortManager::cycle_end (nframes, _session);
}
- PortManager::cycle_end (nframes, _session);
-
_processed_samples = next_processed_samples;
PT_TIMING_CHECK (2);
}
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);
+
+ if (p->second->sends_output()) {
- boost::shared_ptr<AudioPort> ap = boost::dynamic_pointer_cast<AudioPort> (i->second);
+ boost::shared_ptr<AudioPort> ap = boost::dynamic_pointer_cast<AudioPort> (p->second);
if (ap) {
Sample* s = ap->engine_get_whole_audio_buffer ();
gain_t g = base_gain;
}
}
}
+ _cycle_ports.reset ();
+ /* we are done */
}
PortEngine&