* This MUST be called before any reading/writing for this cycle.
* Realtime safe.
*/
- void cycle_start (pframes_t nframes);
+ void cycle_start (pframes_t nframes, Session* s = 0);
/** Signal the end of an audio cycle.
* This signifies that the cycle began with @ref cycle_start has ended.
* This MUST be called at the end of each cycle.
* Realtime safe.
*/
- void cycle_end (pframes_t nframes);
+ void cycle_end (pframes_t nframes, Session* s = 0);
typedef std::map<std::string,MidiPortInformation> MidiPortInfo;
class Return;
class Route;
class RouteGroup;
+class RTTaskList;
class SMFSource;
class Send;
class SceneChanger;
return routes.reader ();
}
+ boost::shared_ptr<RTTaskList> rt_tasklist () { return _rt_tasklist; }
+
CoreSelection& selection () { return *_selection; }
/* because the set of Stripables consists of objects managed
boost::shared_ptr<IO> _ltc_input;
boost::shared_ptr<IO> _ltc_output;
+ boost::shared_ptr<RTTaskList> _rt_tasklist;
+
/* Scene Changing */
SceneChanger* _scene_changer;
/* tell all Ports that we're starting a new cycle */
- PortManager::cycle_start (nframes);
+ PortManager::cycle_start (nframes, _session);
/* test if we are freewheeling and there are freewheel signals connected.
* ardour should act normally even when freewheeling unless /it/ is
}
if (_freewheeling) {
- PortManager::cycle_end (nframes);
+ PortManager::cycle_end (nframes, _session);
return 0;
}
session_removal_gain -= (nframes * session_removal_gain_step);
}
- PortManager::cycle_end (nframes);
+ PortManager::cycle_end (nframes, _session);
_processed_samples = next_processed_samples;
#include "ardour/midiport_manager.h"
#include "ardour/port_manager.h"
#include "ardour/profile.h"
+#include "ardour/rt_tasklist.h"
#include "ardour/session.h"
#include "ardour/types_convert.h"
}
void
-PortManager::cycle_start (pframes_t nframes)
+PortManager::cycle_start (pframes_t nframes, Session* s)
{
Port::set_global_port_buffer_offset (0);
Port::set_cycle_samplecnt (nframes);
_cycle_ports = ports.reader ();
- // TODO parallelize
- for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
- p->second->cycle_start (nframes);
+ 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_start, p->second, nframes));
+ }
+ s->rt_tasklist()->process (tl);
+ } else {
+ for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
+ p->second->cycle_start (nframes);
+ }
}
}
void
-PortManager::cycle_end (pframes_t nframes)
+PortManager::cycle_end (pframes_t nframes, Session* s)
{
- for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
- p->second->cycle_end (nframes);
+ 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);
+ }
}
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
#include "ardour/revision.h"
#include "ardour/route_graph.h"
#include "ardour/route_group.h"
+#include "ardour/rt_tasklist.h"
#include "ardour/send.h"
#include "ardour/selection.h"
#include "ardour/session.h"
* session or set state for an existing one.
*/
+ _rt_tasklist.reset (new RTTaskList ());
+
if (how_many_dsp_threads () > 1) {
/* For now, only create the graph if we are using >1 DSP threads, as
it is a bit slower than the old code with 1 thread.