Make RCU reader return a const pointer (omnibus commit)
This commit is contained in:
parent
e9f71824a1
commit
295dbd8e1e
@ -283,9 +283,9 @@ BundleManager::BundleManager (Session* session)
|
|||||||
_tree_view.append_column (_("Name"), _list_model_columns.name);
|
_tree_view.append_column (_("Name"), _list_model_columns.name);
|
||||||
_tree_view.set_headers_visible (false);
|
_tree_view.set_headers_visible (false);
|
||||||
|
|
||||||
std::shared_ptr<BundleList> bundles = _session->bundles ();
|
std::shared_ptr<BundleList const> bundles = _session->bundles ();
|
||||||
for (BundleList::iterator i = bundles->begin(); i != bundles->end(); ++i) {
|
for (auto const& i : *bundles) {
|
||||||
add_bundle (*i);
|
add_bundle (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* New / Edit / Delete buttons */
|
/* New / Edit / Delete buttons */
|
||||||
|
@ -304,9 +304,8 @@ CueBoxUI::context_menu (uint64_t idx)
|
|||||||
void
|
void
|
||||||
CueBoxUI::get_slots (TriggerList &triggerlist, uint64_t idx)
|
CueBoxUI::get_slots (TriggerList &triggerlist, uint64_t idx)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = _session->get_routes();
|
std::shared_ptr<RouteList const> rl = _session->get_routes();
|
||||||
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
|
for (auto const& route : *rl) {
|
||||||
std::shared_ptr<Route> route = *r;
|
|
||||||
std::shared_ptr<TriggerBox> box = route->triggerbox();
|
std::shared_ptr<TriggerBox> box = route->triggerbox();
|
||||||
#warning @Ben disambiguate processor *active* vs *visibility*
|
#warning @Ben disambiguate processor *active* vs *visibility*
|
||||||
if (box /*&& box.active*/) {
|
if (box /*&& box.active*/) {
|
||||||
|
@ -645,9 +645,9 @@ Editor::session_gui_extents (bool use_extra) const
|
|||||||
* NOTE: we should listen to playlists, and cache these values so we don't calculate them every time.
|
* NOTE: we should listen to playlists, and cache these values so we don't calculate them every time.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = _session->get_routes();
|
std::shared_ptr<RouteList const> rl = _session->get_routes();
|
||||||
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*r);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (r);
|
||||||
|
|
||||||
if (!tr) {
|
if (!tr) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -756,7 +756,7 @@ Editor::real_remove_meter_marker (Temporal::MeterPoint const * section)
|
|||||||
Temporal::TempoMap::WritableSharedPtr
|
Temporal::TempoMap::WritableSharedPtr
|
||||||
Editor::begin_tempo_mapping ()
|
Editor::begin_tempo_mapping ()
|
||||||
{
|
{
|
||||||
TempoMap::WritableSharedPtr wmap = TempoMap::fetch_writable ();
|
TempoMap::WritableSharedPtr wmap = TempoMap::write_copy ();
|
||||||
reassociate_metric_markers (wmap);
|
reassociate_metric_markers (wmap);
|
||||||
(void) Temporal::DomainSwapInformation::start (Temporal::BeatTime);
|
(void) Temporal::DomainSwapInformation::start (Temporal::BeatTime);
|
||||||
_session->globally_change_time_domain (Temporal::BeatTime, Temporal::AudioTime);
|
_session->globally_change_time_domain (Temporal::BeatTime, Temporal::AudioTime);
|
||||||
@ -787,7 +787,7 @@ Editor::commit_tempo_mapping (TempoMap::WritableSharedPtr& new_map)
|
|||||||
Temporal::TempoMap::WritableSharedPtr
|
Temporal::TempoMap::WritableSharedPtr
|
||||||
Editor::begin_tempo_map_edit ()
|
Editor::begin_tempo_map_edit ()
|
||||||
{
|
{
|
||||||
TempoMap::WritableSharedPtr wmap = TempoMap::fetch_writable ();
|
TempoMap::WritableSharedPtr wmap = TempoMap::write_copy ();
|
||||||
reassociate_metric_markers (wmap);
|
reassociate_metric_markers (wmap);
|
||||||
return wmap;
|
return wmap;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ GroupTabs::on_button_release_event (GdkEventButton*)
|
|||||||
if (_dragging_new_tab) {
|
if (_dragging_new_tab) {
|
||||||
run_new_group_dialog (&routes, false);
|
run_new_group_dialog (&routes, false);
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<RouteList> r = _session->get_routes ();
|
std::shared_ptr<RouteList const> r = _session->get_routes ();
|
||||||
/* First add new ones, then remove old ones.
|
/* First add new ones, then remove old ones.
|
||||||
* We cannot allow the group to become temporarily empty, because
|
* We cannot allow the group to become temporarily empty, because
|
||||||
* Session::route_removed_from_route_group() will delete empty groups.
|
* Session::route_removed_from_route_group() will delete empty groups.
|
||||||
@ -227,16 +227,15 @@ GroupTabs::on_button_release_event (GdkEventButton*)
|
|||||||
/* RouteGroup::add () ignores routes already present in the set */
|
/* RouteGroup::add () ignores routes already present in the set */
|
||||||
_dragging->group->add (*i);
|
_dragging->group->add (*i);
|
||||||
}
|
}
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
|
|
||||||
bool const was_in_tab = find (
|
bool const was_in_tab = find (
|
||||||
_initial_dragging_routes.begin(), _initial_dragging_routes.end(), *i
|
_initial_dragging_routes.begin(), _initial_dragging_routes.end(), i) != _initial_dragging_routes.end ();
|
||||||
) != _initial_dragging_routes.end ();
|
|
||||||
|
|
||||||
bool const now_in_tab = find (routes.begin(), routes.end(), *i) != routes.end();
|
bool const now_in_tab = find (routes.begin(), routes.end(), i) != routes.end();
|
||||||
|
|
||||||
if (was_in_tab && !now_in_tab) {
|
if (was_in_tab && !now_in_tab) {
|
||||||
_dragging->group->remove (*i);
|
_dragging->group->remove (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,12 +583,12 @@ GroupTabs::get_rec_enabled ()
|
|||||||
return rec_enabled;
|
return rec_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = _session->get_routes ();
|
std::shared_ptr<RouteList const> rl = _session->get_routes ();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> trk (std::dynamic_pointer_cast<Track> (*i));
|
std::shared_ptr<Track> trk (std::dynamic_pointer_cast<Track> (i));
|
||||||
if (trk && trk->rec_enable_control()->get_value()) {
|
if (trk && trk->rec_enable_control()->get_value()) {
|
||||||
rec_enabled.push_back (*i);
|
rec_enabled.push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ IOButtonBase::set_label (IOButtonBase& self, ARDOUR::Session& session, std::shar
|
|||||||
|
|
||||||
/* Are all main-typed channels connected to the same route ? */
|
/* Are all main-typed channels connected to the same route ? */
|
||||||
if (!have_label) {
|
if (!have_label) {
|
||||||
std::shared_ptr<ARDOUR::RouteList> routes = session.get_routes ();
|
std::shared_ptr<ARDOUR::RouteList const> routes = session.get_routes ();
|
||||||
for (auto const& route : *routes) {
|
for (auto const& route : *routes) {
|
||||||
std::shared_ptr<IO> dest_io = input ? route->output () : route->input ();
|
std::shared_ptr<IO> dest_io = input ? route->output () : route->input ();
|
||||||
if (io->bundle ()->connected_to (dest_io->bundle (), session.engine (), dt, true)) {
|
if (io->bundle ()->connected_to (dest_io->bundle (), session.engine (), dt, true)) {
|
||||||
@ -276,9 +276,9 @@ IOButtonBase::set_label (IOButtonBase& self, ARDOUR::Session& session, std::shar
|
|||||||
|
|
||||||
/* Are all main-typed channels connected to the same (user) bundle ? */
|
/* Are all main-typed channels connected to the same (user) bundle ? */
|
||||||
if (!have_label) {
|
if (!have_label) {
|
||||||
std::shared_ptr<ARDOUR::BundleList> bundles = session.bundles ();
|
std::shared_ptr<ARDOUR::BundleList const> bundles = session.bundles ();
|
||||||
std::shared_ptr<ARDOUR::Port> ap = std::dynamic_pointer_cast<ARDOUR::Port> (session.vkbd_output_port ());
|
std::shared_ptr<ARDOUR::Port> ap = std::dynamic_pointer_cast<ARDOUR::Port> (session.vkbd_output_port ());
|
||||||
std::string vkbd_portname = AudioEngine::instance ()->make_port_name_non_relative (ap->name ());
|
std::string vkbd_portname = AudioEngine::instance ()->make_port_name_non_relative (ap->name ());
|
||||||
for (auto const& bundle : *bundles) {
|
for (auto const& bundle : *bundles) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (bundle) == 0) {
|
if (std::dynamic_pointer_cast<UserBundle> (bundle) == 0) {
|
||||||
if (!bundle->offers_port (vkbd_portname)) {
|
if (!bundle->offers_port (vkbd_portname)) {
|
||||||
@ -576,20 +576,20 @@ IOButton::button_press (GdkEventButton* ev)
|
|||||||
uint32_t const n_with_separator = citems.size ();
|
uint32_t const n_with_separator = citems.size ();
|
||||||
|
|
||||||
_menu_bundles.clear ();
|
_menu_bundles.clear ();
|
||||||
ARDOUR::BundleList current = io ()->bundles_connected ();
|
ARDOUR::BundleList current = io ()->bundles_connected ();
|
||||||
std::shared_ptr<ARDOUR::BundleList> b = _route->session ().bundles ();
|
std::shared_ptr<ARDOUR::BundleList const> b = _route->session ().bundles ();
|
||||||
|
|
||||||
if (_input) {
|
if (_input) {
|
||||||
/* give user bundles first chance at being in the menu */
|
/* give user bundles first chance at being in the menu */
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin (); i != b->end (); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i)) {
|
if (std::dynamic_pointer_cast<UserBundle> (i)) {
|
||||||
maybe_add_bundle_to_menu (*i, current);
|
maybe_add_bundle_to_menu (i, current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin (); i != b->end (); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i) == 0) {
|
if (std::dynamic_pointer_cast<UserBundle> (i) == 0) {
|
||||||
maybe_add_bundle_to_menu (*i, current);
|
maybe_add_bundle_to_menu (i, current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -603,8 +603,7 @@ IOButton::button_press (GdkEventButton* ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::RouteList> routes = _route->session ().get_routes ();
|
RouteList copy = *_route->session ().get_routes ();
|
||||||
RouteList copy = *routes;
|
|
||||||
copy.sort (RouteCompareByName ());
|
copy.sort (RouteCompareByName ());
|
||||||
|
|
||||||
if (_input) {
|
if (_input) {
|
||||||
@ -642,16 +641,16 @@ IOButton::button_press (GdkEventButton* ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* then try adding user output bundles, often labeled/grouped physical inputs */
|
/* then try adding user output bundles, often labeled/grouped physical inputs */
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin (); i != b->end (); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i)) {
|
if (std::dynamic_pointer_cast<UserBundle> (i)) {
|
||||||
maybe_add_bundle_to_menu (*i, current, intended_type);
|
maybe_add_bundle_to_menu (i, current, intended_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* then all other bundles, including physical outs or other software */
|
/* then all other bundles, including physical outs or other software */
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin (); i != b->end (); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i) == 0) {
|
if (std::dynamic_pointer_cast<UserBundle> (i) == 0) {
|
||||||
maybe_add_bundle_to_menu (*i, current, intended_type);
|
maybe_add_bundle_to_menu (i, current, intended_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ IOPluginWindow::refill ()
|
|||||||
if (!_session) {
|
if (!_session) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::shared_ptr<IOPlugList> iop (_session->io_plugs ());
|
std::shared_ptr<IOPlugList const> iop (_session->io_plugs ());
|
||||||
for (auto& i : *iop) {
|
for (auto& i : *iop) {
|
||||||
IOPlugUI* iopup = manage (new IOPlugUI (i));
|
IOPlugUI* iopup = manage (new IOPlugUI (i));
|
||||||
if (i->is_pre ()) {
|
if (i->is_pre ()) {
|
||||||
@ -588,9 +588,9 @@ IOPluginWindow::IOButton::button_press (GdkEventButton* ev)
|
|||||||
|
|
||||||
uint32_t const n_with_separator = citems.size ();
|
uint32_t const n_with_separator = citems.size ();
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::BundleList> b = _io->session ().bundles ();
|
std::shared_ptr<ARDOUR::BundleList const> b = _io->session ().bundles ();
|
||||||
std::shared_ptr<ARDOUR::RouteList> routes = _io->session ().get_routes ();
|
std::shared_ptr<ARDOUR::RouteList const> routes = _io->session ().get_routes ();
|
||||||
RouteList copy = *routes;
|
RouteList copy = *routes;
|
||||||
copy.sort (RouteCompareByName ());
|
copy.sort (RouteCompareByName ());
|
||||||
|
|
||||||
if (_io->direction () == IO::Input) {
|
if (_io->direction () == IO::Input) {
|
||||||
|
@ -4291,7 +4291,6 @@ void
|
|||||||
Mixer_UI::toggle_monitor_action (MonitorChoice monitor_choice, bool group_override, bool all)
|
Mixer_UI::toggle_monitor_action (MonitorChoice monitor_choice, bool group_override, bool all)
|
||||||
{
|
{
|
||||||
MonitorChoice mc;
|
MonitorChoice mc;
|
||||||
std::shared_ptr<RouteList> rl;
|
|
||||||
|
|
||||||
for (AxisViewSelection::iterator i = _selection.axes.begin(); i != _selection.axes.end(); ++i) {
|
for (AxisViewSelection::iterator i = _selection.axes.begin(); i != _selection.axes.end(); ++i) {
|
||||||
std::shared_ptr<ARDOUR::Route> rt = std::dynamic_pointer_cast<ARDOUR::Route> ((*i)->stripable());
|
std::shared_ptr<ARDOUR::Route> rt = std::dynamic_pointer_cast<ARDOUR::Route> ((*i)->stripable());
|
||||||
@ -4309,14 +4308,14 @@ Mixer_UI::toggle_monitor_action (MonitorChoice monitor_choice, bool group_overri
|
|||||||
|
|
||||||
if (all) {
|
if (all) {
|
||||||
/* Primary-Tertiary-click applies change to all routes */
|
/* Primary-Tertiary-click applies change to all routes */
|
||||||
rl = _session->get_routes ();
|
std::shared_ptr<RouteList const> rl = _session->get_routes ();
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup);
|
||||||
} else if (group_override) {
|
} else if (group_override) {
|
||||||
rl.reset (new RouteList);
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
rl->push_back (rt);
|
rl->push_back (rt);
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::InverseGroup);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::InverseGroup);
|
||||||
} else {
|
} else {
|
||||||
rl.reset (new RouteList);
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
rl->push_back (rt);
|
rl->push_back (rt);
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::UseGroup);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::UseGroup);
|
||||||
}
|
}
|
||||||
|
@ -1194,7 +1194,7 @@ bool
|
|||||||
MonitorSection::cancel_isolate (GdkEventButton*)
|
MonitorSection::cancel_isolate (GdkEventButton*)
|
||||||
{
|
{
|
||||||
if (_session) {
|
if (_session) {
|
||||||
std::shared_ptr<RouteList> rl (_session->get_routes ());
|
std::shared_ptr<RouteList const> rl (_session->get_routes ());
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::solo_isolate_control), 0.0, Controllable::NoGroup);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::solo_isolate_control), 0.0, Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1360,23 +1360,23 @@ MonitorSection::output_press (GdkEventButton *ev)
|
|||||||
|
|
||||||
ARDOUR::BundleList current = _route->output()->bundles_connected ();
|
ARDOUR::BundleList current = _route->output()->bundles_connected ();
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::BundleList> b = _session->bundles ();
|
std::shared_ptr<ARDOUR::BundleList const> b = _session->bundles ();
|
||||||
|
|
||||||
/* give user bundles first chance at being in the menu */
|
/* give user bundles first chance at being in the menu */
|
||||||
|
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i)) {
|
if (std::dynamic_pointer_cast<UserBundle> (i)) {
|
||||||
maybe_add_bundle_to_output_menu (*i, current);
|
maybe_add_bundle_to_output_menu (i, current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i) == 0) {
|
if (std::dynamic_pointer_cast<UserBundle> (i) == 0) {
|
||||||
maybe_add_bundle_to_output_menu (*i, current);
|
maybe_add_bundle_to_output_menu (i, current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
|
std::shared_ptr<ARDOUR::RouteList const> routes = _session->get_routes ();
|
||||||
RouteList copy = *routes;
|
RouteList copy = *routes;
|
||||||
copy.sort (RouteCompareByName ());
|
copy.sort (RouteCompareByName ());
|
||||||
for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
|
for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
|
||||||
|
@ -632,12 +632,12 @@ PluginPinWidget::add_port_to_table (std::shared_ptr<Port> p, uint32_t r, bool ca
|
|||||||
|
|
||||||
if (single_source && _session) {
|
if (single_source && _session) {
|
||||||
/* check if it's an Ardour Send feeding.. */
|
/* check if it's an Ardour Send feeding.. */
|
||||||
std::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
|
std::shared_ptr<ARDOUR::RouteList const> routes = _session->get_routes ();
|
||||||
for (ARDOUR::RouteList::const_iterator i = routes->begin (); i != routes->end (); ++i) {
|
for (auto const& i : *routes) {
|
||||||
uint32_t nth = 0;
|
uint32_t nth = 0;
|
||||||
std::shared_ptr<Processor> proc;
|
std::shared_ptr<Processor> proc;
|
||||||
/* nth_send () takes a processor read-lock */
|
/* nth_send () takes a processor read-lock */
|
||||||
while ((proc = (*i)->nth_send (nth))) {
|
while ((proc = i->nth_send (nth))) {
|
||||||
std::shared_ptr<IOProcessor> send = std::dynamic_pointer_cast<IOProcessor> (proc);
|
std::shared_ptr<IOProcessor> send = std::dynamic_pointer_cast<IOProcessor> (proc);
|
||||||
if (!send || !send->output ()) {
|
if (!send || !send->output ()) {
|
||||||
++nth;
|
++nth;
|
||||||
|
@ -362,7 +362,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
|||||||
order key.
|
order key.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::shared_ptr<RouteList> routes = session->get_routes ();
|
std::shared_ptr<RouteList const> routes = session->get_routes ();
|
||||||
list<RouteIOs> route_ios;
|
list<RouteIOs> route_ios;
|
||||||
|
|
||||||
for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
|
||||||
@ -440,19 +440,19 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
|||||||
that UserBundles that offer the same ports as a normal bundle get priority
|
that UserBundles that offer the same ports as a normal bundle get priority
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::shared_ptr<BundleList> b = session->bundles ();
|
std::shared_ptr<BundleList const> b = session->bundles ();
|
||||||
|
|
||||||
for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i) && (*i)->ports_are_inputs() == inputs) {
|
if (std::dynamic_pointer_cast<UserBundle> (i) && i->ports_are_inputs() == inputs) {
|
||||||
system->add_bundle (*i, allow_dups);
|
system->add_bundle (i, allow_dups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only look for non-user bundles if instructed to do so */
|
/* Only look for non-user bundles if instructed to do so */
|
||||||
if (use_session_bundles) {
|
if (use_session_bundles) {
|
||||||
for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
|
for (auto const& i : *b) {
|
||||||
if (std::dynamic_pointer_cast<UserBundle> (*i) == 0 && (*i)->ports_are_inputs() == inputs) {
|
if (std::dynamic_pointer_cast<UserBundle> (i) == 0 && i->ports_are_inputs() == inputs) {
|
||||||
system->add_bundle (*i, allow_dups);
|
system->add_bundle (i, allow_dups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,10 +193,10 @@ PortMatrix::reconnect_to_routes ()
|
|||||||
{
|
{
|
||||||
_route_connections.drop_connections ();
|
_route_connections.drop_connections ();
|
||||||
|
|
||||||
std::shared_ptr<RouteList> routes = _session->get_routes ();
|
std::shared_ptr<RouteList const> routes = _session->get_routes ();
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
(*i)->processors_changed.connect (_route_connections, invalidator (*this), boost::bind (&PortMatrix::route_processors_changed, this, _1), gui_context());
|
i->processors_changed.connect (_route_connections, invalidator (*this), boost::bind (&PortMatrix::route_processors_changed, this, _1), gui_context());
|
||||||
(*i)->DropReferences.connect (_route_connections, invalidator (*this), boost::bind (&PortMatrix::routes_changed, this), gui_context());
|
i->DropReferences.connect (_route_connections, invalidator (*this), boost::bind (&PortMatrix::routes_changed, this), gui_context());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,7 +564,7 @@ RecorderUI::start_updating ()
|
|||||||
|
|
||||||
size_t iop_audio = 0;
|
size_t iop_audio = 0;
|
||||||
size_t iop_midi = 0;
|
size_t iop_midi = 0;
|
||||||
std::shared_ptr<IOPlugList> iop;
|
std::shared_ptr<IOPlugList const> iop;
|
||||||
if (_session) {
|
if (_session) {
|
||||||
iop = _session->io_plugs ();
|
iop = _session->io_plugs ();
|
||||||
for (auto& p : *iop) {
|
for (auto& p : *iop) {
|
||||||
@ -684,7 +684,7 @@ void
|
|||||||
RecorderUI::io_plugins_changed ()
|
RecorderUI::io_plugins_changed ()
|
||||||
{
|
{
|
||||||
_fast_screen_update_connection.disconnect ();
|
_fast_screen_update_connection.disconnect ();
|
||||||
std::shared_ptr<IOPlugList> iop (_session->io_plugs ());
|
std::shared_ptr<IOPlugList const> iop (_session->io_plugs ());
|
||||||
for (auto& p : *iop) {
|
for (auto& p : *iop) {
|
||||||
if (_ioplugins.find (p) != _ioplugins.end ()) {
|
if (_ioplugins.find (p) != _ioplugins.end ()) {
|
||||||
continue;
|
continue;
|
||||||
@ -794,7 +794,7 @@ bool
|
|||||||
RecorderUI::update_meters ()
|
RecorderUI::update_meters ()
|
||||||
{
|
{
|
||||||
PortManager::AudioInputPorts const aip (AudioEngine::instance ()->audio_input_ports ());
|
PortManager::AudioInputPorts const aip (AudioEngine::instance ()->audio_input_ports ());
|
||||||
std::shared_ptr<IOPlugList> iop;
|
std::shared_ptr<IOPlugList const> iop;
|
||||||
if (_session) {
|
if (_session) {
|
||||||
iop = _session->io_plugs ();
|
iop = _session->io_plugs ();
|
||||||
}
|
}
|
||||||
|
@ -145,12 +145,11 @@ RouteParams_UI::~RouteParams_UI ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteParams_UI::add_routes (RouteList& routes)
|
RouteParams_UI::add_routes (RouteList const& routes)
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (*this, &RouteParams_UI::add_routes, routes)
|
ENSURE_GUI_THREAD (*this, &RouteParams_UI::add_routes, routes);
|
||||||
|
|
||||||
for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
|
for (auto const& route : routes) {
|
||||||
std::shared_ptr<Route> route = (*x);
|
|
||||||
|
|
||||||
if (route->is_auditioner()) {
|
if (route->is_auditioner()) {
|
||||||
return;
|
return;
|
||||||
@ -359,7 +358,7 @@ RouteParams_UI::set_session (Session *sess)
|
|||||||
route_display_model->clear();
|
route_display_model->clear();
|
||||||
|
|
||||||
if (_session) {
|
if (_session) {
|
||||||
std::shared_ptr<RouteList> r = _session->get_routes();
|
std::shared_ptr<RouteList const> r = _session->get_routes();
|
||||||
add_routes (*r);
|
add_routes (*r);
|
||||||
_session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&RouteParams_UI::add_routes, this, _1), gui_context());
|
_session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&RouteParams_UI::add_routes, this, _1), gui_context());
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ private:
|
|||||||
Glib::RefPtr<Gtk::ListStore> route_display_model;
|
Glib::RefPtr<Gtk::ListStore> route_display_model;
|
||||||
|
|
||||||
|
|
||||||
void add_routes (ARDOUR::RouteList&);
|
void add_routes (ARDOUR::RouteList const&);
|
||||||
|
|
||||||
void route_property_changed (const PBD::PropertyChange&, std::weak_ptr<ARDOUR::Route> route);
|
void route_property_changed (const PBD::PropertyChange&, std::weak_ptr<ARDOUR::Route> route);
|
||||||
void route_removed (std::weak_ptr<ARDOUR::Route> route);
|
void route_removed (std::weak_ptr<ARDOUR::Route> route);
|
||||||
|
@ -890,7 +890,6 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MonitorChoice mc;
|
MonitorChoice mc;
|
||||||
std::shared_ptr<RouteList> rl;
|
|
||||||
|
|
||||||
if (t->monitoring_control()->monitoring_choice() & monitor_choice) {
|
if (t->monitoring_control()->monitoring_choice() & monitor_choice) {
|
||||||
mc = MonitorChoice (t->monitoring_control()->monitoring_choice() & ~monitor_choice);
|
mc = MonitorChoice (t->monitoring_control()->monitoring_choice() & ~monitor_choice);
|
||||||
@ -900,15 +899,15 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice)
|
|||||||
|
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
|
||||||
/* Primary-Tertiary-click applies change to all routes */
|
/* Primary-Tertiary-click applies change to all routes */
|
||||||
rl = _session->get_routes ();
|
std::shared_ptr<RouteList const> rl = _session->get_routes ();
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup);
|
||||||
} else if (Keyboard::is_group_override_event (ev)) {
|
} else if (Keyboard::is_group_override_event (ev)) {
|
||||||
/* Tertiary-click overrides group */
|
/* Tertiary-click overrides group */
|
||||||
rl.reset (new RouteList);
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
rl->push_back (route());
|
rl->push_back (route());
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, GROUP_ACTION);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, GROUP_ACTION);
|
||||||
} else {
|
} else {
|
||||||
rl.reset (new RouteList);
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
rl->push_back (route());
|
rl->push_back (route());
|
||||||
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::UseGroup);
|
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::UseGroup);
|
||||||
}
|
}
|
||||||
@ -1562,18 +1561,18 @@ RouteUI::solo_safe_button_release (GdkEventButton* ev)
|
|||||||
|
|
||||||
if (ev->button == 1) {
|
if (ev->button == 1) {
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
|
||||||
std::shared_ptr<RouteList> rl (_session->get_routes());
|
std::shared_ptr<RouteList const> rl (_session->get_routes());
|
||||||
if (model) {
|
if (model) {
|
||||||
/* disable solo safe for all routes */
|
/* disable solo safe for all routes */
|
||||||
DisplaySuspender ds;
|
DisplaySuspender ds;
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
(*i)->solo_safe_control()->set_value (0.0, Controllable::NoGroup);
|
i->solo_safe_control()->set_value (0.0, Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* enable solo safe for all routes */
|
/* enable solo safe for all routes */
|
||||||
DisplaySuspender ds;
|
DisplaySuspender ds;
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
(*i)->solo_safe_control()->set_value (1.0, Controllable::NoGroup);
|
i->solo_safe_control()->set_value (1.0, Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -727,9 +727,8 @@ CueMaster::context_menu ()
|
|||||||
void
|
void
|
||||||
CueMaster::get_boxen (TriggerBoxList &boxlist)
|
CueMaster::get_boxen (TriggerBoxList &boxlist)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = _session->get_routes();
|
std::shared_ptr<RouteList const> rl = _session->get_routes();
|
||||||
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
|
for (auto const& route : *rl) {
|
||||||
std::shared_ptr<Route> route = *r;
|
|
||||||
std::shared_ptr<TriggerBox> box = route->triggerbox();
|
std::shared_ptr<TriggerBox> box = route->triggerbox();
|
||||||
#warning @Ben disambiguate processor *active* vs *visibility*
|
#warning @Ben disambiguate processor *active* vs *visibility*
|
||||||
if (box /*&& box.active*/) {
|
if (box /*&& box.active*/) {
|
||||||
|
@ -101,7 +101,7 @@ private:
|
|||||||
void empty_pool_trash ();
|
void empty_pool_trash ();
|
||||||
void process_delegated_work ();
|
void process_delegated_work ();
|
||||||
void config_changed (std::string);
|
void config_changed (std::string);
|
||||||
bool flush_tracks_to_disk_normal (std::shared_ptr<RouteList>, uint32_t& errors);
|
bool flush_tracks_to_disk_normal (std::shared_ptr<RouteList const>, uint32_t& errors);
|
||||||
void queue_request (Request::Type r);
|
void queue_request (Request::Type r);
|
||||||
|
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
std::string write_source_name () const;
|
std::string write_source_name () const;
|
||||||
|
|
||||||
std::shared_ptr<AudioFileSource> audio_write_source (uint32_t n = 0) {
|
std::shared_ptr<AudioFileSource> audio_write_source (uint32_t n = 0) {
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
if (n < c->size ()) {
|
if (n < c->size ()) {
|
||||||
return (*c)[n]->write_source;
|
return (*c)[n]->write_source;
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ private:
|
|||||||
samplecnt_t& rec_offset);
|
samplecnt_t& rec_offset);
|
||||||
|
|
||||||
void check_record_status (samplepos_t transport_sample, double speed, bool can_record);
|
void check_record_status (samplepos_t transport_sample, double speed, bool can_record);
|
||||||
void finish_capture (std::shared_ptr<ChannelList> c);
|
void finish_capture (std::shared_ptr<ChannelList const> c);
|
||||||
void reset_capture ();
|
void reset_capture ();
|
||||||
|
|
||||||
void loop (samplepos_t);
|
void loop (samplepos_t);
|
||||||
|
@ -229,13 +229,13 @@ protected:
|
|||||||
SerializedRCUManager<PortRegistry> _portregistry;
|
SerializedRCUManager<PortRegistry> _portregistry;
|
||||||
|
|
||||||
bool valid_port (BackendPortHandle port) const {
|
bool valid_port (BackendPortHandle port) const {
|
||||||
std::shared_ptr<PortRegistry> p = _portregistry.reader ();
|
std::shared_ptr<PortRegistry const> p = _portregistry.reader ();
|
||||||
return p->find (port) != p->end ();
|
return p->find (port) != p->end ();
|
||||||
}
|
}
|
||||||
|
|
||||||
BackendPortPtr find_port (const std::string& port_name) const {
|
BackendPortPtr find_port (const std::string& port_name) const {
|
||||||
std::shared_ptr<PortMap> p = _portmap.reader ();
|
std::shared_ptr<PortMap const> p = _portmap.reader ();
|
||||||
PortMap::const_iterator it = p->find (port_name);
|
PortMap::const_iterator it = p->find (port_name);
|
||||||
if (it == p->end ()) {
|
if (it == p->end ()) {
|
||||||
return BackendPortPtr();
|
return BackendPortPtr();
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ protected:
|
|||||||
void port_registration_failure (const std::string& portname);
|
void port_registration_failure (const std::string& portname);
|
||||||
|
|
||||||
/** List of ports to be used between \ref cycle_start() and \ref cycle_end() */
|
/** List of ports to be used between \ref cycle_start() and \ref cycle_end() */
|
||||||
std::shared_ptr<Ports> _cycle_ports;
|
std::shared_ptr<Ports const> _cycle_ports;
|
||||||
|
|
||||||
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);
|
||||||
|
@ -323,7 +323,7 @@ public:
|
|||||||
void refresh_disk_space ();
|
void refresh_disk_space ();
|
||||||
|
|
||||||
int load_routes (const XMLNode&, int);
|
int load_routes (const XMLNode&, int);
|
||||||
std::shared_ptr<RouteList> get_routes() const {
|
std::shared_ptr<RouteList const> get_routes() const {
|
||||||
return routes.reader ();
|
return routes.reader ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ public:
|
|||||||
|
|
||||||
bool plot_process_graph (std::string const& file_name) const;
|
bool plot_process_graph (std::string const& file_name) const;
|
||||||
|
|
||||||
std::shared_ptr<BundleList> bundles () {
|
std::shared_ptr<BundleList const> bundles () {
|
||||||
return _bundles.reader ();
|
return _bundles.reader ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -934,14 +934,14 @@ public:
|
|||||||
bool unload_io_plugin (std::shared_ptr<IOPlug>);
|
bool unload_io_plugin (std::shared_ptr<IOPlug>);
|
||||||
|
|
||||||
std::shared_ptr<IOPlug> nth_io_plug (uint32_t n) {
|
std::shared_ptr<IOPlug> nth_io_plug (uint32_t n) {
|
||||||
std::shared_ptr<IOPlugList> iop (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> iop (_io_plugins.reader ());
|
||||||
if (n < iop->size ()) {
|
if (n < iop->size ()) {
|
||||||
return (*iop)[n];
|
return (*iop)[n];
|
||||||
}
|
}
|
||||||
return std::shared_ptr<IOPlug> ();
|
return std::shared_ptr<IOPlug> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<IOPlugList> io_plugs () const {
|
std::shared_ptr<IOPlugList const> io_plugs () const {
|
||||||
return _io_plugins.reader ();
|
return _io_plugins.reader ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,7 +966,7 @@ public:
|
|||||||
bool solo_selection_active ();
|
bool solo_selection_active ();
|
||||||
void solo_selection (StripableList&, bool);
|
void solo_selection (StripableList&, bool);
|
||||||
|
|
||||||
void clear_all_solo_state (std::shared_ptr<RouteList>);
|
void clear_all_solo_state (std::shared_ptr<RouteList const>);
|
||||||
void prepare_momentary_solo (SoloMuteRelease* smr = NULL, bool exclusive = false, std::shared_ptr<Route> route = std::shared_ptr<Route> ());
|
void prepare_momentary_solo (SoloMuteRelease* smr = NULL, bool exclusive = false, std::shared_ptr<Route> route = std::shared_ptr<Route> ());
|
||||||
|
|
||||||
static const SessionEvent::RTeventCallback rt_cleanup;
|
static const SessionEvent::RTeventCallback rt_cleanup;
|
||||||
@ -1980,7 +1980,7 @@ private:
|
|||||||
void route_solo_changed (bool self_solo_change, PBD::Controllable::GroupControlDisposition group_override, std::weak_ptr<Route>);
|
void route_solo_changed (bool self_solo_change, PBD::Controllable::GroupControlDisposition group_override, std::weak_ptr<Route>);
|
||||||
void route_solo_isolated_changed (std::weak_ptr<Route>);
|
void route_solo_isolated_changed (std::weak_ptr<Route>);
|
||||||
|
|
||||||
void update_route_solo_state (std::shared_ptr<RouteList> r = std::shared_ptr<RouteList>());
|
void update_route_solo_state (std::shared_ptr<RouteList const> r = std::shared_ptr<RouteList const>());
|
||||||
|
|
||||||
void listen_position_changed ();
|
void listen_position_changed ();
|
||||||
void solo_control_mode_changed ();
|
void solo_control_mode_changed ();
|
||||||
@ -2239,8 +2239,8 @@ private:
|
|||||||
|
|
||||||
/* realtime "apply to set of routes" operations */
|
/* realtime "apply to set of routes" operations */
|
||||||
template<typename T> SessionEvent*
|
template<typename T> SessionEvent*
|
||||||
get_rt_event (std::shared_ptr<RouteList> rl, T targ, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override,
|
get_rt_event (std::shared_ptr<RouteList const> rl, T targ, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override,
|
||||||
void (Session::*method) (std::shared_ptr<RouteList>, T, PBD::Controllable::GroupControlDisposition)) {
|
void (Session::*method) (std::shared_ptr<RouteList const>, T, PBD::Controllable::GroupControlDisposition)) {
|
||||||
SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
|
SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
|
||||||
ev->rt_slot = boost::bind (method, this, rl, targ, group_override);
|
ev->rt_slot = boost::bind (method, this, rl, targ, group_override);
|
||||||
ev->rt_return = after;
|
ev->rt_return = after;
|
||||||
@ -2251,8 +2251,8 @@ private:
|
|||||||
|
|
||||||
/* specialized version realtime "apply to set of routes" operations */
|
/* specialized version realtime "apply to set of routes" operations */
|
||||||
template<typename T1, typename T2> SessionEvent*
|
template<typename T1, typename T2> SessionEvent*
|
||||||
get_rt_event (std::shared_ptr<RouteList> rl, T1 t1arg, T2 t2arg, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override,
|
get_rt_event (std::shared_ptr<RouteList const> rl, T1 t1arg, T2 t2arg, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override,
|
||||||
void (Session::*method) (std::shared_ptr<RouteList>, T1, T2, PBD::Controllable::GroupControlDisposition)) {
|
void (Session::*method) (std::shared_ptr<RouteList const>, T1, T2, PBD::Controllable::GroupControlDisposition)) {
|
||||||
SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
|
SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
|
||||||
ev->rt_slot = boost::bind (method, this, rl, t1arg, t2arg, group_override);
|
ev->rt_slot = boost::bind (method, this, rl, t1arg, t2arg, group_override);
|
||||||
ev->rt_return = after;
|
ev->rt_return = after;
|
||||||
@ -2272,7 +2272,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rt_set_controls (std::shared_ptr<WeakControlList>, double val, PBD::Controllable::GroupControlDisposition group_override);
|
void rt_set_controls (std::shared_ptr<WeakControlList>, double val, PBD::Controllable::GroupControlDisposition group_override);
|
||||||
void rt_clear_all_solo_state (std::shared_ptr<RouteList>, bool yn, PBD::Controllable::GroupControlDisposition group_override);
|
void rt_clear_all_solo_state (std::shared_ptr<RouteList const>, bool yn, PBD::Controllable::GroupControlDisposition group_override);
|
||||||
|
|
||||||
void setup_midi_machine_control ();
|
void setup_midi_machine_control ();
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ namespace ARDOUR {
|
|||||||
template<class T> void
|
template<class T> void
|
||||||
Session::foreach_route (T *obj, void (T::*func)(Route&), bool sort)
|
Session::foreach_route (T *obj, void (T::*func)(Route&), bool sort)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
RouteList public_order (*r);
|
RouteList public_order (*r);
|
||||||
|
|
||||||
if (sort) {
|
if (sort) {
|
||||||
@ -49,7 +49,7 @@ Session::foreach_route (T *obj, void (T::*func)(Route&), bool sort)
|
|||||||
template<class T> void
|
template<class T> void
|
||||||
Session::foreach_route (T *obj, void (T::*func)(std::shared_ptr<Route>), bool sort)
|
Session::foreach_route (T *obj, void (T::*func)(std::shared_ptr<Route>), bool sort)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
RouteList public_order (*r);
|
RouteList public_order (*r);
|
||||||
|
|
||||||
if (sort) {
|
if (sort) {
|
||||||
@ -64,7 +64,7 @@ Session::foreach_route (T *obj, void (T::*func)(std::shared_ptr<Route>), bool so
|
|||||||
template<class T, class A> void
|
template<class T, class A> void
|
||||||
Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort)
|
Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
RouteList public_order (*r);
|
RouteList public_order (*r);
|
||||||
|
|
||||||
if (sort) {
|
if (sort) {
|
||||||
@ -80,10 +80,10 @@ Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort)
|
|||||||
template<class A> void
|
template<class A> void
|
||||||
Session::foreach_track (void (Track::*method)(A), A arg)
|
Session::foreach_track (void (Track::*method)(A), A arg)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
(tr.get()->*method) (arg);
|
(tr.get()->*method) (arg);
|
||||||
}
|
}
|
||||||
@ -93,10 +93,10 @@ Session::foreach_track (void (Track::*method)(A), A arg)
|
|||||||
template<class A1, class A2> void
|
template<class A1, class A2> void
|
||||||
Session::foreach_track (void (Track::*method)(A1, A2), A1 arg1, A2 arg2)
|
Session::foreach_track (void (Track::*method)(A1, A2), A1 arg1, A2 arg2)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
(tr.get()->*method) (arg1, arg2);
|
(tr.get()->*method) (arg1, arg2);
|
||||||
}
|
}
|
||||||
@ -106,20 +106,19 @@ Session::foreach_track (void (Track::*method)(A1, A2), A1 arg1, A2 arg2)
|
|||||||
template<class A> void
|
template<class A> void
|
||||||
Session::foreach_route (void (Route::*method)(A), A arg)
|
Session::foreach_route (void (Route::*method)(A), A arg)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
|
for (auto const& i : *r) {
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
|
(i.get()->*method) (arg);
|
||||||
((*i).get()->*method) (arg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class A1, class A2> void
|
template<class A1, class A2> void
|
||||||
Session::foreach_route (void (Route::*method)(A1, A2), A1 arg1, A2 arg2)
|
Session::foreach_route (void (Route::*method)(A1, A2), A1 arg1, A2 arg2)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
|
for (auto const& i : *r) {
|
||||||
((*i).get()->*method) (arg1, arg2);
|
(i.get()->*method) (arg1, arg2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ public:
|
|||||||
void set_exclusive (bool exclusive = true);
|
void set_exclusive (bool exclusive = true);
|
||||||
|
|
||||||
void set (std::shared_ptr<Route>);
|
void set (std::shared_ptr<Route>);
|
||||||
void set (std::shared_ptr<RouteList>);
|
void set (std::shared_ptr<RouteList const>);
|
||||||
void set (std::shared_ptr<RouteList>, std::shared_ptr<RouteList>);
|
void set (std::shared_ptr<RouteList const>, std::shared_ptr<RouteList const>);
|
||||||
void set (std::shared_ptr<std::list<std::string> >);
|
void set (std::shared_ptr<std::list<std::string> >);
|
||||||
|
|
||||||
void release (Session*, bool mute) const;
|
void release (Session*, bool mute) const;
|
||||||
@ -49,8 +49,8 @@ private:
|
|||||||
bool active;
|
bool active;
|
||||||
bool exclusive;
|
bool exclusive;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> routes_on;
|
std::shared_ptr<RouteList const> routes_on;
|
||||||
std::shared_ptr<RouteList> routes_off;
|
std::shared_ptr<RouteList const> routes_off;
|
||||||
|
|
||||||
std::shared_ptr<std::list<std::string> > port_monitors;
|
std::shared_ptr<std::list<std::string> > port_monitors;
|
||||||
};
|
};
|
||||||
|
@ -112,11 +112,11 @@ LIBARDOUR_API uint32_t how_many_dsp_threads ();
|
|||||||
|
|
||||||
LIBARDOUR_API std::string compute_sha1_of_file (std::string path);
|
LIBARDOUR_API std::string compute_sha1_of_file (std::string path);
|
||||||
|
|
||||||
template<typename T> std::shared_ptr<ControlList> route_list_to_control_list (std::shared_ptr<RouteList> rl, std::shared_ptr<T> (Stripable::*get_control)() const) {
|
template<typename T> std::shared_ptr<ControlList> route_list_to_control_list (std::shared_ptr<RouteList const> rl, std::shared_ptr<T> (Stripable::*get_control)() const) {
|
||||||
std::shared_ptr<ControlList> cl (new ControlList);
|
std::shared_ptr<ControlList> cl (new ControlList);
|
||||||
if (!rl) { return cl; }
|
if (!rl) { return cl; }
|
||||||
for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<AutomationControl> ac = ((*r).get()->*get_control)();
|
std::shared_ptr<AutomationControl> ac = (r.get()->*get_control)();
|
||||||
if (ac) {
|
if (ac) {
|
||||||
cl->push_back (ac);
|
cl->push_back (ac);
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ AudioEngine::split_cycle (pframes_t nframes)
|
|||||||
{
|
{
|
||||||
/* caller must hold process lock */
|
/* caller must hold process lock */
|
||||||
|
|
||||||
std::shared_ptr<Ports> p = _ports.reader();
|
std::shared_ptr<Ports const> p = _ports.reader();
|
||||||
|
|
||||||
/* This is mainly for the benefit of rt-control ports (MTC, MClk)
|
/* This is mainly for the benefit of rt-control ports (MTC, MClk)
|
||||||
*
|
*
|
||||||
@ -171,8 +171,8 @@ AudioEngine::split_cycle (pframes_t nframes)
|
|||||||
* be relaxed, ignore ev->time() checks, and simply send
|
* be relaxed, ignore ev->time() checks, and simply send
|
||||||
* all events as-is.
|
* all events as-is.
|
||||||
*/
|
*/
|
||||||
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
|
for (auto const& i : *p) {
|
||||||
i->second->flush_buffers (nframes);
|
i.second->flush_buffers (nframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
Port::increment_global_port_buffer_offset (nframes);
|
Port::increment_global_port_buffer_offset (nframes);
|
||||||
@ -180,8 +180,8 @@ AudioEngine::split_cycle (pframes_t nframes)
|
|||||||
/* tell all Ports that we're going to start a new (split) cycle */
|
/* tell all Ports that we're going to start a new (split) cycle */
|
||||||
|
|
||||||
|
|
||||||
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
|
for (auto const& i : *p) {
|
||||||
i->second->cycle_split ();
|
i.second->cycle_split ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ AudioEngine::process_callback (pframes_t nframes)
|
|||||||
thread_init_callback (NULL);
|
thread_init_callback (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Temporal::TempoMap::WritableSharedPtr current_map = Temporal::TempoMap::read ();
|
Temporal::TempoMap::SharedPtr current_map = Temporal::TempoMap::read ();
|
||||||
if (current_map != Temporal::TempoMap::use()) {
|
if (current_map != Temporal::TempoMap::use()) {
|
||||||
Temporal::TempoMap::set (current_map);
|
Temporal::TempoMap::set (current_map);
|
||||||
}
|
}
|
||||||
|
@ -476,7 +476,7 @@ void
|
|||||||
Automatable::automation_run (samplepos_t start, pframes_t nframes, bool only_active)
|
Automatable::automation_run (samplepos_t start, pframes_t nframes, bool only_active)
|
||||||
{
|
{
|
||||||
if (only_active) {
|
if (only_active) {
|
||||||
std::shared_ptr<ControlList> cl = _automated_controls.reader ();
|
std::shared_ptr<ControlList const> cl = _automated_controls.reader ();
|
||||||
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||||
(*ci)->automation_run (start, nframes);
|
(*ci)->automation_run (start, nframes);
|
||||||
}
|
}
|
||||||
@ -661,7 +661,7 @@ Automatable::find_next_event (timepos_t const & start, timepos_t const & end, Ev
|
|||||||
next_event.when = start <= end ? timepos_t::max (start.time_domain()) : timepos_t (start.time_domain());
|
next_event.when = start <= end ? timepos_t::max (start.time_domain()) : timepos_t (start.time_domain());
|
||||||
|
|
||||||
if (only_active) {
|
if (only_active) {
|
||||||
std::shared_ptr<ControlList> cl = _automated_controls.reader ();
|
std::shared_ptr<ControlList const> cl = _automated_controls.reader ();
|
||||||
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||||
if ((*ci)->automation_playback()) {
|
if ((*ci)->automation_playback()) {
|
||||||
if (start <= end) {
|
if (start <= end) {
|
||||||
|
@ -246,7 +246,7 @@ Butler::thread_work ()
|
|||||||
_session.the_auditioner ()->seek_response (audition_seek);
|
_session.the_auditioner ()->seek_response (audition_seek);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = _session.get_routes ();
|
std::shared_ptr<RouteList const> rl = _session.get_routes ();
|
||||||
|
|
||||||
RouteList rl_with_auditioner = *rl;
|
RouteList rl_with_auditioner = *rl;
|
||||||
rl_with_auditioner.push_back (_session.the_auditioner ());
|
rl_with_auditioner.push_back (_session.the_auditioner ());
|
||||||
@ -336,11 +336,11 @@ Butler::thread_work ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Butler::flush_tracks_to_disk_normal (std::shared_ptr<RouteList> rl, uint32_t& errors)
|
Butler::flush_tracks_to_disk_normal (std::shared_ptr<RouteList const> rl, uint32_t& errors)
|
||||||
{
|
{
|
||||||
bool disk_work_outstanding = false;
|
bool disk_work_outstanding = false;
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin (); !transport_work_requested () && should_run && i != rl->end (); ++i) {
|
for (RouteList::const_iterator i = rl->begin (); !transport_work_requested () && should_run && i != rl->end (); ++i) {
|
||||||
// cerr << "write behind for " << (*i)->name () << endl;
|
// cerr << "write behind for " << (*i)->name () << endl;
|
||||||
|
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
||||||
|
@ -219,7 +219,7 @@ DiskReader::buffer_load () const
|
|||||||
* are so low compared to audio, just use the audio value here.
|
* are so low compared to audio, just use the audio value here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
if (c->empty ()) {
|
if (c->empty ()) {
|
||||||
/* no channels, so no buffers, so completely full and ready to playback, sir! */
|
/* no channels, so no buffers, so completely full and ready to playback, sir! */
|
||||||
@ -233,10 +233,10 @@ DiskReader::buffer_load () const
|
|||||||
void
|
void
|
||||||
DiskReader::adjust_buffering ()
|
DiskReader::adjust_buffering ()
|
||||||
{
|
{
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
(*chan)->resize (_session.butler ()->audio_playback_buffer_size ());
|
chan->resize (_session.butler ()->audio_playback_buffer_size ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,13 +273,13 @@ DiskReader::use_playlist (DataType dt, std::shared_ptr<Playlist> playlist)
|
|||||||
void
|
void
|
||||||
DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool result_required)
|
DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool result_required)
|
||||||
{
|
{
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
ChannelList::iterator chan;
|
ChannelList::const_iterator chan;
|
||||||
sampleoffset_t disk_samples_to_consume;
|
sampleoffset_t disk_samples_to_consume;
|
||||||
MonitorState ms = _track.monitoring_state ();
|
MonitorState ms = _track.monitoring_state ();
|
||||||
const bool midi_only = (c->empty() || !_playlists[DataType::AUDIO]);
|
const bool midi_only = (c->empty() || !_playlists[DataType::AUDIO]);
|
||||||
bool no_disk_output = _no_disk_output.load () != 0;
|
bool no_disk_output = _no_disk_output.load () != 0;
|
||||||
|
|
||||||
if (!check_active()) {
|
if (!check_active()) {
|
||||||
return;
|
return;
|
||||||
@ -358,9 +358,9 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||||||
/* no need for actual disk data, just advance read pointer */
|
/* no need for actual disk data, just advance read pointer */
|
||||||
|
|
||||||
if (!still_locating || no_disk_output) {
|
if (!still_locating || no_disk_output) {
|
||||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
assert ((*chan)->rbuf);
|
assert (chan->rbuf);
|
||||||
(*chan)->rbuf->increment_read_ptr (disk_samples_to_consume);
|
chan->rbuf->increment_read_ptr (disk_samples_to_consume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ DiskReader::declick_in_progress () const
|
|||||||
void
|
void
|
||||||
DiskReader::configuration_changed ()
|
DiskReader::configuration_changed ()
|
||||||
{
|
{
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
if (!c->empty ()) {
|
if (!c->empty ()) {
|
||||||
ReaderChannelInfo* chaninfo = dynamic_cast<ReaderChannelInfo*> (c->front ());
|
ReaderChannelInfo* chaninfo = dynamic_cast<ReaderChannelInfo*> (c->front ());
|
||||||
if (!chaninfo->initialized) {
|
if (!chaninfo->initialized) {
|
||||||
@ -553,7 +553,7 @@ DiskReader::pending_overwrite () const
|
|||||||
void
|
void
|
||||||
DiskReader::set_pending_overwrite (OverwriteReason why)
|
DiskReader::set_pending_overwrite (OverwriteReason why)
|
||||||
{
|
{
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
|
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
|
||||||
|
|
||||||
@ -567,7 +567,7 @@ DiskReader::set_pending_overwrite (OverwriteReason why)
|
|||||||
* ::refill_audio() and ::overwrite_existing_audio() expect
|
* ::refill_audio() and ::overwrite_existing_audio() expect
|
||||||
* that read-pointers and fill_level of all buffers are in sync.
|
* that read-pointers and fill_level of all buffers are in sync.
|
||||||
*/
|
*/
|
||||||
ChannelList::iterator chan = c->begin ();
|
ChannelList::const_iterator chan = c->begin ();
|
||||||
for (++chan; chan != c->end (); ++chan) {
|
for (++chan; chan != c->end (); ++chan) {
|
||||||
ReaderChannelInfo* chaninfo = dynamic_cast<ReaderChannelInfo*> (*chan);
|
ReaderChannelInfo* chaninfo = dynamic_cast<ReaderChannelInfo*> (*chan);
|
||||||
if (!chaninfo->initialized) {
|
if (!chaninfo->initialized) {
|
||||||
@ -678,7 +678,7 @@ DiskReader::overwrite_existing_audio ()
|
|||||||
* simply replace the contents of the buffer.
|
* simply replace the contents of the buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
if (c->empty ()) {
|
if (c->empty ()) {
|
||||||
return true;
|
return true;
|
||||||
@ -716,10 +716,10 @@ DiskReader::overwrite_existing_audio ()
|
|||||||
bool ret = true;
|
bool ret = true;
|
||||||
samplepos_t start;
|
samplepos_t start;
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan, ++n) {
|
for (auto const& chan : *c) {
|
||||||
|
|
||||||
Sample* buf = (*chan)->rbuf->buffer ();
|
Sample* buf = chan->rbuf->buffer ();
|
||||||
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (*chan);
|
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (chan);
|
||||||
|
|
||||||
/* Note that @p start is passed by reference and will be
|
/* Note that @p start is passed by reference and will be
|
||||||
* updated by the ::audio_read() call
|
* updated by the ::audio_read() call
|
||||||
@ -744,8 +744,8 @@ DiskReader::overwrite_existing_audio ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!rci->initialized) {
|
if (!rci->initialized) {
|
||||||
DEBUG_TRACE (DEBUG::DiskIO, string_compose ("Init ReaderChannel '%1' overwriting at: %2, avail: %3\n", name (), overwrite_sample, (*chan)->rbuf->read_space ()));
|
DEBUG_TRACE (DEBUG::DiskIO, string_compose ("Init ReaderChannel '%1' overwriting at: %2, avail: %3\n", name (), overwrite_sample, chan->rbuf->read_space ()));
|
||||||
if ((*chan)->rbuf->read_space () > 0) {
|
if (chan->rbuf->read_space () > 0) {
|
||||||
rci->initialized = true;
|
rci->initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -818,7 +818,7 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||||||
const bool read_reversed = !_session.transport_will_roll_forwards ();
|
const bool read_reversed = !_session.transport_will_roll_forwards ();
|
||||||
const bool read_loop = (bool)_loop_location;
|
const bool read_loop = (bool)_loop_location;
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
if (c->empty ()) {
|
if (c->empty ()) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -853,9 +853,9 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
(*chan)->rbuf->reset ();
|
chan->rbuf->reset ();
|
||||||
assert ((*chan)->rbuf->reserved_size () == 0);
|
assert (chan->rbuf->reserved_size () == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move the intended read target, so that after the refill is done,
|
/* move the intended read target, so that after the refill is done,
|
||||||
@ -907,8 +907,8 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||||||
|
|
||||||
shift = abs (shift);
|
shift = abs (shift);
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
(*chan)->rbuf->increment_read_ptr (shift);
|
chan->rbuf->increment_read_ptr (shift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -920,11 +920,10 @@ DiskReader::can_internal_playback_seek (sampleoffset_t distance)
|
|||||||
{
|
{
|
||||||
/* 1. Audio */
|
/* 1. Audio */
|
||||||
|
|
||||||
ChannelList::iterator chan;
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
|
||||||
|
|
||||||
for (chan = c->begin (); chan != c->end (); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
if (!(*chan)->rbuf->can_seek (distance)) {
|
if (!chan->rbuf->can_seek (distance)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -943,13 +942,12 @@ DiskReader::internal_playback_seek (sampleoffset_t distance)
|
|||||||
|
|
||||||
sampleoffset_t off = distance;
|
sampleoffset_t off = distance;
|
||||||
|
|
||||||
ChannelList::iterator chan;
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
for (auto const& chan : *c) {
|
||||||
for (chan = c->begin (); chan != c->end (); ++chan) {
|
|
||||||
if (distance < 0) {
|
if (distance < 0) {
|
||||||
off = 0 - (sampleoffset_t) (*chan)->rbuf->decrement_read_ptr (::llabs (distance));
|
off = 0 - (sampleoffset_t) chan->rbuf->decrement_read_ptr (::llabs (distance));
|
||||||
} else {
|
} else {
|
||||||
off = (*chan)->rbuf->increment_read_ptr (distance);
|
off = chan->rbuf->increment_read_ptr (distance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1159,11 +1157,11 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
samplecnt_t zero_fill;
|
samplecnt_t zero_fill;
|
||||||
uint32_t chan_n;
|
uint32_t chan_n;
|
||||||
ChannelList::iterator i;
|
ChannelList::const_iterator i;
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
_last_read_reversed = reversed;
|
_last_read_reversed = reversed;
|
||||||
|
|
||||||
@ -1936,7 +1934,7 @@ DiskReader::setup_preloop_buffer ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
|
|
||||||
if (c->empty () || !_playlists[DataType::AUDIO]) {
|
if (c->empty () || !_playlists[DataType::AUDIO]) {
|
||||||
return;
|
return;
|
||||||
@ -1950,8 +1948,8 @@ DiskReader::setup_preloop_buffer ()
|
|||||||
|
|
||||||
uint32_t channel = 0;
|
uint32_t channel = 0;
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan, ++channel) {
|
for (auto const& chan : *c) {
|
||||||
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (*chan);
|
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (chan);
|
||||||
|
|
||||||
rci->resize_preloop (loop_fade_length);
|
rci->resize_preloop (loop_fade_length);
|
||||||
|
|
||||||
@ -1960,5 +1958,6 @@ DiskReader::setup_preloop_buffer ()
|
|||||||
} else {
|
} else {
|
||||||
memset (rci->pre_loop_buffer, 0, sizeof (Sample) * loop_fade_length);
|
memset (rci->pre_loop_buffer, 0, sizeof (Sample) * loop_fade_length);
|
||||||
}
|
}
|
||||||
|
++channel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,10 +75,10 @@ DiskWriter::~DiskWriter ()
|
|||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Destruction, string_compose ("DiskWriter %1 @ %2 deleted\n", _name, this));
|
DEBUG_TRACE (DEBUG::Destruction, string_compose ("DiskWriter %1 @ %2 deleted\n", _name, this));
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
for (auto const& chaninfo : *c) {
|
||||||
(*chan)->write_source.reset ();
|
chaninfo->write_source.reset ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,9 +429,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t n;
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
|
||||||
ChannelList::iterator chan;
|
|
||||||
|
|
||||||
samplecnt_t rec_offset = 0;
|
samplecnt_t rec_offset = 0;
|
||||||
samplecnt_t rec_nframes = 0;
|
samplecnt_t rec_nframes = 0;
|
||||||
@ -521,8 +519,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||||||
/* when enabling record while already looping,
|
/* when enabling record while already looping,
|
||||||
* zero fill region back to loop-start.
|
* zero fill region back to loop-start.
|
||||||
*/
|
*/
|
||||||
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
|
for (auto const& chaninfo : *c) {
|
||||||
ChannelInfo* chaninfo (*chan);
|
|
||||||
for (samplecnt_t s = 0; s < _capture_captured; ++s) {
|
for (samplecnt_t s = 0; s < _capture_captured; ++s) {
|
||||||
chaninfo->wbuf->write_one (0); // TODO: optimize
|
chaninfo->wbuf->write_one (0); // TODO: optimize
|
||||||
}
|
}
|
||||||
@ -571,10 +568,10 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||||||
|
|
||||||
const size_t n_buffers = bufs.count().n_audio();
|
const size_t n_buffers = bufs.count().n_audio();
|
||||||
|
|
||||||
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
|
uint32_t n = 0;
|
||||||
|
for (auto const& chaninfo : *c) {
|
||||||
ChannelInfo* chaninfo (*chan);
|
|
||||||
AudioBuffer& buf (bufs.get_audio (n%n_buffers));
|
AudioBuffer& buf (bufs.get_audio (n%n_buffers));
|
||||||
|
++n;
|
||||||
|
|
||||||
chaninfo->wbuf->get_write_vector (&chaninfo->rw_vector);
|
chaninfo->wbuf->get_write_vector (&chaninfo->rw_vector);
|
||||||
|
|
||||||
@ -745,7 +742,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DiskWriter::finish_capture (std::shared_ptr<ChannelList> c)
|
DiskWriter::finish_capture (std::shared_ptr<ChannelList const> c)
|
||||||
{
|
{
|
||||||
_was_recording = false;
|
_was_recording = false;
|
||||||
_xrun_flag = false;
|
_xrun_flag = false;
|
||||||
@ -859,14 +856,14 @@ DiskWriter::prep_record_enable ()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
capturing_sources.clear ();
|
capturing_sources.clear ();
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
capturing_sources.push_back ((*chan)->write_source);
|
capturing_sources.push_back (chan->write_source);
|
||||||
Source::WriterLock lock ((*chan)->write_source->mutex());
|
Source::WriterLock lock (chan->write_source->mutex());
|
||||||
(*chan)->write_source->mark_streaming_write_started (lock);
|
chan->write_source->mark_streaming_write_started (lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -882,7 +879,7 @@ DiskWriter::prep_record_disable ()
|
|||||||
float
|
float
|
||||||
DiskWriter::buffer_load () const
|
DiskWriter::buffer_load () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
if (c->empty ()) {
|
if (c->empty ()) {
|
||||||
return 1.0;
|
return 1.0;
|
||||||
@ -921,8 +918,8 @@ void
|
|||||||
DiskWriter::reset_capture ()
|
DiskWriter::reset_capture ()
|
||||||
{
|
{
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
ChannelList::iterator chan;
|
ChannelList::const_iterator chan;
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
|
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
|
||||||
(*chan)->wbuf->reset ();
|
(*chan)->wbuf->reset ();
|
||||||
@ -947,10 +944,10 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
|
|||||||
vector.buf[0] = 0;
|
vector.buf[0] = 0;
|
||||||
vector.buf[1] = 0;
|
vector.buf[1] = 0;
|
||||||
|
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
|
|
||||||
(*chan)->wbuf->get_read_vector (&vector);
|
chan->wbuf->get_read_vector (&vector);
|
||||||
|
|
||||||
total = vector.len[0] + vector.len[1];
|
total = vector.len[0] + vector.len[1];
|
||||||
|
|
||||||
@ -975,13 +972,13 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
|
|||||||
|
|
||||||
to_write = min (_chunk_samples, (samplecnt_t) vector.len[0]);
|
to_write = min (_chunk_samples, (samplecnt_t) vector.len[0]);
|
||||||
|
|
||||||
if ((!(*chan)->write_source) || (*chan)->write_source->write (vector.buf[0], to_write) != to_write) {
|
if ((!chan->write_source) || chan->write_source->write (vector.buf[0], to_write) != to_write) {
|
||||||
error << string_compose(_("AudioDiskstream %1: cannot write to disk"), id()) << endmsg;
|
error << string_compose(_("AudioDiskstream %1: cannot write to disk"), id()) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*chan)->wbuf->increment_read_ptr (to_write);
|
chan->wbuf->increment_read_ptr (to_write);
|
||||||
(*chan)->curr_capture_cnt += to_write;
|
chan->curr_capture_cnt += to_write;
|
||||||
|
|
||||||
if ((to_write == vector.len[0]) && (total > to_write) && (to_write < _chunk_samples)) {
|
if ((to_write == vector.len[0]) && (total > to_write) && (to_write < _chunk_samples)) {
|
||||||
|
|
||||||
@ -994,13 +991,13 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
|
|||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 additional write of %2\n", name(), to_write));
|
DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 additional write of %2\n", name(), to_write));
|
||||||
|
|
||||||
if ((*chan)->write_source->write (vector.buf[1], to_write) != to_write) {
|
if (chan->write_source->write (vector.buf[1], to_write) != to_write) {
|
||||||
error << string_compose(_("AudioDiskstream %1: cannot write to disk"), id()) << endmsg;
|
error << string_compose(_("AudioDiskstream %1: cannot write to disk"), id()) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*chan)->wbuf->increment_read_ptr (to_write);
|
chan->wbuf->increment_read_ptr (to_write);
|
||||||
(*chan)->curr_capture_cnt += to_write;
|
chan->curr_capture_cnt += to_write;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1056,9 +1053,8 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
|
|||||||
void
|
void
|
||||||
DiskWriter::reset_write_sources (bool mark_write_complete, bool /*force*/)
|
DiskWriter::reset_write_sources (bool mark_write_complete, bool /*force*/)
|
||||||
{
|
{
|
||||||
ChannelList::iterator chan;
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
uint32_t n = 0;
|
||||||
uint32_t n;
|
|
||||||
|
|
||||||
if (!_session.writable() || !recordable()) {
|
if (!_session.writable() || !recordable()) {
|
||||||
return;
|
return;
|
||||||
@ -1066,28 +1062,28 @@ DiskWriter::reset_write_sources (bool mark_write_complete, bool /*force*/)
|
|||||||
|
|
||||||
capturing_sources.clear ();
|
capturing_sources.clear ();
|
||||||
|
|
||||||
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
|
for (auto const chan : *c) {
|
||||||
|
|
||||||
if ((*chan)->write_source) {
|
if (chan->write_source) {
|
||||||
|
|
||||||
if (mark_write_complete) {
|
if (mark_write_complete) {
|
||||||
Source::WriterLock lock((*chan)->write_source->mutex());
|
Source::WriterLock lock(chan->write_source->mutex());
|
||||||
(*chan)->write_source->mark_streaming_write_completed (lock);
|
chan->write_source->mark_streaming_write_completed (lock);
|
||||||
(*chan)->write_source->done_with_peakfile_writes ();
|
chan->write_source->done_with_peakfile_writes ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*chan)->write_source->removable()) {
|
if (chan->write_source->removable()) {
|
||||||
(*chan)->write_source->mark_for_remove ();
|
chan->write_source->mark_for_remove ();
|
||||||
(*chan)->write_source->drop_references ();
|
chan->write_source->drop_references ();
|
||||||
}
|
}
|
||||||
|
|
||||||
(*chan)->write_source.reset ();
|
chan->write_source.reset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
use_new_write_source (DataType::AUDIO, n);
|
use_new_write_source (DataType::AUDIO, n++);
|
||||||
|
|
||||||
if (record_enabled()) {
|
if (record_enabled()) {
|
||||||
capturing_sources.push_back ((*chan)->write_source);
|
capturing_sources.push_back (chan->write_source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1130,7 +1126,7 @@ DiskWriter::use_new_write_source (DataType dt, uint32_t n)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
if (n >= c->size()) {
|
if (n >= c->size()) {
|
||||||
error << string_compose (_("AudioDiskstream: channel %1 out of range"), n) << endmsg;
|
error << string_compose (_("AudioDiskstream: channel %1 out of range"), n) << endmsg;
|
||||||
@ -1165,8 +1161,8 @@ DiskWriter::transport_stopped_wallclock (struct tm& when, time_t twhen, bool abo
|
|||||||
int err = 0;
|
int err = 0;
|
||||||
SourceList audio_srcs;
|
SourceList audio_srcs;
|
||||||
SourceList midi_srcs;
|
SourceList midi_srcs;
|
||||||
ChannelList::iterator chan;
|
ChannelList::const_iterator chan;
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
uint32_t n = 0;
|
uint32_t n = 0;
|
||||||
bool mark_write_completed = false;
|
bool mark_write_completed = false;
|
||||||
|
|
||||||
@ -1199,13 +1195,13 @@ DiskWriter::transport_stopped_wallclock (struct tm& when, time_t twhen, bool abo
|
|||||||
if (abort_capture) {
|
if (abort_capture) {
|
||||||
_xruns.clear ();
|
_xruns.clear ();
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
for (auto const& chan : *c) {
|
||||||
|
|
||||||
if ((*chan)->write_source) {
|
if (chan->write_source) {
|
||||||
|
|
||||||
(*chan)->write_source->mark_for_remove ();
|
chan->write_source->mark_for_remove ();
|
||||||
(*chan)->write_source->drop_references ();
|
chan->write_source->drop_references ();
|
||||||
(*chan)->write_source.reset ();
|
chan->write_source.reset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* new source set up in "out" below */
|
/* new source set up in "out" below */
|
||||||
@ -1331,7 +1327,7 @@ DiskWriter::loop (samplepos_t transport_sample)
|
|||||||
_transport_looped = false;
|
_transport_looped = false;
|
||||||
if (_was_recording) {
|
if (_was_recording) {
|
||||||
// all we need to do is finish this capture, with modified capture length
|
// all we need to do is finish this capture, with modified capture length
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
finish_capture (c);
|
finish_capture (c);
|
||||||
|
|
||||||
@ -1359,10 +1355,10 @@ DiskWriter::loop (samplepos_t transport_sample)
|
|||||||
void
|
void
|
||||||
DiskWriter::adjust_buffering ()
|
DiskWriter::adjust_buffering ()
|
||||||
{
|
{
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
|
|
||||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
for (auto const chan : *c) {
|
||||||
(*chan)->resize (_session.butler()->audio_capture_buffer_size());
|
chan->resize (_session.butler()->audio_capture_buffer_size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1418,7 +1414,7 @@ DiskWriter::configure_io (ChanCount in, ChanCount out)
|
|||||||
{
|
{
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
{
|
{
|
||||||
std::shared_ptr<ChannelList> c = channels.reader();
|
std::shared_ptr<ChannelList const> c = channels.reader();
|
||||||
if (in.n_audio() != c->size()) {
|
if (in.n_audio() != c->size()) {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
@ -630,14 +630,16 @@ GraphChain::GraphChain (GraphNodeList const& nodelist, GraphEdges const& edges)
|
|||||||
|
|
||||||
/* Set up ni's activation set */
|
/* Set up ni's activation set */
|
||||||
if (has_output) {
|
if (has_output) {
|
||||||
std::shared_ptr<GraphActivision::ActivationMap> m (ni->_activation_set.reader ());
|
std::shared_ptr<GraphActivision::ActivationMap const> m (ni->_activation_set.reader ());
|
||||||
for (auto const& i : fed_from_r) {
|
for (auto const& i : fed_from_r) {
|
||||||
auto it = (*m)[this].insert (i);
|
auto mm = const_cast<GraphActivision::ActivationMap*> (&(*m));
|
||||||
|
auto it = (*mm)[this].insert (i);
|
||||||
assert (it.second);
|
assert (it.second);
|
||||||
|
|
||||||
/* Increment the refcount of any node that we directly feed */
|
/* Increment the refcount of any node that we directly feed */
|
||||||
std::shared_ptr<GraphActivision::RefCntMap> a ((*it.first)->_init_refcount.reader ());
|
std::shared_ptr<GraphActivision::RefCntMap const> a ((*it.first)->_init_refcount.reader ());
|
||||||
(*a)[this] += 1;
|
auto aa = const_cast<GraphActivision::RefCntMap*> (&(*a));
|
||||||
|
(*aa)[this] += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,14 +35,14 @@ GraphActivision::GraphActivision ()
|
|||||||
node_set_t const&
|
node_set_t const&
|
||||||
GraphActivision::activation_set (GraphChain const* const g) const
|
GraphActivision::activation_set (GraphChain const* const g) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<ActivationMap> m (_activation_set.reader ());
|
std::shared_ptr<ActivationMap const> m (_activation_set.reader ());
|
||||||
return m->at (g);
|
return m->at (g);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
GraphActivision::init_refcount (GraphChain const* const g) const
|
GraphActivision::init_refcount (GraphChain const* const g) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RefCntMap> m (_init_refcount.reader ());
|
std::shared_ptr<RefCntMap const> m (_init_refcount.reader ());
|
||||||
return m->at (g);
|
return m->at (g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,17 +105,17 @@ InternalSend::propagate_solo ()
|
|||||||
_send_to->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
|
_send_to->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
|
||||||
}
|
}
|
||||||
/* propagate further downstream alike Route::input_change_handler() */
|
/* propagate further downstream alike Route::input_change_handler() */
|
||||||
std::shared_ptr<RouteList> routes = _session.get_routes ();
|
std::shared_ptr<RouteList const> routes = _session.get_routes ();
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
if ((*i) == _send_to || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
|
if (i == _send_to || i->is_master() || i->is_monitor() || i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bool does_feed = _send_to->feeds (*i);
|
bool does_feed = _send_to->feeds (i);
|
||||||
if (does_feed && to_soloed_upstream) {
|
if (does_feed && to_soloed_upstream) {
|
||||||
(*i)->solo_control()->mod_solo_by_others_upstream (-1);
|
i->solo_control()->mod_solo_by_others_upstream (-1);
|
||||||
}
|
}
|
||||||
if (does_feed && to_isolated_upstream) {
|
if (does_feed && to_isolated_upstream) {
|
||||||
(*i)->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
|
i->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,13 +123,13 @@ InternalSend::propagate_solo ()
|
|||||||
_send_from->solo_control()->mod_solo_by_others_downstream (-1);
|
_send_from->solo_control()->mod_solo_by_others_downstream (-1);
|
||||||
|
|
||||||
/* propagate further upstream alike Route::output_change_handler() */
|
/* propagate further upstream alike Route::output_change_handler() */
|
||||||
std::shared_ptr<RouteList> routes = _session.get_routes ();
|
std::shared_ptr<RouteList const> routes = _session.get_routes ();
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
if (*i == _send_from || !(*i)->can_solo()) {
|
if (i == _send_from || !i->can_solo()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((*i)->feeds (_send_from)) {
|
if (i->feeds (_send_from)) {
|
||||||
(*i)->solo_control()->mod_solo_by_others_downstream (-1);
|
i->solo_control()->mod_solo_by_others_downstream (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1515,27 +1515,27 @@ IO::bundles_connected ()
|
|||||||
BundleList bundles;
|
BundleList bundles;
|
||||||
|
|
||||||
/* Session bundles */
|
/* Session bundles */
|
||||||
std::shared_ptr<ARDOUR::BundleList> b = _session.bundles ();
|
std::shared_ptr<ARDOUR::BundleList const> b = _session.bundles ();
|
||||||
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
|
for (auto const& i : *b) {
|
||||||
if ((*i)->connected_to (_bundle, _session.engine())) {
|
if (i->connected_to (_bundle, _session.engine())) {
|
||||||
bundles.push_back (*i);
|
bundles.push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Route bundles */
|
/* Route bundles */
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::RouteList> r = _session.get_routes ();
|
std::shared_ptr<ARDOUR::RouteList const> r = _session.get_routes ();
|
||||||
|
|
||||||
if (_direction == Input) {
|
if (_direction == Input) {
|
||||||
for (ARDOUR::RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->output()->bundle()->connected_to (_bundle, _session.engine())) {
|
if (i->output()->bundle()->connected_to (_bundle, _session.engine())) {
|
||||||
bundles.push_back ((*i)->output()->bundle());
|
bundles.push_back (i->output()->bundle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (ARDOUR::RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->input()->bundle()->connected_to (_bundle, _session.engine())) {
|
if (i->input()->bundle()->connected_to (_bundle, _session.engine())) {
|
||||||
bundles.push_back ((*i)->input()->bundle());
|
bundles.push_back (i->input()->bundle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -782,7 +782,6 @@ LuaBindings::common (lua_State* L)
|
|||||||
* shared_ptr<const T> and shared_ptr<T> in the same class.
|
* shared_ptr<const T> and shared_ptr<T> in the same class.
|
||||||
*/
|
*/
|
||||||
.addStaticFunction ("read", &Temporal::TempoMap::read)
|
.addStaticFunction ("read", &Temporal::TempoMap::read)
|
||||||
.addStaticFunction ("fetch_writable", &Temporal::TempoMap::fetch_writable)
|
|
||||||
.addStaticFunction ("write_copy", &Temporal::TempoMap::write_copy)
|
.addStaticFunction ("write_copy", &Temporal::TempoMap::write_copy)
|
||||||
.addStaticFunction ("update", &Temporal::TempoMap::update)
|
.addStaticFunction ("update", &Temporal::TempoMap::update)
|
||||||
.addStaticFunction ("abort_update", &Temporal::TempoMap::abort_update)
|
.addStaticFunction ("abort_update", &Temporal::TempoMap::abort_update)
|
||||||
|
@ -84,14 +84,14 @@ MonitorPort::monitor (PortEngine& e, pframes_t n_samples)
|
|||||||
memset (_input, 0, sizeof (Sample) * _insize);
|
memset (_input, 0, sizeof (Sample) * _insize);
|
||||||
_silent = true;
|
_silent = true;
|
||||||
}
|
}
|
||||||
std::shared_ptr<MonitorPorts> cycle_ports = _monitor_ports.reader ();
|
std::shared_ptr<MonitorPorts const> cycle_ports = _monitor_ports.reader ();
|
||||||
|
|
||||||
for (MonitorPorts::iterator i = cycle_ports->begin (); i != cycle_ports->end(); ++i) {
|
for (auto const& i : *cycle_ports) {
|
||||||
if (i->second->remove && i->second->gain == 0) {
|
if (i.second->remove && i.second->gain == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
PortEngine::PortHandle ph = e.get_port_by_name (i->first);
|
PortEngine::PortHandle ph = e.get_port_by_name (i.first);
|
||||||
if (!ph) {
|
if (!ph) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ MonitorPort::monitor (PortEngine& e, pframes_t n_samples)
|
|||||||
if (!buf) {
|
if (!buf) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
collect (i->second, buf, n_samples, i->first);
|
collect (i.second, buf, n_samples, i.first);
|
||||||
}
|
}
|
||||||
finalize (n_samples);
|
finalize (n_samples);
|
||||||
}
|
}
|
||||||
@ -183,16 +183,16 @@ MonitorPort::get_audio_buffer (pframes_t n_samples)
|
|||||||
bool
|
bool
|
||||||
MonitorPort::monitoring (std::string const& pn) const
|
MonitorPort::monitoring (std::string const& pn) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<MonitorPorts> mp = _monitor_ports.reader ();
|
std::shared_ptr<MonitorPorts const> mp = _monitor_ports.reader ();
|
||||||
if (pn.empty ()) {
|
if (pn.empty ()) {
|
||||||
for (MonitorPorts::iterator i = mp->begin (); i != mp->end(); ++i) {
|
for (auto const& i : *mp) {
|
||||||
if (!i->second->remove) {
|
if (!i.second->remove) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
MonitorPorts::iterator i = mp->find (pn);
|
MonitorPorts::const_iterator i = mp->find (pn);
|
||||||
if (i == mp->end ()) {
|
if (i == mp->end ()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -202,12 +202,12 @@ MonitorPort::monitoring (std::string const& pn) const
|
|||||||
void
|
void
|
||||||
MonitorPort::active_monitors (std::list<std::string>& portlist) const
|
MonitorPort::active_monitors (std::list<std::string>& portlist) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<MonitorPorts> mp = _monitor_ports.reader ();
|
std::shared_ptr<MonitorPorts const> mp = _monitor_ports.reader ();
|
||||||
for (MonitorPorts::iterator i = mp->begin (); i != mp->end(); ++i) {
|
for (auto const& i : *mp) {
|
||||||
if (i->second->remove) {
|
if (i.second->remove) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
portlist.push_back (i->first);
|
portlist.push_back (i.first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ MonitorPort::clear_ports (bool instantly)
|
|||||||
mp->swap (copy);
|
mp->swap (copy);
|
||||||
assert (mp->empty ());
|
assert (mp->empty ());
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<MonitorPorts> mp = _monitor_ports.reader ();
|
std::shared_ptr<MonitorPorts const> mp = _monitor_ports.reader ();
|
||||||
copy = *mp;
|
copy = *mp;
|
||||||
for (MonitorPorts::iterator i = copy.begin (); i != copy.end(); ++i) {
|
for (MonitorPorts::iterator i = copy.begin (); i != copy.end(); ++i) {
|
||||||
i->second->remove = true;
|
i->second->remove = true;
|
||||||
|
@ -923,7 +923,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, samplepos_t start, samplepos_t e
|
|||||||
bufs.set_count(ChanCount::max(bufs.count(), _configured_out));
|
bufs.set_count(ChanCount::max(bufs.count(), _configured_out));
|
||||||
|
|
||||||
if (with_auto) {
|
if (with_auto) {
|
||||||
std::shared_ptr<ControlList> cl = _automated_controls.reader ();
|
std::shared_ptr<ControlList const> cl = _automated_controls.reader ();
|
||||||
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||||
AutomationControl& c = *(ci->get());
|
AutomationControl& c = *(ci->get());
|
||||||
std::shared_ptr<const Evoral::ControlList> clist (c.list());
|
std::shared_ptr<const Evoral::ControlList> clist (c.list());
|
||||||
|
@ -296,10 +296,9 @@ PortEngineSharedImpl::get_ports (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<PortIndex> p = _ports.reader ();
|
std::shared_ptr<PortIndex const> p = _ports.reader ();
|
||||||
|
|
||||||
for (PortIndex::const_iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& port : *p) {
|
||||||
BackendPortPtr port = *i;
|
|
||||||
if ((port->type () == type) && flags == (port->flags () & flags)) {
|
if ((port->type () == type) && flags == (port->flags () & flags)) {
|
||||||
if (!use_regexp || !regexec (&port_regex, port->name ().c_str (), 0, NULL, 0)) {
|
if (!use_regexp || !regexec (&port_regex, port->name ().c_str (), 0, NULL, 0)) {
|
||||||
port_names.push_back (port->name ());
|
port_names.push_back (port->name ());
|
||||||
@ -328,10 +327,9 @@ PortEngineSharedImpl::port_is_physical (PortEngine::PortHandle port) const
|
|||||||
void
|
void
|
||||||
PortEngineSharedImpl::get_physical_outputs (DataType type, std::vector<std::string>& port_names)
|
PortEngineSharedImpl::get_physical_outputs (DataType type, std::vector<std::string>& port_names)
|
||||||
{
|
{
|
||||||
std::shared_ptr<PortIndex> p = _ports.reader();
|
std::shared_ptr<PortIndex const> p = _ports.reader();
|
||||||
|
|
||||||
for (PortIndex::iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& port : *p) {
|
||||||
BackendPortPtr port = *i;
|
|
||||||
if ((port->type () == type) && port->is_input () && port->is_physical ()) {
|
if ((port->type () == type) && port->is_input () && port->is_physical ()) {
|
||||||
port_names.push_back (port->name ());
|
port_names.push_back (port->name ());
|
||||||
}
|
}
|
||||||
@ -341,10 +339,9 @@ PortEngineSharedImpl::get_physical_outputs (DataType type, std::vector<std::stri
|
|||||||
void
|
void
|
||||||
PortEngineSharedImpl::get_physical_inputs (DataType type, std::vector<std::string>& port_names)
|
PortEngineSharedImpl::get_physical_inputs (DataType type, std::vector<std::string>& port_names)
|
||||||
{
|
{
|
||||||
std::shared_ptr<PortIndex> p = _ports.reader();
|
std::shared_ptr<PortIndex const> p = _ports.reader();
|
||||||
|
|
||||||
for (PortIndex::iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& port : *p) {
|
||||||
BackendPortPtr port = *i;
|
|
||||||
if ((port->type () == type) && port->is_output () && port->is_physical ()) {
|
if ((port->type () == type) && port->is_output () && port->is_physical ()) {
|
||||||
port_names.push_back (port->name ());
|
port_names.push_back (port->name ());
|
||||||
}
|
}
|
||||||
@ -357,10 +354,9 @@ PortEngineSharedImpl::n_physical_outputs () const
|
|||||||
int n_midi = 0;
|
int n_midi = 0;
|
||||||
int n_audio = 0;
|
int n_audio = 0;
|
||||||
|
|
||||||
std::shared_ptr<PortIndex> p = _ports.reader();
|
std::shared_ptr<PortIndex const> p = _ports.reader();
|
||||||
|
|
||||||
for (PortIndex::const_iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& port : *p) {
|
||||||
BackendPortPtr port = *i;
|
|
||||||
if (port->is_output () && port->is_physical ()) {
|
if (port->is_output () && port->is_physical ()) {
|
||||||
switch (port->type ()) {
|
switch (port->type ()) {
|
||||||
case DataType::AUDIO: ++n_audio; break;
|
case DataType::AUDIO: ++n_audio; break;
|
||||||
@ -381,10 +377,9 @@ PortEngineSharedImpl::n_physical_inputs () const
|
|||||||
int n_midi = 0;
|
int n_midi = 0;
|
||||||
int n_audio = 0;
|
int n_audio = 0;
|
||||||
|
|
||||||
std::shared_ptr<PortIndex> p = _ports.reader();
|
std::shared_ptr<PortIndex const> p = _ports.reader();
|
||||||
|
|
||||||
for (PortIndex::const_iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& port : *p) {
|
||||||
BackendPortPtr port = *i;
|
|
||||||
if (port->is_input () && port->is_physical ()) {
|
if (port->is_input () && port->is_physical ()) {
|
||||||
switch (port->type ()) {
|
switch (port->type ()) {
|
||||||
case DataType::AUDIO: ++n_audio; break;
|
case DataType::AUDIO: ++n_audio; break;
|
||||||
@ -831,9 +826,9 @@ PortEngineSharedImpl::update_system_port_latencies ()
|
|||||||
void
|
void
|
||||||
PortEngineSharedImpl::list_ports () const
|
PortEngineSharedImpl::list_ports () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<PortIndex> p = _ports.reader ();
|
std::shared_ptr<PortIndex const> p = _ports.reader ();
|
||||||
for (PortIndex::const_iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& port : *p) {
|
||||||
std::cout << (*i)->name () << "\n";
|
std::cout << port->name () << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -494,9 +494,9 @@ PortManager::get_port_by_name (const string& portname)
|
|||||||
return std::shared_ptr<Port> ();
|
return std::shared_ptr<Port> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Ports> pr = _ports.reader ();
|
std::shared_ptr<Ports const> pr = _ports.reader ();
|
||||||
std::string rel = make_port_name_relative (portname);
|
std::string rel = make_port_name_relative (portname);
|
||||||
Ports::iterator x = pr->find (rel);
|
Ports::const_iterator x = pr->find (rel);
|
||||||
|
|
||||||
if (x != pr->end ()) {
|
if (x != pr->end ()) {
|
||||||
/* its possible that the port was renamed by some 3rd party and
|
/* its possible that the port was renamed by some 3rd party and
|
||||||
@ -531,10 +531,10 @@ PortManager::port_renamed (const std::string& old_relative_name, const std::stri
|
|||||||
int
|
int
|
||||||
PortManager::get_ports (DataType type, PortList& pl)
|
PortManager::get_ports (DataType type, PortList& pl)
|
||||||
{
|
{
|
||||||
std::shared_ptr<Ports> plist = _ports.reader ();
|
std::shared_ptr<Ports const> plist = _ports.reader ();
|
||||||
for (Ports::iterator p = plist->begin (); p != plist->end (); ++p) {
|
for (auto const& p : *plist) {
|
||||||
if (p->second->type () == type) {
|
if (p.second->type () == type) {
|
||||||
pl.push_back (p->second);
|
pl.push_back (p.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pl.size ();
|
return pl.size ();
|
||||||
@ -821,9 +821,10 @@ PortManager::disconnect (std::string const& name)
|
|||||||
int
|
int
|
||||||
PortManager::reestablish_ports ()
|
PortManager::reestablish_ports ()
|
||||||
{
|
{
|
||||||
Ports::iterator i;
|
_midi_info_dirty = true;
|
||||||
_midi_info_dirty = true;
|
|
||||||
std::shared_ptr<Ports> p = _ports.reader ();
|
Ports::const_iterator i;
|
||||||
|
std::shared_ptr<Ports const> p = _ports.reader ();
|
||||||
DEBUG_TRACE (DEBUG::Ports, string_compose ("reestablish %1 ports\n", p->size ()));
|
DEBUG_TRACE (DEBUG::Ports, string_compose ("reestablish %1 ports\n", p->size ()));
|
||||||
|
|
||||||
for (i = p->begin (); i != p->end (); ++i) {
|
for (i = p->begin (); i != p->end (); ++i) {
|
||||||
@ -891,15 +892,15 @@ PortManager::set_pretty_names (std::vector<std::string> const& port_names, DataT
|
|||||||
int
|
int
|
||||||
PortManager::reconnect_ports ()
|
PortManager::reconnect_ports ()
|
||||||
{
|
{
|
||||||
std::shared_ptr<Ports> p = _ports.reader ();
|
std::shared_ptr<Ports const> p = _ports.reader ();
|
||||||
|
|
||||||
/* re-establish connections */
|
/* re-establish connections */
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size ()));
|
DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size ()));
|
||||||
|
|
||||||
for (Ports::iterator i = p->begin (); i != p->end (); ++i) {
|
for (auto const& i : *p) {
|
||||||
if (i->second->reconnect ()) {
|
if (i.second->reconnect ()) {
|
||||||
PortConnectedOrDisconnected (i->second, i->first, std::weak_ptr<Port> (), "", false);
|
PortConnectedOrDisconnected (i.second, i.first, std::weak_ptr<Port> (), "", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -926,10 +927,10 @@ PortManager::connect_callback (const string& a, const string& b, bool conn)
|
|||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::BackendCallbacks, string_compose (X_("connect callback %1 + %2 connected ? %3\n"), a, b, conn));
|
DEBUG_TRACE (DEBUG::BackendCallbacks, string_compose (X_("connect callback %1 + %2 connected ? %3\n"), a, b, conn));
|
||||||
|
|
||||||
std::shared_ptr<Port> port_a;
|
std::shared_ptr<Port> port_a;
|
||||||
std::shared_ptr<Port> port_b;
|
std::shared_ptr<Port> port_b;
|
||||||
Ports::iterator x;
|
Ports::const_iterator x;
|
||||||
std::shared_ptr<Ports> pr = _ports.reader ();
|
std::shared_ptr<Ports const> pr = _ports.reader ();
|
||||||
|
|
||||||
x = pr->find (make_port_name_relative (a));
|
x = pr->find (make_port_name_relative (a));
|
||||||
if (x != pr->end ()) {
|
if (x != pr->end ()) {
|
||||||
@ -1021,7 +1022,7 @@ PortManager::update_input_ports (bool clear)
|
|||||||
new_midi = midi_ports;
|
new_midi = midi_ports;
|
||||||
_monitor_port.clear_ports (true);
|
_monitor_port.clear_ports (true);
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<AudioInputPorts> aip = _audio_input_ports.reader ();
|
std::shared_ptr<AudioInputPorts const> aip = _audio_input_ports.reader ();
|
||||||
/* find new audio ports */
|
/* find new audio ports */
|
||||||
for (std::vector<std::string>::iterator p = audio_ports.begin (); p != audio_ports.end (); ++p) {
|
for (std::vector<std::string>::iterator p = audio_ports.begin (); p != audio_ports.end (); ++p) {
|
||||||
if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) {
|
if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) {
|
||||||
@ -1033,13 +1034,13 @@ PortManager::update_input_ports (bool clear)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* find stale audio ports */
|
/* find stale audio ports */
|
||||||
for (AudioInputPorts::iterator p = aip->begin (); p != aip->end (); ++p) {
|
for (auto const& p : *aip) {
|
||||||
if (std::find (audio_ports.begin (), audio_ports.end (), p->first) == audio_ports.end ()) {
|
if (std::find (audio_ports.begin (), audio_ports.end (), p.first) == audio_ports.end ()) {
|
||||||
old_audio.push_back (p->first);
|
old_audio.push_back (p.first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<MIDIInputPorts> mip = _midi_input_ports.reader ();
|
std::shared_ptr<MIDIInputPorts const> mip = _midi_input_ports.reader ();
|
||||||
/* find new MIDI ports */
|
/* find new MIDI ports */
|
||||||
for (std::vector<std::string>::iterator p = midi_ports.begin (); p != midi_ports.end (); ++p) {
|
for (std::vector<std::string>::iterator p = midi_ports.begin (); p != midi_ports.end (); ++p) {
|
||||||
if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) {
|
if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) {
|
||||||
@ -1056,9 +1057,9 @@ PortManager::update_input_ports (bool clear)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* find stale audio ports */
|
/* find stale audio ports */
|
||||||
for (MIDIInputPorts::iterator p = mip->begin (); p != mip->end (); ++p) {
|
for (auto const& p : *mip) {
|
||||||
if (std::find (midi_ports.begin (), midi_ports.end (), p->first) == midi_ports.end ()) {
|
if (std::find (midi_ports.begin (), midi_ports.end (), p.first) == midi_ports.end ()) {
|
||||||
old_midi.push_back (p->first);
|
old_midi.push_back (p.first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1250,17 +1251,17 @@ PortManager::cycle_start (pframes_t nframes, Session* s)
|
|||||||
tl = s->rt_tasklist ();
|
tl = s->rt_tasklist ();
|
||||||
}
|
}
|
||||||
if (tl && fabs (Port::resample_ratio ()) != 1.0) {
|
if (tl && fabs (Port::resample_ratio ()) != 1.0) {
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (!(p->second->flags () & TransportSyncPort)) {
|
if (!(p.second->flags () & TransportSyncPort)) {
|
||||||
tl->push_back (boost::bind (&Port::cycle_start, p->second, nframes));
|
tl->push_back (boost::bind (&Port::cycle_start, p.second, nframes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tl->push_back (boost::bind (&PortManager::run_input_meters, this, nframes, s ? s->nominal_sample_rate () : 0));
|
tl->push_back (boost::bind (&PortManager::run_input_meters, this, nframes, s ? s->nominal_sample_rate () : 0));
|
||||||
tl->process ();
|
tl->process ();
|
||||||
} else {
|
} else {
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (!(p->second->flags () & TransportSyncPort)) {
|
if (!(p.second->flags () & TransportSyncPort)) {
|
||||||
p->second->cycle_start (nframes);
|
p.second->cycle_start (nframes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
run_input_meters (nframes, s ? s->nominal_sample_rate () : 0);
|
run_input_meters (nframes, s ? s->nominal_sample_rate () : 0);
|
||||||
@ -1276,24 +1277,24 @@ PortManager::cycle_end (pframes_t nframes, Session* s)
|
|||||||
tl = s->rt_tasklist ();
|
tl = s->rt_tasklist ();
|
||||||
}
|
}
|
||||||
if (tl && fabs (Port::resample_ratio ()) != 1.0) {
|
if (tl && fabs (Port::resample_ratio ()) != 1.0) {
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (!(p->second->flags () & TransportSyncPort)) {
|
if (!(p.second->flags () & TransportSyncPort)) {
|
||||||
tl->push_back (boost::bind (&Port::cycle_end, p->second, nframes));
|
tl->push_back (boost::bind (&Port::cycle_end, p.second, nframes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tl->process ();
|
tl->process ();
|
||||||
} else {
|
} else {
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (!(p->second->flags () & TransportSyncPort)) {
|
if (!(p.second->flags () & TransportSyncPort)) {
|
||||||
p->second->cycle_end (nframes);
|
p.second->cycle_end (nframes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
/* AudioEngine::split_cycle flushes buffers until Port::port_offset.
|
/* AudioEngine::split_cycle flushes buffers until Port::port_offset.
|
||||||
* Now only flush remaining events (after Port::port_offset) */
|
* Now only flush remaining events (after Port::port_offset) */
|
||||||
p->second->flush_buffers (nframes * Port::resample_ratio () - Port::port_offset ());
|
p.second->flush_buffers (nframes * Port::resample_ratio () - Port::port_offset ());
|
||||||
}
|
}
|
||||||
|
|
||||||
_cycle_ports.reset ();
|
_cycle_ports.reset ();
|
||||||
@ -1304,21 +1305,21 @@ PortManager::cycle_end (pframes_t nframes, Session* s)
|
|||||||
void
|
void
|
||||||
PortManager::silence (pframes_t nframes, Session* s)
|
PortManager::silence (pframes_t nframes, Session* s)
|
||||||
{
|
{
|
||||||
for (Ports::iterator i = _cycle_ports->begin (); i != _cycle_ports->end (); ++i) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (s && i->second == s->mtc_output_port ()) {
|
if (s && p.second == s->mtc_output_port ()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (s && i->second == s->midi_clock_output_port ()) {
|
if (s && p.second == s->midi_clock_output_port ()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (s && i->second == s->ltc_output_port ()) {
|
if (s && p.second == s->ltc_output_port ()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (std::dynamic_pointer_cast<AsyncMIDIPort> (i->second)) {
|
if (std::dynamic_pointer_cast<AsyncMIDIPort> (p.second)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i->second->sends_output ()) {
|
if (p.second->sends_output ()) {
|
||||||
i->second->get_buffer (nframes).silence (nframes);
|
p.second->get_buffer (nframes).silence (nframes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1373,15 +1374,14 @@ PortManager::silence_outputs (pframes_t nframes)
|
|||||||
void
|
void
|
||||||
PortManager::check_monitoring ()
|
PortManager::check_monitoring ()
|
||||||
{
|
{
|
||||||
for (Ports::iterator i = _cycle_ports->begin (); i != _cycle_ports->end (); ++i) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
bool x;
|
bool x;
|
||||||
|
if (p.second->last_monitor () != (x = p.second->monitoring_input ())) {
|
||||||
if (i->second->last_monitor () != (x = i->second->monitoring_input ())) {
|
p.second->set_last_monitor (x);
|
||||||
i->second->set_last_monitor (x);
|
|
||||||
/* XXX I think this is dangerous, due to
|
/* XXX I think this is dangerous, due to
|
||||||
a likely mutex in the signal handlers ...
|
a likely mutex in the signal handlers ...
|
||||||
*/
|
*/
|
||||||
i->second->MonitorInputChanged (x); /* EMIT SIGNAL */
|
p.second->MonitorInputChanged (x); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1395,25 +1395,25 @@ PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t n
|
|||||||
tl = s->rt_tasklist ();
|
tl = s->rt_tasklist ();
|
||||||
}
|
}
|
||||||
if (tl && fabs (Port::resample_ratio ()) != 1.0) {
|
if (tl && fabs (Port::resample_ratio ()) != 1.0) {
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (!(p->second->flags () & TransportSyncPort)) {
|
if (!(p.second->flags () & TransportSyncPort)) {
|
||||||
tl->push_back (boost::bind (&Port::cycle_end, p->second, nframes));
|
tl->push_back (boost::bind (&Port::cycle_end, p.second, nframes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tl->process ();
|
tl->process ();
|
||||||
} else {
|
} else {
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
if (!(p->second->flags () & TransportSyncPort)) {
|
if (!(p.second->flags () & TransportSyncPort)) {
|
||||||
p->second->cycle_end (nframes);
|
p.second->cycle_end (nframes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
p->second->flush_buffers (nframes);
|
p.second->flush_buffers (nframes);
|
||||||
|
|
||||||
if (p->second->sends_output ()) {
|
if (p.second->sends_output ()) {
|
||||||
std::shared_ptr<AudioPort> ap = std::dynamic_pointer_cast<AudioPort> (p->second);
|
std::shared_ptr<AudioPort> ap = std::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;
|
||||||
@ -1867,10 +1867,9 @@ PortManager::fill_midi_port_info_locked ()
|
|||||||
void
|
void
|
||||||
PortManager::set_port_buffer_sizes (pframes_t n)
|
PortManager::set_port_buffer_sizes (pframes_t n)
|
||||||
{
|
{
|
||||||
std::shared_ptr<Ports> all = _ports.reader ();
|
std::shared_ptr<Ports const> all = _ports.reader ();
|
||||||
|
for (auto const& p : *all) {
|
||||||
for (Ports::iterator p = all->begin (); p != all->end (); ++p) {
|
p.second->set_buffer_size (n);
|
||||||
p->second->set_buffer_size (n);
|
|
||||||
}
|
}
|
||||||
_monitor_port.set_buffer_size (n);
|
_monitor_port.set_buffer_size (n);
|
||||||
}
|
}
|
||||||
@ -1878,10 +1877,10 @@ PortManager::set_port_buffer_sizes (pframes_t n)
|
|||||||
bool
|
bool
|
||||||
PortManager::check_for_ambiguous_latency (bool log) const
|
PortManager::check_for_ambiguous_latency (bool log) const
|
||||||
{
|
{
|
||||||
bool rv = false;
|
bool rv = false;
|
||||||
std::shared_ptr<Ports> plist = _ports.reader ();
|
std::shared_ptr<Ports const> plist = _ports.reader ();
|
||||||
for (Ports::iterator pi = plist->begin (); pi != plist->end (); ++pi) {
|
for (auto const& pi : *plist) {
|
||||||
std::shared_ptr<Port> const& p (pi->second);
|
std::shared_ptr<Port> const& p (pi.second);
|
||||||
/* check one to many connections */
|
/* check one to many connections */
|
||||||
if (!p->sends_output () || (p->flags () & IsTerminal) || !p->connected ()) {
|
if (!p->sends_output () || (p->flags () & IsTerminal) || !p->connected ()) {
|
||||||
continue;
|
continue;
|
||||||
@ -1916,14 +1915,14 @@ PortManager::reset_input_meters ()
|
|||||||
PortManager::AudioInputPorts
|
PortManager::AudioInputPorts
|
||||||
PortManager::audio_input_ports () const
|
PortManager::audio_input_ports () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<AudioInputPorts> p = _audio_input_ports.reader ();
|
std::shared_ptr<AudioInputPorts const> p = _audio_input_ports.reader ();
|
||||||
return *p;
|
return *p;
|
||||||
}
|
}
|
||||||
|
|
||||||
PortManager::MIDIInputPorts
|
PortManager::MIDIInputPorts
|
||||||
PortManager::midi_input_ports () const
|
PortManager::midi_input_ports () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<MIDIInputPorts> p = _midi_input_ports.reader ();
|
std::shared_ptr<MIDIInputPorts const> p = _midi_input_ports.reader ();
|
||||||
return *p;
|
return *p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1940,15 +1939,15 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate)
|
|||||||
_monitor_port.monitor (port_engine (), n_samples);
|
_monitor_port.monitor (port_engine (), n_samples);
|
||||||
|
|
||||||
/* calculate peak of all physical inputs (readable ports) */
|
/* calculate peak of all physical inputs (readable ports) */
|
||||||
std::shared_ptr<AudioInputPorts> aip = _audio_input_ports.reader ();
|
std::shared_ptr<AudioInputPorts const> aip = _audio_input_ports.reader ();
|
||||||
|
|
||||||
for (AudioInputPorts::iterator p = aip->begin (); p != aip->end (); ++p) {
|
for (auto const& p : *aip) {
|
||||||
assert (!port_is_mine (p->first));
|
assert (!port_is_mine (p.first));
|
||||||
AudioInputPort& ai (p->second);
|
AudioInputPort& ai = *const_cast<AudioInputPort*>(&p.second);
|
||||||
|
|
||||||
ai.apply_falloff (n_samples, rate, reset);
|
ai.apply_falloff (n_samples, rate, reset);
|
||||||
|
|
||||||
PortEngine::PortHandle ph = _backend->get_port_by_name (p->first);
|
PortEngine::PortHandle ph = _backend->get_port_by_name (p.first);
|
||||||
if (!ph) {
|
if (!ph) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1964,16 +1963,16 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* MIDI */
|
/* MIDI */
|
||||||
std::shared_ptr<MIDIInputPorts> mip = _midi_input_ports.reader ();
|
std::shared_ptr<MIDIInputPorts const> mip = _midi_input_ports.reader ();
|
||||||
for (MIDIInputPorts::iterator p = mip->begin (); p != mip->end (); ++p) {
|
for (auto const& p : *mip) {
|
||||||
assert (!port_is_mine (p->first));
|
assert (!port_is_mine (p.first));
|
||||||
|
|
||||||
PortEngine::PortHandle ph = _backend->get_port_by_name (p->first);
|
PortEngine::PortHandle ph = _backend->get_port_by_name (p.first);
|
||||||
if (!ph || !_backend->connected (ph)) {
|
if (!ph || !_backend->connected (ph)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
MIDIInputPort& mi (p->second);
|
MIDIInputPort& mi = *const_cast<MIDIInputPort*>(&p.second);
|
||||||
mi.apply_falloff (n_samples, rate, reset);
|
mi.apply_falloff (n_samples, rate, reset);
|
||||||
|
|
||||||
void* buffer = _backend->get_buffer (ph, n_samples);
|
void* buffer = _backend->get_buffer (ph, n_samples);
|
||||||
@ -1993,17 +1992,17 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate)
|
|||||||
void
|
void
|
||||||
PortManager::list_all_ports () const
|
PortManager::list_all_ports () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<Ports> plist = _ports.reader ();
|
std::shared_ptr<Ports const> plist = _ports.reader ();
|
||||||
for (Ports::iterator p = plist->begin (); p != plist->end (); ++p) {
|
for (auto const& p : *plist) {
|
||||||
std::cout << p->first << "\n";
|
std::cout << p.first << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PortManager::list_cycle_ports () const
|
PortManager::list_cycle_ports () const
|
||||||
{
|
{
|
||||||
for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) {
|
for (auto const& p : *_cycle_ports) {
|
||||||
std::cout << p->first << "\n";
|
std::cout << p.first << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -771,15 +771,15 @@ Route::push_solo_isolate_upstream (int32_t delta)
|
|||||||
{
|
{
|
||||||
/* forward propagate solo-isolate status to everything fed by this route, but not those via sends only */
|
/* forward propagate solo-isolate status to everything fed by this route, but not those via sends only */
|
||||||
|
|
||||||
std::shared_ptr<RouteList> routes = _session.get_routes ();
|
std::shared_ptr<RouteList const> routes = _session.get_routes ();
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
|
|
||||||
if ((*i).get() == this || !(*i)->can_solo()) {
|
if (i.get() == this || !i->can_solo()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feeds (*i)) {
|
if (feeds (i)) {
|
||||||
(*i)->solo_isolate_control()->mod_solo_isolated_by_upstream (delta);
|
i->solo_isolate_control()->mod_solo_isolated_by_upstream (delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3688,13 +3688,13 @@ Route::output_effectively_connected_real () const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* now follow connections downstream */
|
/* now follow connections downstream */
|
||||||
std::shared_ptr<RouteList> routes = _session.get_routes ();
|
std::shared_ptr<RouteList const> routes = _session.get_routes ();
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
Route* rp = (*i).get();
|
Route* rp = i.get();
|
||||||
if (rp == this) {
|
if (rp == this) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(*i)->input()->connected_to (_output)) {
|
if (!i->input()->connected_to (_output)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (_connection_cache.find (rp) != _connection_cache.end ()) {
|
if (_connection_cache.find (rp) != _connection_cache.end ()) {
|
||||||
@ -3706,7 +3706,7 @@ Route::output_effectively_connected_real () const
|
|||||||
_connection_cache[rp] = false;
|
_connection_cache[rp] = false;
|
||||||
|
|
||||||
/* recurse downstream, check connected route */
|
/* recurse downstream, check connected route */
|
||||||
bool rv = (*i)->output_effectively_connected_real ();
|
bool rv = i->output_effectively_connected_real ();
|
||||||
_connection_cache[rp] = rv;
|
_connection_cache[rp] = rv;
|
||||||
if (rv) {
|
if (rv) {
|
||||||
return true;
|
return true;
|
||||||
@ -3767,17 +3767,17 @@ Route::input_change_handler (IOChange change, void * /*src*/)
|
|||||||
if (_solo_control->soloed_by_others_upstream() || _solo_isolate_control->solo_isolated_by_upstream()) {
|
if (_solo_control->soloed_by_others_upstream() || _solo_isolate_control->solo_isolated_by_upstream()) {
|
||||||
int sbou = 0;
|
int sbou = 0;
|
||||||
int ibou = 0;
|
int ibou = 0;
|
||||||
std::shared_ptr<RouteList> routes = _session.get_routes ();
|
std::shared_ptr<RouteList const> routes = _session.get_routes ();
|
||||||
if (_input->connected()) {
|
if (_input->connected()) {
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
if ((*i).get() == this || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
|
if (i.get() == this || i->is_master() || i->is_monitor() || i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((*i)->direct_feeds_according_to_reality (std::dynamic_pointer_cast<Route> (shared_from_this()))) {
|
if (i->direct_feeds_according_to_reality (std::dynamic_pointer_cast<Route> (shared_from_this()))) {
|
||||||
if ((*i)->soloed()) {
|
if (i->soloed()) {
|
||||||
++sbou;
|
++sbou;
|
||||||
}
|
}
|
||||||
if ((*i)->solo_isolate_control()->solo_isolated()) {
|
if (i->solo_isolate_control()->solo_isolated()) {
|
||||||
++ibou;
|
++ibou;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3812,17 +3812,17 @@ Route::input_change_handler (IOChange change, void * /*src*/)
|
|||||||
|
|
||||||
// Session::route_solo_changed does not propagate indirect solo-changes
|
// Session::route_solo_changed does not propagate indirect solo-changes
|
||||||
// propagate downstream to tracks
|
// propagate downstream to tracks
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
if ((*i).get() == this || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
|
if (i.get() == this || i->is_master() || i->is_monitor() || i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bool does_feed = feeds (*i);
|
bool does_feed = feeds (i);
|
||||||
if (delta <= 0 && does_feed) {
|
if (delta <= 0 && does_feed) {
|
||||||
(*i)->solo_control()->mod_solo_by_others_upstream (delta);
|
i->solo_control()->mod_solo_by_others_upstream (delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idelta < 0 && does_feed) {
|
if (idelta < 0 && does_feed) {
|
||||||
(*i)->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
|
i->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3866,14 +3866,14 @@ Route::output_change_handler (IOChange change, void * /*src*/)
|
|||||||
* ideally the input_change_handler() of the other route
|
* ideally the input_change_handler() of the other route
|
||||||
* would propagate the change to us.
|
* would propagate the change to us.
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<RouteList> routes = _session.get_routes ();
|
std::shared_ptr<RouteList const> routes = _session.get_routes ();
|
||||||
if (_output->connected()) {
|
if (_output->connected()) {
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
if ((*i).get() == this || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
|
if (i.get() == this || i->is_master() || i->is_monitor() || i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (direct_feeds_according_to_reality (*i)) {
|
if (direct_feeds_according_to_reality (i)) {
|
||||||
if ((*i)->soloed()) {
|
if (i->soloed()) {
|
||||||
++sbod;
|
++sbod;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3888,12 +3888,12 @@ Route::output_change_handler (IOChange change, void * /*src*/)
|
|||||||
// Session::route_solo_changed() does not propagate indirect solo-changes
|
// Session::route_solo_changed() does not propagate indirect solo-changes
|
||||||
// propagate upstream to tracks
|
// propagate upstream to tracks
|
||||||
std::shared_ptr<Route> shared_this = std::dynamic_pointer_cast<Route> (shared_from_this());
|
std::shared_ptr<Route> shared_this = std::dynamic_pointer_cast<Route> (shared_from_this());
|
||||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
if ((*i).get() == this || !can_solo()) {
|
if (i.get() == this || !can_solo()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (delta != 0 && (*i)->feeds (shared_this)) {
|
if (delta != 0 && i->feeds (shared_this)) {
|
||||||
(*i)->solo_control()->mod_solo_by_others_downstream (delta);
|
i->solo_control()->mod_solo_by_others_downstream (delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1207,15 +1207,15 @@ Session::setup_route_monitor_sends (bool enable, bool need_process_lock)
|
|||||||
lx.acquire();
|
lx.acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rls = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
ProcessorChangeBlocker pcb (this, false /* XXX */);
|
ProcessorChangeBlocker pcb (this, false /* XXX */);
|
||||||
|
|
||||||
for (RouteList::iterator x = rls->begin(); x != rls->end(); ++x) {
|
for (auto const& x : *rl) {
|
||||||
if ((*x)->can_monitor ()) {
|
if (x->can_monitor ()) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
(*x)->enable_monitor_send ();
|
x->enable_monitor_send ();
|
||||||
} else {
|
} else {
|
||||||
(*x)->remove_monitor_send ();
|
x->remove_monitor_send ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1442,10 +1442,10 @@ Session::record_enabling_legal () const
|
|||||||
void
|
void
|
||||||
Session::set_track_monitor_input_status (bool yn)
|
Session::set_track_monitor_input_status (bool yn)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<AudioTrack> tr = std::dynamic_pointer_cast<AudioTrack> (*i);
|
std::shared_ptr<AudioTrack> tr = std::dynamic_pointer_cast<AudioTrack> (i);
|
||||||
if (tr && tr->rec_enable_control()->get_value()) {
|
if (tr && tr->rec_enable_control()->get_value()) {
|
||||||
tr->request_input_monitoring (yn);
|
tr->request_input_monitoring (yn);
|
||||||
}
|
}
|
||||||
@ -1960,8 +1960,7 @@ Session::enable_record ()
|
|||||||
void
|
void
|
||||||
Session::set_all_tracks_record_enabled (bool enable )
|
Session::set_all_tracks_record_enabled (bool enable )
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
set_controls (route_list_to_control_list (routes.reader (), &Stripable::rec_enable_control), enable, Controllable::NoGroup);
|
||||||
set_controls (route_list_to_control_list (rl, &Stripable::rec_enable_control), enable, Controllable::NoGroup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2164,7 +2163,7 @@ Session::set_block_size (pframes_t nframes)
|
|||||||
|
|
||||||
foreach_route (&Route::set_block_size, nframes);
|
foreach_route (&Route::set_block_size, nframes);
|
||||||
|
|
||||||
std::shared_ptr<IOPlugList> iop (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> iop (_io_plugins.reader ());
|
||||||
for (auto const& i : *iop) {
|
for (auto const& i : *iop) {
|
||||||
i->set_block_size (nframes);
|
i->set_block_size (nframes);
|
||||||
}
|
}
|
||||||
@ -2247,7 +2246,7 @@ Session::resort_routes_using (std::shared_ptr<RouteList> r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* now create IOPlugs graph-chains */
|
/* now create IOPlugs graph-chains */
|
||||||
std::shared_ptr<IOPlugList> io_plugins (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> io_plugins (_io_plugins.reader ());
|
||||||
GraphNodeList gnl_pre;
|
GraphNodeList gnl_pre;
|
||||||
GraphNodeList gnl_post;
|
GraphNodeList gnl_post;
|
||||||
for (auto const& p : *io_plugins) {
|
for (auto const& p : *io_plugins) {
|
||||||
@ -2346,7 +2345,7 @@ Session::rechain_process_graph (GraphNodeList& g)
|
|||||||
bool
|
bool
|
||||||
Session::rechain_ioplug_graph (bool pre)
|
Session::rechain_ioplug_graph (bool pre)
|
||||||
{
|
{
|
||||||
std::shared_ptr<IOPlugList> io_plugins (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> io_plugins (_io_plugins.reader ());
|
||||||
|
|
||||||
if (io_plugins->empty ()) {
|
if (io_plugins->empty ()) {
|
||||||
_io_graph_chain[pre ? 0 : 1].reset ();
|
_io_graph_chain[pre ? 0 : 1].reset ();
|
||||||
@ -2434,10 +2433,10 @@ Session::count_existing_track_channels (ChanCount& in, ChanCount& out)
|
|||||||
in = ChanCount::ZERO;
|
in = ChanCount::ZERO;
|
||||||
out = ChanCount::ZERO;
|
out = ChanCount::ZERO;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (!tr) {
|
if (!tr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -3395,11 +3394,11 @@ Session::load_and_connect_instruments (RouteList& new_routes, bool strict_io, st
|
|||||||
void
|
void
|
||||||
Session::globally_set_send_gains_to_zero (std::shared_ptr<Route> dest)
|
Session::globally_set_send_gains_to_zero (std::shared_ptr<Route> dest)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
std::shared_ptr<Send> s;
|
std::shared_ptr<Send> s;
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((s = (*i)->internal_send_for (dest)) != 0) {
|
if ((s = i->internal_send_for (dest)) != 0) {
|
||||||
s->gain_control()->set_value (GAIN_COEFF_ZERO, Controllable::NoGroup);
|
s->gain_control()->set_value (GAIN_COEFF_ZERO, Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3408,11 +3407,11 @@ Session::globally_set_send_gains_to_zero (std::shared_ptr<Route> dest)
|
|||||||
void
|
void
|
||||||
Session::globally_set_send_gains_to_unity (std::shared_ptr<Route> dest)
|
Session::globally_set_send_gains_to_unity (std::shared_ptr<Route> dest)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
std::shared_ptr<Send> s;
|
std::shared_ptr<Send> s;
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((s = (*i)->internal_send_for (dest)) != 0) {
|
if ((s = i->internal_send_for (dest)) != 0) {
|
||||||
s->gain_control()->set_value (GAIN_COEFF_UNITY, Controllable::NoGroup);
|
s->gain_control()->set_value (GAIN_COEFF_UNITY, Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3421,12 +3420,12 @@ Session::globally_set_send_gains_to_unity (std::shared_ptr<Route> dest)
|
|||||||
void
|
void
|
||||||
Session::globally_set_send_gains_from_track(std::shared_ptr<Route> dest)
|
Session::globally_set_send_gains_from_track(std::shared_ptr<Route> dest)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
std::shared_ptr<Send> s;
|
std::shared_ptr<Send> s;
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((s = (*i)->internal_send_for (dest)) != 0) {
|
if ((s = i->internal_send_for (dest)) != 0) {
|
||||||
s->gain_control()->set_value ((*i)->gain_control()->get_value(), Controllable::NoGroup);
|
s->gain_control()->set_value (i->gain_control()->get_value(), Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3435,13 +3434,13 @@ Session::globally_set_send_gains_from_track(std::shared_ptr<Route> dest)
|
|||||||
void
|
void
|
||||||
Session::globally_add_internal_sends (std::shared_ptr<Route> dest, Placement p, bool include_buses)
|
Session::globally_add_internal_sends (std::shared_ptr<Route> dest, Placement p, bool include_buses)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
std::shared_ptr<RouteList> t (new RouteList);
|
std::shared_ptr<RouteList> t (new RouteList);
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
/* no MIDI sends because there are no MIDI busses yet */
|
/* no MIDI sends because there are no MIDI busses yet */
|
||||||
if (include_buses || std::dynamic_pointer_cast<AudioTrack>(*i)) {
|
if (include_buses || std::dynamic_pointer_cast<AudioTrack>(i)) {
|
||||||
t->push_back (*i);
|
t->push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3530,11 +3529,11 @@ Session::remove_routes (std::shared_ptr<RouteList> routes_to_remove)
|
|||||||
|
|
||||||
if (!deletion_in_progress () && (*iter)->internal_return()) {
|
if (!deletion_in_progress () && (*iter)->internal_return()) {
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Send> s = (*i)->internal_send_for (*iter);
|
std::shared_ptr<Send> s = i->internal_send_for (*iter);
|
||||||
if (s) {
|
if (s) {
|
||||||
(*i)->remove_processor (s);
|
i->remove_processor (s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3645,20 +3644,20 @@ Session::route_listen_changed (Controllable::GroupControlDisposition group_overr
|
|||||||
RouteGroup* rg = route->route_group ();
|
RouteGroup* rg = route->route_group ();
|
||||||
const bool group_already_accounted_for = (group_override == Controllable::ForGroup);
|
const bool group_already_accounted_for = (group_override == Controllable::ForGroup);
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i) == route) {
|
if (i == route) {
|
||||||
/* already changed */
|
/* already changed */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->solo_isolate_control()->solo_isolated() || !(*i)->can_monitor()) {
|
if (i->solo_isolate_control()->solo_isolated() || !i->can_monitor()) {
|
||||||
/* route does not get solo propagated to it */
|
/* route does not get solo propagated to it */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((group_already_accounted_for && (*i)->route_group() && (*i)->route_group() == rg)) {
|
if ((group_already_accounted_for && i->route_group() && i->route_group() == rg)) {
|
||||||
/* this route is a part of the same solo group as the route
|
/* this route is a part of the same solo group as the route
|
||||||
* that was changed. Changing that route did change or will
|
* that was changed. Changing that route did change or will
|
||||||
* change all group members appropriately, so we can ignore it
|
* change all group members appropriately, so we can ignore it
|
||||||
@ -3666,7 +3665,7 @@ Session::route_listen_changed (Controllable::GroupControlDisposition group_overr
|
|||||||
*/
|
*/
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
(*i)->solo_control()->set_value (0.0, Controllable::NoGroup);
|
i->solo_control()->set_value (0.0, Controllable::NoGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3732,7 +3731,7 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
int32_t delta = route->solo_control()->transitioned_into_solo ();
|
int32_t delta = route->solo_control()->transitioned_into_solo ();
|
||||||
|
|
||||||
/* the route may be a member of a group that has shared-solo
|
/* the route may be a member of a group that has shared-solo
|
||||||
@ -3761,19 +3760,19 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
|
|||||||
/* new solo: disable all other solos, but not the group if its solo-enabled */
|
/* new solo: disable all other solos, but not the group if its solo-enabled */
|
||||||
_engine.monitor_port().clear_ports (false);
|
_engine.monitor_port().clear_ports (false);
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
|
|
||||||
if ((*i) == route) {
|
if (i == route) {
|
||||||
/* already changed */
|
/* already changed */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->solo_isolate_control()->solo_isolated() || !(*i)->can_solo()) {
|
if (i->solo_isolate_control()->solo_isolated() || !i->can_solo()) {
|
||||||
/* route does not get solo propagated to it */
|
/* route does not get solo propagated to it */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((group_already_accounted_for && (*i)->route_group() && (*i)->route_group() == rg)) {
|
if ((group_already_accounted_for && i->route_group() && i->route_group() == rg)) {
|
||||||
/* this route is a part of the same solo group as the route
|
/* this route is a part of the same solo group as the route
|
||||||
* that was changed. Changing that route did change or will
|
* that was changed. Changing that route did change or will
|
||||||
* change all group members appropriately, so we can ignore it
|
* change all group members appropriately, so we can ignore it
|
||||||
@ -3782,7 +3781,7 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*i)->solo_control()->set_value (0.0, group_override);
|
i->solo_control()->set_value (0.0, group_override);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3792,22 +3791,21 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
|
|||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("%1\n", route->name()));
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("%1\n", route->name()));
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
bool in_signal_flow;
|
bool in_signal_flow;
|
||||||
|
|
||||||
if ((*i) == route) {
|
if (i == route) {
|
||||||
/* already changed */
|
/* already changed */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->solo_isolate_control()->solo_isolated() || !(*i)->can_solo()) {
|
if (i->solo_isolate_control()->solo_isolated() || !i->can_solo()) {
|
||||||
/* route does not get solo propagated to it */
|
/* route does not get solo propagated to it */
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("%1 excluded from solo because iso = %2 can_solo = %3\n", (*i)->name(), (*i)->solo_isolate_control()->solo_isolated(),
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("%1 excluded from solo because iso = %2 can_solo = %3\n", i->name(), i->solo_isolate_control()->solo_isolated(), i->can_solo()));
|
||||||
(*i)->can_solo()));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((group_already_accounted_for && (*i)->route_group() && (*i)->route_group() == rg)) {
|
if ((group_already_accounted_for && i->route_group() && i->route_group() == rg)) {
|
||||||
/* this route is a part of the same solo group as the route
|
/* this route is a part of the same solo group as the route
|
||||||
* that was changed. Changing that route did change or will
|
* that was changed. Changing that route did change or will
|
||||||
* change all group members appropriately, so we can ignore it
|
* change all group members appropriately, so we can ignore it
|
||||||
@ -3818,38 +3816,38 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
|
|||||||
|
|
||||||
in_signal_flow = false;
|
in_signal_flow = false;
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("check feed from %1\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("check feed from %1\n", i->name()));
|
||||||
|
|
||||||
if ((*i)->feeds (route)) {
|
if (i->feeds (route)) {
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tthere is a feed from %1\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tthere is a feed from %1\n", i->name()));
|
||||||
if (!route->soloed_by_others_upstream()) {
|
if (!route->soloed_by_others_upstream()) {
|
||||||
(*i)->solo_control()->mod_solo_by_others_downstream (delta);
|
i->solo_control()->mod_solo_by_others_downstream (delta);
|
||||||
} else {
|
} else {
|
||||||
DEBUG_TRACE (DEBUG::Solo, "\talready soloed by others upstream\n");
|
DEBUG_TRACE (DEBUG::Solo, "\talready soloed by others upstream\n");
|
||||||
}
|
}
|
||||||
in_signal_flow = true;
|
in_signal_flow = true;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tno feed from %1\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tno feed from %1\n", i->name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("check feed to %1\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("check feed to %1\n", i->name()));
|
||||||
|
|
||||||
if (route->feeds (*i)) {
|
if (route->feeds (i)) {
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("%1 feeds %2 sboD %3 sboU %4\n",
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("%1 feeds %2 sboD %3 sboU %4\n",
|
||||||
route->name(),
|
route->name(),
|
||||||
(*i)->name(),
|
i->name(),
|
||||||
route->soloed_by_others_downstream(),
|
route->soloed_by_others_downstream(),
|
||||||
route->soloed_by_others_upstream()));
|
route->soloed_by_others_upstream()));
|
||||||
//NB. Triggers Invert Push, which handles soloed by downstream
|
//NB. Triggers Invert Push, which handles soloed by downstream
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tmod %1 by %2\n", (*i)->name(), delta));
|
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tmod %1 by %2\n", i->name(), delta));
|
||||||
(*i)->solo_control()->mod_solo_by_others_upstream (delta);
|
i->solo_control()->mod_solo_by_others_upstream (delta);
|
||||||
in_signal_flow = true;
|
in_signal_flow = true;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_TRACE (DEBUG::Solo, string_compose("\tno feed to %1\n", (*i)->name()) );
|
DEBUG_TRACE (DEBUG::Solo, string_compose("\tno feed to %1\n", i->name()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_signal_flow) {
|
if (!in_signal_flow) {
|
||||||
uninvolved.push_back (*i);
|
uninvolved.push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3869,7 +3867,7 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::update_route_solo_state (std::shared_ptr<RouteList> r)
|
Session::update_route_solo_state (std::shared_ptr<RouteList const> r)
|
||||||
{
|
{
|
||||||
/* now figure out if anything that matters is soloed (or is "listening")*/
|
/* now figure out if anything that matters is soloed (or is "listening")*/
|
||||||
|
|
||||||
@ -3882,20 +3880,20 @@ Session::update_route_solo_state (std::shared_ptr<RouteList> r)
|
|||||||
r = routes.reader();
|
r = routes.reader();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->can_monitor() && Config->get_solo_control_is_listen_control()) {
|
if (i->can_monitor() && Config->get_solo_control_is_listen_control()) {
|
||||||
if ((*i)->solo_control()->soloed_by_self_or_masters()) {
|
if (i->solo_control()->soloed_by_self_or_masters()) {
|
||||||
listeners++;
|
listeners++;
|
||||||
something_listening = true;
|
something_listening = true;
|
||||||
}
|
}
|
||||||
} else if ((*i)->can_solo()) {
|
} else if (i->can_solo()) {
|
||||||
(*i)->set_listen (false);
|
i->set_listen (false);
|
||||||
if ((*i)->can_solo() && (*i)->solo_control()->soloed_by_self_or_masters()) {
|
if (i->can_solo() && i->solo_control()->soloed_by_self_or_masters()) {
|
||||||
something_soloed = true;
|
something_soloed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->solo_isolate_control()->solo_isolated()) {
|
if (i->solo_isolate_control()->solo_isolated()) {
|
||||||
isolated++;
|
isolated++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3983,10 +3981,10 @@ Session::cancel_all_mute ()
|
|||||||
void
|
void
|
||||||
Session::get_stripables (StripableList& sl, PresentationInfo::Flag fl) const
|
Session::get_stripables (StripableList& sl, PresentationInfo::Flag fl) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator it = r->begin(); it != r->end(); ++it) {
|
for (auto const& i : *r) {
|
||||||
if ((*it)->presentation_info ().flags () & fl) {
|
if (i->presentation_info ().flags () & fl) {
|
||||||
sl.push_back (*it);
|
sl.push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4009,11 +4007,11 @@ Session::get_stripables () const
|
|||||||
RouteList
|
RouteList
|
||||||
Session::get_routelist (bool mixer_order, PresentationInfo::Flag fl) const
|
Session::get_routelist (bool mixer_order, PresentationInfo::Flag fl) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
RouteList rv;
|
RouteList rv;
|
||||||
for (RouteList::iterator it = r->begin(); it != r->end(); ++it) {
|
for (auto const& i : *r) {
|
||||||
if ((*it)->presentation_info ().flags () & fl) {
|
if (i->presentation_info ().flags () & fl) {
|
||||||
rv.push_back (*it);
|
rv.push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rv.sort (Stripable::Sorter (mixer_order));
|
rv.sort (Stripable::Sorter (mixer_order));
|
||||||
@ -4023,12 +4021,12 @@ Session::get_routelist (bool mixer_order, PresentationInfo::Flag fl) const
|
|||||||
std::shared_ptr<RouteList>
|
std::shared_ptr<RouteList>
|
||||||
Session::get_routes_with_internal_returns() const
|
Session::get_routes_with_internal_returns() const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
std::shared_ptr<RouteList> rl (new RouteList);
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->internal_return ()) {
|
if (i->internal_return ()) {
|
||||||
rl->push_back (*i);
|
rl->push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rl;
|
return rl;
|
||||||
@ -4037,7 +4035,7 @@ Session::get_routes_with_internal_returns() const
|
|||||||
bool
|
bool
|
||||||
Session::io_name_is_legal (const std::string& name) const
|
Session::io_name_is_legal (const std::string& name) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (map<string,bool>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) {
|
for (map<string,bool>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) {
|
||||||
if (name == reserved->first) {
|
if (name == reserved->first) {
|
||||||
@ -4050,17 +4048,17 @@ Session::io_name_is_legal (const std::string& name) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->name() == name) {
|
if (i->name() == name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->has_io_processor_named (name)) {
|
if (i->has_io_processor_named (name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<IOPlugList> iop (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> iop (_io_plugins.reader ());
|
||||||
for (auto const& i : *iop) {
|
for (auto const& i : *iop) {
|
||||||
if (i->io_name () == name) {
|
if (i->io_name () == name) {
|
||||||
return false;
|
return false;
|
||||||
@ -4141,11 +4139,11 @@ Session::set_exclusive_input_active (std::shared_ptr<RouteList> rl, bool onoff,
|
|||||||
void
|
void
|
||||||
Session::routes_using_input_from (const string& str, RouteList& rl)
|
Session::routes_using_input_from (const string& str, RouteList& rl)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->input()->connected_to (str)) {
|
if (i->input()->connected_to (str)) {
|
||||||
rl.push_back (*i);
|
rl.push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4153,11 +4151,11 @@ Session::routes_using_input_from (const string& str, RouteList& rl)
|
|||||||
std::shared_ptr<Route>
|
std::shared_ptr<Route>
|
||||||
Session::route_by_name (string name) const
|
Session::route_by_name (string name) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->name() == name) {
|
if (i->name() == name) {
|
||||||
return *i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4167,11 +4165,11 @@ Session::route_by_name (string name) const
|
|||||||
std::shared_ptr<Route>
|
std::shared_ptr<Route>
|
||||||
Session::route_by_id (PBD::ID id) const
|
Session::route_by_id (PBD::ID id) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->id() == id) {
|
if (i->id() == id) {
|
||||||
return *i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4197,9 +4195,9 @@ Session::stripable_by_id (PBD::ID id) const
|
|||||||
std::shared_ptr<Trigger>
|
std::shared_ptr<Trigger>
|
||||||
Session::trigger_by_id (PBD::ID id) const
|
Session::trigger_by_id (PBD::ID id) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<TriggerBox> box = (*i)->triggerbox();
|
std::shared_ptr<TriggerBox> box = i->triggerbox();
|
||||||
if (box) {
|
if (box) {
|
||||||
TriggerPtr trigger = box->trigger_by_id(id);
|
TriggerPtr trigger = box->trigger_by_id(id);
|
||||||
if (trigger) {
|
if (trigger) {
|
||||||
@ -4214,10 +4212,10 @@ Session::trigger_by_id (PBD::ID id) const
|
|||||||
std::shared_ptr<Processor>
|
std::shared_ptr<Processor>
|
||||||
Session::processor_by_id (PBD::ID id) const
|
Session::processor_by_id (PBD::ID id) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Processor> p = (*i)->Route::processor_by_id (id);
|
std::shared_ptr<Processor> p = i->Route::processor_by_id (id);
|
||||||
if (p) {
|
if (p) {
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -4333,9 +4331,9 @@ Session::reassign_track_numbers ()
|
|||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (DEBUG_ENABLED(DEBUG::OrderKeys)) {
|
if (DEBUG_ENABLED(DEBUG::OrderKeys)) {
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1 numbered %2\n", (*i)->name(), (*i)->track_number()));
|
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1 numbered %2\n", i->name(), i->track_number()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
@ -4506,9 +4504,9 @@ Session::remove_last_capture ()
|
|||||||
{
|
{
|
||||||
list<std::shared_ptr<Source> > srcs;
|
list<std::shared_ptr<Source> > srcs;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (!tr) {
|
if (!tr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -4535,9 +4533,9 @@ Session::remove_last_capture ()
|
|||||||
void
|
void
|
||||||
Session::get_last_capture_sources (std::list<std::shared_ptr<Source> >& srcs)
|
Session::get_last_capture_sources (std::list<std::shared_ptr<Source> >& srcs)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (!tr) {
|
if (!tr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -5746,10 +5744,10 @@ Session::unmark_insert_id (uint32_t id)
|
|||||||
void
|
void
|
||||||
Session::reset_native_file_format ()
|
Session::reset_native_file_format ()
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
/* don't save state as we do this, there's no point */
|
/* don't save state as we do this, there's no point */
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
@ -5762,10 +5760,10 @@ Session::reset_native_file_format ()
|
|||||||
bool
|
bool
|
||||||
Session::route_name_unique (string n) const
|
Session::route_name_unique (string n) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
if ((*i)->name() == n) {
|
if (i->name() == n) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5790,13 +5788,13 @@ Session::route_name_internal (string n) const
|
|||||||
int
|
int
|
||||||
Session::freeze_all (InterThreadInfo& itt)
|
Session::freeze_all (InterThreadInfo& itt)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
|
|
||||||
std::shared_ptr<Track> t;
|
std::shared_ptr<Track> t;
|
||||||
|
|
||||||
if ((t = std::dynamic_pointer_cast<Track>(*i)) != 0) {
|
if ((t = std::dynamic_pointer_cast<Track>(i)) != 0) {
|
||||||
/* XXX this is wrong because itt.progress will keep returning to zero at the start
|
/* XXX this is wrong because itt.progress will keep returning to zero at the start
|
||||||
of every track.
|
of every track.
|
||||||
*/
|
*/
|
||||||
@ -6220,10 +6218,10 @@ Session::ntracks () const
|
|||||||
/* XXX Could be optimized by caching */
|
/* XXX Could be optimized by caching */
|
||||||
|
|
||||||
uint32_t n = 0;
|
uint32_t n = 0;
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if (std::dynamic_pointer_cast<Track> (*i)) {
|
if (std::dynamic_pointer_cast<Track> (i)) {
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6237,10 +6235,10 @@ Session::naudiotracks () const
|
|||||||
/* XXX Could be optimized by caching */
|
/* XXX Could be optimized by caching */
|
||||||
|
|
||||||
uint32_t n = 0;
|
uint32_t n = 0;
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if (std::dynamic_pointer_cast<AudioTrack> (*i)) {
|
if (std::dynamic_pointer_cast<AudioTrack> (i)) {
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6252,10 +6250,10 @@ uint32_t
|
|||||||
Session::nbusses () const
|
Session::nbusses () const
|
||||||
{
|
{
|
||||||
uint32_t n = 0;
|
uint32_t n = 0;
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if (std::dynamic_pointer_cast<Track>(*i) == 0) {
|
if (std::dynamic_pointer_cast<Track>(i) == 0) {
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6308,8 +6306,8 @@ Session::have_rec_disabled_track () const
|
|||||||
void
|
void
|
||||||
Session::update_route_record_state ()
|
Session::update_route_record_state ()
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
RouteList::iterator i = rl->begin();
|
RouteList::const_iterator i = rl->begin();
|
||||||
while (i != rl->end ()) {
|
while (i != rl->end ()) {
|
||||||
|
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
||||||
@ -6354,9 +6352,9 @@ Session::listen_position_changed ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ProcessorChangeBlocker pcb (this);
|
ProcessorChangeBlocker pcb (this);
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->listen_position_changed ();
|
i->listen_position_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6426,13 +6424,12 @@ Session::get_nth_audio_track (uint32_t nth) const
|
|||||||
std::shared_ptr<RouteList>
|
std::shared_ptr<RouteList>
|
||||||
Session::get_tracks () const
|
Session::get_tracks () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
std::shared_ptr<RouteList> tl (new RouteList);
|
std::shared_ptr<RouteList> tl (new RouteList);
|
||||||
|
|
||||||
for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) {
|
for (auto const& r : *rl) {
|
||||||
if (std::dynamic_pointer_cast<Track> (*r)) {
|
if (std::dynamic_pointer_cast<Track> (r)) {
|
||||||
assert (!(*r)->is_auditioner()); // XXX remove me
|
tl->push_back (r);
|
||||||
tl->push_back (*r);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tl;
|
return tl;
|
||||||
@ -6441,11 +6438,11 @@ Session::get_tracks () const
|
|||||||
std::shared_ptr<RouteList>
|
std::shared_ptr<RouteList>
|
||||||
Session::get_routes_with_regions_at (timepos_t const & p) const
|
Session::get_routes_with_regions_at (timepos_t const & p) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
std::shared_ptr<RouteList> rl (new RouteList);
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (!tr) {
|
if (!tr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -6456,7 +6453,7 @@ Session::get_routes_with_regions_at (timepos_t const & p) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pl->has_region_at (p)) {
|
if (pl->has_region_at (p)) {
|
||||||
rl->push_back (*i);
|
rl->push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6704,9 +6701,9 @@ Session::unknown_processors () const
|
|||||||
{
|
{
|
||||||
list<string> p;
|
list<string> p;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
list<string> t = (*i)->unknown_processors ();
|
list<string> t = i->unknown_processors ();
|
||||||
copy (t.begin(), t.end(), back_inserter (p));
|
copy (t.begin(), t.end(), back_inserter (p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6788,15 +6785,13 @@ Session::update_route_latency (bool playback, bool apply_to_delayline, bool* del
|
|||||||
DEBUG_TRACE (DEBUG::LatencyCompensation , string_compose ("update_route_latency: %1 apply_to_delayline? %2)\n", (playback ? "PLAYBACK" : "CAPTURE"), (apply_to_delayline ? "yes" : "no")));
|
DEBUG_TRACE (DEBUG::LatencyCompensation , string_compose ("update_route_latency: %1 apply_to_delayline? %2)\n", (playback ? "PLAYBACK" : "CAPTURE"), (apply_to_delayline ? "yes" : "no")));
|
||||||
|
|
||||||
/* Note: RouteList is process-graph sorted */
|
/* Note: RouteList is process-graph sorted */
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
RouteList r = *routes.reader ();
|
||||||
|
|
||||||
if (playback) {
|
if (playback) {
|
||||||
/* reverse the list so that we work backwards from the last route to run to the first,
|
/* reverse the list so that we work backwards from the last route to run to the first,
|
||||||
* this is not needed, but can help to reduce the iterations for aux-sends.
|
* this is not needed, but can help to reduce the iterations for aux-sends.
|
||||||
*/
|
*/
|
||||||
RouteList* rl = routes.reader().get();
|
reverse (r.begin(), r.end());
|
||||||
r.reset (new RouteList (*rl));
|
|
||||||
reverse (r->begin(), r->end());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
@ -6805,10 +6800,10 @@ restart:
|
|||||||
_send_latency_changes = 0;
|
_send_latency_changes = 0;
|
||||||
_worst_route_latency = 0;
|
_worst_route_latency = 0;
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : r) {
|
||||||
// if (!(*i)->active()) { continue ; } // TODO
|
// if (!(*i)->active()) { continue ; } // TODO
|
||||||
samplecnt_t l;
|
samplecnt_t l;
|
||||||
if ((*i)->signal_latency () != (l = (*i)->update_signal_latency (apply_to_delayline, delayline_update_needed))) {
|
if (i->signal_latency () != (l = i->update_signal_latency (apply_to_delayline, delayline_update_needed))) {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
_worst_route_latency = std::max (l, _worst_route_latency);
|
_worst_route_latency = std::max (l, _worst_route_latency);
|
||||||
@ -6841,7 +6836,7 @@ Session::set_owned_port_public_latency (bool playback)
|
|||||||
_click_io->set_public_port_latencies (_click_io->connected_latency (playback), playback);
|
_click_io->set_public_port_latencies (_click_io->connected_latency (playback), playback);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<IOPlugList> iop (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> iop (_io_plugins.reader ());
|
||||||
for (auto const& i : *iop) {
|
for (auto const& i : *iop) {
|
||||||
i->set_public_latency (playback);
|
i->set_public_latency (playback);
|
||||||
}
|
}
|
||||||
@ -6915,23 +6910,21 @@ Session::update_latency (bool playback)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Note; RouteList is sorted as process-graph */
|
/* Note; RouteList is sorted as process-graph */
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
RouteList r = *routes.reader ();
|
||||||
|
|
||||||
if (playback) {
|
if (playback) {
|
||||||
/* reverse the list so that we work backwards from the last route to run to the first */
|
/* reverse the list so that we work backwards from the last route to run to the first */
|
||||||
RouteList* rl = routes.reader().get();
|
reverse (r.begin(), r.end());
|
||||||
r.reset (new RouteList (*rl));
|
|
||||||
reverse (r->begin(), r->end());
|
|
||||||
}
|
}
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : r) {
|
||||||
/* private port latency includes plugin and I/O delay,
|
/* private port latency includes plugin and I/O delay,
|
||||||
* but no latency compensation delaylines.
|
* but no latency compensation delaylines.
|
||||||
*/
|
*/
|
||||||
samplecnt_t latency = (*i)->set_private_port_latencies (playback);
|
samplecnt_t latency = i->set_private_port_latencies (playback);
|
||||||
/* However we also need to reset the latency of connected external
|
/* However we also need to reset the latency of connected external
|
||||||
* ports, since those includes latency compensation delaylines.
|
* ports, since those includes latency compensation delaylines.
|
||||||
*/
|
*/
|
||||||
(*i)->set_public_port_latencies (latency, playback, false);
|
i->set_public_port_latencies (latency, playback, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_owned_port_public_latency (playback);
|
set_owned_port_public_latency (playback);
|
||||||
@ -6961,12 +6954,12 @@ Session::update_latency (bool playback)
|
|||||||
update_route_latency (false, false, NULL);
|
update_route_latency (false, false, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : r) {
|
||||||
/* Publish port latency. This includes latency-compensation
|
/* Publish port latency. This includes latency-compensation
|
||||||
* delaylines in the direction of signal flow.
|
* delaylines in the direction of signal flow.
|
||||||
*/
|
*/
|
||||||
samplecnt_t latency = (*i)->set_private_port_latencies (playback);
|
samplecnt_t latency = i->set_private_port_latencies (playback);
|
||||||
(*i)->set_public_port_latencies (latency, playback, true);
|
i->set_public_port_latencies (latency, playback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now handle non-route ports that we are responsible for */
|
/* now handle non-route ports that we are responsible for */
|
||||||
@ -7000,11 +6993,11 @@ Session::set_worst_output_latency ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
_worst_output_latency = max (_worst_output_latency, (*i)->output()->latency());
|
_worst_output_latency = max (_worst_output_latency, i->output()->latency());
|
||||||
_io_latency = max (_io_latency, (*i)->output()->latency() + (*i)->input()->latency());
|
_io_latency = max (_io_latency, i->output()->latency() + i->input()->latency());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_click_io) {
|
if (_click_io) {
|
||||||
@ -7027,10 +7020,10 @@ Session::set_worst_input_latency ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
_worst_input_latency = max (_worst_input_latency, (*i)->input()->latency());
|
_worst_input_latency = max (_worst_input_latency, i->input()->latency());
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::LatencyCompensation, string_compose ("Worst input latency: %1\n", _worst_input_latency));
|
DEBUG_TRACE (DEBUG::LatencyCompensation, string_compose ("Worst input latency: %1\n", _worst_input_latency));
|
||||||
@ -7103,9 +7096,9 @@ Session::update_latency_compensation (bool force_whole_graph, bool called_from_b
|
|||||||
#endif
|
#endif
|
||||||
lm.acquire ();
|
lm.acquire ();
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->apply_latency_compensation ();
|
i->apply_latency_compensation ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEBUG_TRACE (DEBUG::LatencyCompensation, "update_latency_compensation: complete\n");
|
DEBUG_TRACE (DEBUG::LatencyCompensation, "update_latency_compensation: complete\n");
|
||||||
|
@ -83,11 +83,11 @@ Session::remove_bundle (std::shared_ptr<Bundle> bundle)
|
|||||||
std::shared_ptr<Bundle>
|
std::shared_ptr<Bundle>
|
||||||
Session::bundle_by_name (string name) const
|
Session::bundle_by_name (string name) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<BundleList> b = _bundles.reader ();
|
std::shared_ptr<BundleList const> b = _bundles.reader ();
|
||||||
|
|
||||||
for (BundleList::const_iterator i = b->begin(); i != b->end(); ++i) {
|
for (auto const& i : *b) {
|
||||||
if ((*i)->name() == name) {
|
if (i->name() == name) {
|
||||||
return* i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,10 +74,10 @@ Session::pre_export ()
|
|||||||
/* take everyone out of awrite to avoid disasters */
|
/* take everyone out of awrite to avoid disasters */
|
||||||
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->protect_automation ();
|
i->protect_automation ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,13 +172,12 @@ Session::start_audio_export (samplepos_t position, bool realtime, bool region_ex
|
|||||||
|
|
||||||
/* get everyone to the right position */
|
/* get everyone to the right position */
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr && tr->seek (position, true)) {
|
if (tr && tr->seek (position, true)) {
|
||||||
error << string_compose (_("%1: cannot seek to %2 for export"),
|
error << string_compose (_("%1: cannot seek to %2 for export"), i->name(), position)
|
||||||
(*i)->name(), position)
|
|
||||||
<< endmsg;
|
<< endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -66,11 +66,11 @@ void
|
|||||||
Session::midi_panic()
|
Session::midi_panic()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
MidiTrack *track = dynamic_cast<MidiTrack*>((*i).get());
|
std::shared_ptr<MidiTrack> track = std::dynamic_pointer_cast<MidiTrack>(i);
|
||||||
if (track != 0) {
|
if (track) {
|
||||||
track->midi_panic();
|
track->midi_panic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,13 +344,13 @@ Session::get_midi_nth_route_by_id (PresentationInfo::order_t n) const
|
|||||||
f = PresentationInfo::Route;
|
f = PresentationInfo::Route;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
PresentationInfo::order_t match_cnt = 0;
|
PresentationInfo::order_t match_cnt = 0;
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->presentation_info().flag_match (f)) {
|
if (i->presentation_info().flag_match (f)) {
|
||||||
if (match_cnt++ == n) {
|
if (match_cnt++ == n) {
|
||||||
return *i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,21 +144,21 @@ Session::process (pframes_t nframes)
|
|||||||
bool one_or_more_routes_declicking = false;
|
bool one_or_more_routes_declicking = false;
|
||||||
{
|
{
|
||||||
ProcessorChangeBlocker pcb (this);
|
ProcessorChangeBlocker pcb (this);
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if ((*i)->apply_processor_changes_rt()) {
|
if (i->apply_processor_changes_rt()) {
|
||||||
_rt_emit_pending = true;
|
_rt_emit_pending = true;
|
||||||
}
|
}
|
||||||
if ((*i)->declick_in_progress()) {
|
if (i->declick_in_progress()) {
|
||||||
one_or_more_routes_declicking = true;
|
one_or_more_routes_declicking = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_update_send_delaylines) {
|
if (_update_send_delaylines) {
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->update_send_delaylines ();
|
i->update_send_delaylines ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ Session::no_roll (pframes_t nframes)
|
|||||||
|
|
||||||
samplepos_t end_sample = _transport_sample + floor (nframes * _transport_fsm->transport_speed());
|
samplepos_t end_sample = _transport_sample + floor (nframes * _transport_fsm->transport_speed());
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
if (_click_io) {
|
if (_click_io) {
|
||||||
_click_io->silence (nframes);
|
_click_io->silence (nframes);
|
||||||
@ -236,14 +236,14 @@ Session::no_roll (pframes_t nframes)
|
|||||||
_process_graph->routes_no_roll(graph_chain, nframes, _transport_sample, end_sample, non_realtime_work_pending());
|
_process_graph->routes_no_roll(graph_chain, nframes, _transport_sample, end_sample, non_realtime_work_pending());
|
||||||
} else {
|
} else {
|
||||||
PT_TIMING_CHECK (10);
|
PT_TIMING_CHECK (10);
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
|
|
||||||
if ((*i)->is_auditioner()) {
|
if (i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*i)->no_roll (nframes, _transport_sample, end_sample, non_realtime_work_pending())) {
|
if (i->no_roll (nframes, _transport_sample, end_sample, non_realtime_work_pending())) {
|
||||||
error << string_compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
|
error << string_compose(_("Session: error in no roll for %1"), i->name()) << endmsg;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ int
|
|||||||
Session::process_routes (pframes_t nframes, bool& need_butler)
|
Session::process_routes (pframes_t nframes, bool& need_butler)
|
||||||
{
|
{
|
||||||
TimerRAII tr (dsp_stats[Roll]);
|
TimerRAII tr (dsp_stats[Roll]);
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
const samplepos_t start_sample = _transport_sample;
|
const samplepos_t start_sample = _transport_sample;
|
||||||
const samplepos_t end_sample = _transport_sample + floor (nframes * _transport_fsm->transport_speed());
|
const samplepos_t end_sample = _transport_sample + floor (nframes * _transport_fsm->transport_speed());
|
||||||
@ -287,24 +287,24 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((*i)->is_auditioner()) {
|
if (i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool b = false;
|
bool b = false;
|
||||||
|
|
||||||
if ((ret = (*i)->roll (nframes, start_sample, end_sample, b)) < 0) {
|
if ((ret = i->roll (nframes, start_sample, end_sample, b)) < 0) {
|
||||||
cerr << "ERR1 STOP\n";
|
cerr << "ERR1 STOP\n";
|
||||||
TFSM_STOP (false, false);
|
TFSM_STOP (false, false);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 rolled and needs butler\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 rolled and needs butler\n", i->name()));
|
||||||
need_butler = true;
|
need_butler = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,10 +319,10 @@ Session::get_track_statistics ()
|
|||||||
float pworst = 1.0f;
|
float pworst = 1.0f;
|
||||||
float cworst = 1.0f;
|
float cworst = 1.0f;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
|
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
|
|
||||||
if (!tr || tr->is_private_route()) {
|
if (!tr || tr->is_private_route()) {
|
||||||
continue;
|
continue;
|
||||||
@ -360,9 +360,9 @@ Session::compute_audible_delta (samplepos_t& pos_and_delta) const
|
|||||||
samplecnt_t
|
samplecnt_t
|
||||||
Session::calc_preroll_subcycle (samplecnt_t ns) const
|
Session::calc_preroll_subcycle (samplecnt_t ns) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
samplecnt_t route_offset = (*i)->playback_latency ();
|
samplecnt_t route_offset = i->playback_latency ();
|
||||||
if (_remaining_latency_preroll > route_offset + ns) {
|
if (_remaining_latency_preroll > route_offset + ns) {
|
||||||
/* route will no-roll for complete pre-roll cycle */
|
/* route will no-roll for complete pre-roll cycle */
|
||||||
continue;
|
continue;
|
||||||
@ -775,16 +775,16 @@ void
|
|||||||
Session::process_audition (pframes_t nframes)
|
Session::process_audition (pframes_t nframes)
|
||||||
{
|
{
|
||||||
SessionEvent* ev;
|
SessionEvent* ev;
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
std::shared_ptr<GraphChain> graph_chain = _graph_chain;
|
std::shared_ptr<GraphChain> graph_chain = _graph_chain;
|
||||||
if (graph_chain) {
|
if (graph_chain) {
|
||||||
/* Ideally we'd use Session::rt_tasklist, since dependency is irrelevant. */
|
/* Ideally we'd use Session::rt_tasklist, since dependency is irrelevant. */
|
||||||
_process_graph->silence_routes (graph_chain, nframes);
|
_process_graph->silence_routes (graph_chain, nframes);
|
||||||
} else {
|
} else {
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
if (!(*i)->is_auditioner()) {
|
if (!i->is_auditioner()) {
|
||||||
(*i)->silence (nframes);
|
i->silence (nframes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1192,9 +1192,9 @@ Session::emit_route_signals ()
|
|||||||
// TODO use RAII to allow using these signals in other places
|
// TODO use RAII to allow using these signals in other places
|
||||||
BatchUpdateStart(); /* EMIT SIGNAL */
|
BatchUpdateStart(); /* EMIT SIGNAL */
|
||||||
ProcessorChangeBlocker pcb (this);
|
ProcessorChangeBlocker pcb (this);
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::const_iterator ci = r->begin(); ci != r->end(); ++ci) {
|
for (auto const& i : *r) {
|
||||||
(*ci)->emit_pending_signals ();
|
i->emit_pending_signals ();
|
||||||
}
|
}
|
||||||
BatchUpdateEnd(); /* EMIT SIGNAL */
|
BatchUpdateEnd(); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
@ -132,18 +132,18 @@ Session::prepare_momentary_solo (SoloMuteRelease* smr, bool exclusive, std::shar
|
|||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> routes_on (new RouteList);
|
std::shared_ptr<RouteList> routes_on (new RouteList);
|
||||||
std::shared_ptr<RouteList> routes_off (new RouteList);
|
std::shared_ptr<RouteList> routes_off (new RouteList);
|
||||||
std::shared_ptr<RouteList> routes = get_routes();
|
std::shared_ptr<RouteList const> routes = get_routes();
|
||||||
|
|
||||||
for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
|
for (auto const& i : *routes) {
|
||||||
#ifdef MIXBUS
|
#ifdef MIXBUS
|
||||||
if (route && (0 == route->mixbus()) != (0 == (*i)->mixbus ())) {
|
if (route && (0 == route->mixbus()) != (0 == i->mixbus ())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((*i)->soloed ()) {
|
if (i->soloed ()) {
|
||||||
routes_on->push_back (*i);
|
routes_on->push_back (i);
|
||||||
} else if (smr) {
|
} else if (smr) {
|
||||||
routes_off->push_back (*i);
|
routes_off->push_back (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,19 +169,19 @@ Session::prepare_momentary_solo (SoloMuteRelease* smr, bool exclusive, std::shar
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::clear_all_solo_state (std::shared_ptr<RouteList> rl)
|
Session::clear_all_solo_state (std::shared_ptr<RouteList const> rl)
|
||||||
{
|
{
|
||||||
queue_event (get_rt_event (rl, false, rt_cleanup, Controllable::NoGroup, &Session::rt_clear_all_solo_state));
|
queue_event (get_rt_event (rl, false, rt_cleanup, Controllable::NoGroup, &Session::rt_clear_all_solo_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::rt_clear_all_solo_state (std::shared_ptr<RouteList> rl, bool /* yn */, Controllable::GroupControlDisposition /* group_override */)
|
Session::rt_clear_all_solo_state (std::shared_ptr<RouteList const> rl, bool /* yn */, Controllable::GroupControlDisposition /* group_override */)
|
||||||
{
|
{
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
if ((*i)->is_auditioner()) {
|
if (i->is_auditioner()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
(*i)->clear_all_solo_state();
|
i->clear_all_solo_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
_vca_manager->clear_all_solo_state ();
|
_vca_manager->clear_all_solo_state ();
|
||||||
|
@ -320,9 +320,9 @@ Session::post_engine_init ()
|
|||||||
{
|
{
|
||||||
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
|
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
|
||||||
ProcessorChangeBlocker pcb (this);
|
ProcessorChangeBlocker pcb (this);
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->configure_processors (0);
|
i->configure_processors (0);
|
||||||
}
|
}
|
||||||
/* release process-lock, ProcessorChangeBlocker may trigger
|
/* release process-lock, ProcessorChangeBlocker may trigger
|
||||||
* latency-callback from non-rt thread which may take the lock */
|
* latency-callback from non-rt thread which may take the lock */
|
||||||
@ -1179,7 +1179,7 @@ Session::collect_sources_of_this_snapshot (set<std::shared_ptr<Source>>& s, bool
|
|||||||
_playlists->sync_all_regions_with_regions ();
|
_playlists->sync_all_regions_with_regions ();
|
||||||
_playlists->foreach (boost::bind (merge_all_sources, _1, &s), incl_unused);
|
_playlists->foreach (boost::bind (merge_all_sources, _1, &s), incl_unused);
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (auto const& r : *rl) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<TriggerBox> tb = r->triggerbox ();
|
std::shared_ptr<TriggerBox> tb = r->triggerbox ();
|
||||||
if (tb) {
|
if (tb) {
|
||||||
@ -1393,7 +1393,7 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool for_archive,
|
|||||||
*/
|
*/
|
||||||
std::set<std::shared_ptr<Region>> tr;
|
std::set<std::shared_ptr<Region>> tr;
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (auto const& r : *rl) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<TriggerBox> tb = r->triggerbox ();
|
std::shared_ptr<TriggerBox> tb = r->triggerbox ();
|
||||||
if (tb) {
|
if (tb) {
|
||||||
@ -1492,9 +1492,9 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool for_archive,
|
|||||||
|
|
||||||
child = node->add_child ("Bundles");
|
child = node->add_child ("Bundles");
|
||||||
{
|
{
|
||||||
std::shared_ptr<BundleList> bundles = _bundles.reader ();
|
std::shared_ptr<BundleList const> bundles = _bundles.reader ();
|
||||||
for (BundleList::iterator i = bundles->begin(); i != bundles->end(); ++i) {
|
for (auto const& i : *bundles) {
|
||||||
std::shared_ptr<UserBundle> b = std::dynamic_pointer_cast<UserBundle> (*i);
|
std::shared_ptr<UserBundle> b = std::dynamic_pointer_cast<UserBundle> (i);
|
||||||
if (b) {
|
if (b) {
|
||||||
child->add_child_nocopy (b->get_state());
|
child->add_child_nocopy (b->get_state());
|
||||||
}
|
}
|
||||||
@ -1505,7 +1505,7 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool for_archive,
|
|||||||
|
|
||||||
child = node->add_child ("Routes");
|
child = node->add_child ("Routes");
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
route_id_compare cmp;
|
route_id_compare cmp;
|
||||||
RouteList xml_node_order (*r);
|
RouteList xml_node_order (*r);
|
||||||
@ -1592,7 +1592,7 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool for_archive,
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<IOPlugList> iop (_io_plugins.reader ());
|
std::shared_ptr<IOPlugList const> iop (_io_plugins.reader ());
|
||||||
XMLNode* iop_node = new XMLNode (X_("IOPlugins"));
|
XMLNode* iop_node = new XMLNode (X_("IOPlugins"));
|
||||||
for (auto const& i : *iop) {
|
for (auto const& i : *iop) {
|
||||||
iop_node->add_child_nocopy (i->get_state());
|
iop_node->add_child_nocopy (i->get_state());
|
||||||
@ -2625,9 +2625,9 @@ Session::get_sources_as_xml ()
|
|||||||
void
|
void
|
||||||
Session::reset_write_sources (bool mark_write_complete, bool force)
|
Session::reset_write_sources (bool mark_write_complete, bool force)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
tr->reset_write_sources(mark_write_complete, force);
|
tr->reset_write_sources(mark_write_complete, force);
|
||||||
@ -3581,7 +3581,7 @@ Session::cleanup_regions ()
|
|||||||
/* collect Regions used by Triggers */
|
/* collect Regions used by Triggers */
|
||||||
std::set<std::shared_ptr<Region>> tr;
|
std::set<std::shared_ptr<Region>> tr;
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (auto const& r : *rl) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<TriggerBox> tb = r->triggerbox ();
|
std::shared_ptr<TriggerBox> tb = r->triggerbox ();
|
||||||
if (tb) {
|
if (tb) {
|
||||||
|
@ -303,9 +303,9 @@ void
|
|||||||
Session::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
|
Session::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl (routes.reader());
|
std::shared_ptr<RouteList const> rl (routes.reader());
|
||||||
|
|
||||||
for (auto & r : *rl) {
|
for (auto const& r : *rl) {
|
||||||
r->globally_change_time_domain (from, to);
|
r->globally_change_time_domain (from, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,10 +122,10 @@ Session::realtime_stop (bool abort, bool clear_state)
|
|||||||
|
|
||||||
/* call routes */
|
/* call routes */
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin (); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->realtime_handle_transport_stopped ();
|
i->realtime_handle_transport_stopped ();
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("stop complete, auto-return scheduled for return to %1\n", _requested_return_sample));
|
DEBUG_TRACE (DEBUG::Transport, string_compose ("stop complete, auto-return scheduled for return to %1\n", _requested_return_sample));
|
||||||
@ -213,9 +213,9 @@ Session::locate (samplepos_t target_sample, bool for_loop_end, bool force, bool
|
|||||||
|
|
||||||
/* Tell all routes to do the RT part of locate */
|
/* Tell all routes to do the RT part of locate */
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->realtime_locate (for_loop_end);
|
i->realtime_locate (for_loop_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force || !for_loop_end) {
|
if (force || !for_loop_end) {
|
||||||
@ -266,10 +266,10 @@ Session::locate (samplepos_t target_sample, bool for_loop_end, bool force, bool
|
|||||||
|
|
||||||
// located to start of loop - this is looping, basically
|
// located to start of loop - this is looping, basically
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
|
|
||||||
if (tr && tr->rec_enable_control()->get_value()) {
|
if (tr && tr->rec_enable_control()->get_value()) {
|
||||||
// tell it we've looped, so it can deal with the record state
|
// tell it we've looped, so it can deal with the record state
|
||||||
@ -444,10 +444,10 @@ Session::set_transport_speed (double speed)
|
|||||||
void
|
void
|
||||||
Session::trigger_stop_all (bool now)
|
Session::trigger_stop_all (bool now)
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
(*i)->stop_triggers (now);
|
i->stop_triggers (now);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TriggerBox::cue_recording()) {
|
if (TriggerBox::cue_recording()) {
|
||||||
@ -725,9 +725,9 @@ Session::micro_locate (samplecnt_t distance)
|
|||||||
{
|
{
|
||||||
ENSURE_PROCESS_THREAD;
|
ENSURE_PROCESS_THREAD;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr && !tr->can_internal_playback_seek (distance)) {
|
if (tr && !tr->can_internal_playback_seek (distance)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -735,8 +735,8 @@ Session::micro_locate (samplecnt_t distance)
|
|||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("micro-locate by %1\n", distance));
|
DEBUG_TRACE (DEBUG::Transport, string_compose ("micro-locate by %1\n", distance));
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr->internal_playback_seek (distance);
|
tr->internal_playback_seek (distance);
|
||||||
}
|
}
|
||||||
@ -750,10 +750,10 @@ void
|
|||||||
Session::flush_all_inserts ()
|
Session::flush_all_inserts ()
|
||||||
{
|
{
|
||||||
ENSURE_PROCESS_THREAD;
|
ENSURE_PROCESS_THREAD;
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->flush_processors ();
|
i->flush_processors ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1077,21 +1077,21 @@ Session::solo_selection (StripableList &list, bool new_state)
|
|||||||
std::shared_ptr<ControlList> solo_list (new ControlList);
|
std::shared_ptr<ControlList> solo_list (new ControlList);
|
||||||
std::shared_ptr<ControlList> unsolo_list (new ControlList);
|
std::shared_ptr<ControlList> unsolo_list (new ControlList);
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = get_routes();
|
std::shared_ptr<RouteList const> rl = get_routes();
|
||||||
|
|
||||||
for (ARDOUR::RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
|
|
||||||
if ( !(*i)->is_track() ) {
|
if ( !i->is_track() ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Stripable> s (*i);
|
std::shared_ptr<Stripable> s (i);
|
||||||
|
|
||||||
bool found = (std::find(list.begin(), list.end(), s) != list.end());
|
bool found = (std::find(list.begin(), list.end(), s) != list.end());
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
/* must invalidate playlists on selected track, so disk reader
|
/* must invalidate playlists on selected track, so disk reader
|
||||||
* will re-fill with the new selection state for solo_selection */
|
* will re-fill with the new selection state for solo_selection */
|
||||||
std::shared_ptr<Track> track = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> track = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (track) {
|
if (track) {
|
||||||
std::shared_ptr<Playlist> playlist = track->playlist();
|
std::shared_ptr<Playlist> playlist = track->playlist();
|
||||||
if (playlist) {
|
if (playlist) {
|
||||||
@ -1124,7 +1124,7 @@ Session::butler_transport_work (bool have_process_lock)
|
|||||||
/* Note: this function executes in the butler thread context */
|
/* Note: this function executes in the butler thread context */
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader ();
|
||||||
int on_entry = _butler->should_do_transport_work.load();
|
int on_entry = _butler->should_do_transport_work.load();
|
||||||
bool finished = true;
|
bool finished = true;
|
||||||
PostTransportWork ptw = post_transport_work();
|
PostTransportWork ptw = post_transport_work();
|
||||||
@ -1141,13 +1141,13 @@ Session::butler_transport_work (bool have_process_lock)
|
|||||||
if (!have_process_lock) {
|
if (!have_process_lock) {
|
||||||
lx.acquire ();
|
lx.acquire ();
|
||||||
}
|
}
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr->adjust_playback_buffering ();
|
tr->adjust_playback_buffering ();
|
||||||
/* and refill those buffers ... */
|
/* and refill those buffers ... */
|
||||||
}
|
}
|
||||||
(*i)->non_realtime_locate (_transport_sample);
|
i->non_realtime_locate (_transport_sample);
|
||||||
}
|
}
|
||||||
VCAList v = _vca_manager->vcas ();
|
VCAList v = _vca_manager->vcas ();
|
||||||
for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
|
for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
|
||||||
@ -1162,8 +1162,8 @@ Session::butler_transport_work (bool have_process_lock)
|
|||||||
if (!have_process_lock) {
|
if (!have_process_lock) {
|
||||||
lx.acquire ();
|
lx.acquire ();
|
||||||
}
|
}
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr->adjust_capture_buffering ();
|
tr->adjust_capture_buffering ();
|
||||||
}
|
}
|
||||||
@ -1213,9 +1213,9 @@ Session::non_realtime_overwrite (int on_entry, bool& finished, bool update_loop_
|
|||||||
DiskReader::reset_loop_declick (_locations->auto_loop_location(), sample_rate());
|
DiskReader::reset_loop_declick (_locations->auto_loop_location(), sample_rate());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr && tr->pending_overwrite ()) {
|
if (tr && tr->pending_overwrite ()) {
|
||||||
tr->overwrite_existing_buffers ();
|
tr->overwrite_existing_buffers ();
|
||||||
}
|
}
|
||||||
@ -1266,22 +1266,23 @@ Session::non_realtime_locate ()
|
|||||||
gint sc;
|
gint sc;
|
||||||
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
sc = _seek_counter.load ();
|
sc = _seek_counter.load ();
|
||||||
tf = _transport_sample;
|
tf = _transport_sample;
|
||||||
start = get_microseconds ();
|
start = get_microseconds ();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i, ++nt) {
|
for (auto const& i : *rl) {
|
||||||
(*i)->non_realtime_locate (tf);
|
++nt;
|
||||||
|
i->non_realtime_locate (tf);
|
||||||
if (sc != _seek_counter.load ()) {
|
if (sc != _seek_counter.load ()) {
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
microseconds_t end = get_microseconds ();
|
microseconds_t end = get_microseconds ();
|
||||||
int usecs_per_track = lrintf ((end - start) / (double) nt);
|
int usecs_per_track = lrintf ((end - start) / std::max<double> (1.0, nt));
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
std::cerr << "locate to " << tf << " took " << (end - start) << " usecs for " << nt << " tracks = " << usecs_per_track << " per track\n";
|
std::cerr << "locate to " << tf << " took " << (end - start) << " usecs for " << nt << " tracks = " << usecs_per_track << " per track\n";
|
||||||
#endif
|
#endif
|
||||||
@ -1349,9 +1350,9 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished, bool will_
|
|||||||
did_record = false;
|
did_record = false;
|
||||||
saved = false;
|
saved = false;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr && tr->get_captured_samples () != 0) {
|
if (tr && tr->get_captured_samples () != 0) {
|
||||||
did_record = true;
|
did_record = true;
|
||||||
break;
|
break;
|
||||||
@ -1385,8 +1386,8 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished, bool will_
|
|||||||
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr->transport_stopped_wallclock (*now, xnow, abort);
|
tr->transport_stopped_wallclock (*now, xnow, abort);
|
||||||
}
|
}
|
||||||
@ -1398,7 +1399,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished, bool will_
|
|||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> r = routes.reader ();
|
std::shared_ptr<RouteList const> r = routes.reader (); /// why get another reader, and not use `rl' ?
|
||||||
|
|
||||||
if (did_record) {
|
if (did_record) {
|
||||||
commit_reversible_command ();
|
commit_reversible_command ();
|
||||||
@ -1412,8 +1413,8 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished, bool will_
|
|||||||
if (_engine.running()) {
|
if (_engine.running()) {
|
||||||
PostTransportWork ptw = post_transport_work ();
|
PostTransportWork ptw = post_transport_work ();
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
(*i)->non_realtime_transport_stop (_transport_sample, !(ptw & PostTransportLocate));
|
i->non_realtime_transport_stop (_transport_sample, !(ptw & PostTransportLocate));
|
||||||
}
|
}
|
||||||
VCAList v = _vca_manager->vcas ();
|
VCAList v = _vca_manager->vcas ();
|
||||||
for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
|
for (VCAList::const_iterator i = v.begin(); i != v.end(); ++i) {
|
||||||
@ -1513,9 +1514,9 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished, bool will_
|
|||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Transport, X_("Butler PTW: locate\n"));
|
DEBUG_TRACE (DEBUG::Transport, X_("Butler PTW: locate\n"));
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (auto const& i : *r) {
|
||||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler PTW: locate on %1\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler PTW: locate on %1\n", i->name()));
|
||||||
(*i)->non_realtime_locate (_transport_sample);
|
i->non_realtime_locate (_transport_sample);
|
||||||
|
|
||||||
if (on_entry != _butler->should_do_transport_work.load()) {
|
if (on_entry != _butler->should_do_transport_work.load()) {
|
||||||
finished = false;
|
finished = false;
|
||||||
@ -1669,11 +1670,11 @@ Session::set_track_loop (bool yn)
|
|||||||
yn = false;
|
yn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader ();
|
std::shared_ptr<RouteList const> rl = routes.reader ();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
if (*i && !(*i)->is_private_route()) {
|
if (!i->is_private_route()) {
|
||||||
(*i)->set_loop (yn ? loc : 0);
|
i->set_loop (yn ? loc : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1860,9 +1861,9 @@ Session::xrun_recovery ()
|
|||||||
/* ..and start the FSM engine again */
|
/* ..and start the FSM engine again */
|
||||||
_transport_fsm->start ();
|
_transport_fsm->start ();
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr->mark_capture_xrun ();
|
tr->mark_capture_xrun ();
|
||||||
}
|
}
|
||||||
@ -2031,11 +2032,11 @@ Session::sync_source_changed (SyncSource type, samplepos_t pos, pframes_t cycle_
|
|||||||
// need to queue this for next process() cycle
|
// need to queue this for next process() cycle
|
||||||
_send_timecode_update = true;
|
_send_timecode_update = true;
|
||||||
|
|
||||||
std::shared_ptr<RouteList> rl = routes.reader();
|
std::shared_ptr<RouteList const> rl = routes.reader();
|
||||||
const bool externally_slaved = transport_master_is_external();
|
const bool externally_slaved = transport_master_is_external();
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (auto const& i : *rl) {
|
||||||
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (*i);
|
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (i);
|
||||||
if (tr && !tr->is_private_route()) {
|
if (tr && !tr->is_private_route()) {
|
||||||
tr->set_slaved (externally_slaved);
|
tr->set_slaved (externally_slaved);
|
||||||
}
|
}
|
||||||
|
@ -42,17 +42,18 @@ SoloMuteRelease::set_exclusive (bool e)
|
|||||||
void
|
void
|
||||||
SoloMuteRelease::set (std::shared_ptr<Route> r)
|
SoloMuteRelease::set (std::shared_ptr<Route> r)
|
||||||
{
|
{
|
||||||
|
std::shared_ptr<RouteList> rl (new RouteList);
|
||||||
if (active) {
|
if (active) {
|
||||||
routes_on.reset (new RouteList);
|
rl->push_back (r);
|
||||||
routes_on->push_back (r);
|
routes_on = rl;
|
||||||
} else {
|
} else {
|
||||||
routes_off.reset (new RouteList);
|
rl->push_back (r);
|
||||||
routes_off->push_back (r);
|
routes_off = rl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SoloMuteRelease::set (std::shared_ptr<RouteList> rl)
|
SoloMuteRelease::set (std::shared_ptr<RouteList const> rl)
|
||||||
{
|
{
|
||||||
if (active) {
|
if (active) {
|
||||||
routes_on = rl;
|
routes_on = rl;
|
||||||
@ -62,7 +63,7 @@ SoloMuteRelease::set (std::shared_ptr<RouteList> rl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SoloMuteRelease::set (std::shared_ptr<RouteList> on, std::shared_ptr<RouteList> off)
|
SoloMuteRelease::set (std::shared_ptr<RouteList const> on, std::shared_ptr<RouteList const> off)
|
||||||
{
|
{
|
||||||
routes_on = on;
|
routes_on = on;
|
||||||
routes_off = off;
|
routes_off = off;
|
||||||
|
@ -189,8 +189,8 @@ PortEngine::PortPtr
|
|||||||
JACKAudioBackend::get_port_by_name (const std::string& name) const
|
JACKAudioBackend::get_port_by_name (const std::string& name) const
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::shared_ptr<JackPorts> ports = _jack_ports.reader ();
|
std::shared_ptr<JackPorts const> ports = _jack_ports.reader ();
|
||||||
JackPorts::iterator p = ports->find (name);
|
JackPorts::const_iterator p = ports->find (name);
|
||||||
|
|
||||||
if (p != ports->end()) {
|
if (p != ports->end()) {
|
||||||
return p->second;
|
return p->second;
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
delete managed_object.load ();
|
delete managed_object.load ();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<T> reader () const
|
std::shared_ptr<T const> reader () const
|
||||||
{
|
{
|
||||||
std::shared_ptr<T> rv;
|
std::shared_ptr<T> rv;
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ RCUTest::read_thread ()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < 15000; ++i) {
|
for (int i = 0; i < 15000; ++i) {
|
||||||
std::shared_ptr<Values> reader = _values.reader ();
|
std::shared_ptr<Values const> reader = _values.reader ();
|
||||||
for (Values::const_iterator i = reader->begin (); i != reader->end(); ++i) {
|
for (Values::const_iterator i = reader->begin (); i != reader->end(); ++i) {
|
||||||
CPPUNIT_ASSERT (i->first == i->second->val);
|
CPPUNIT_ASSERT (i->first == i->second->val);
|
||||||
}
|
}
|
||||||
|
@ -3377,13 +3377,13 @@ OSC::route_get_receives(lo_message msg) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RouteList> route_list = session->get_routes();
|
std::shared_ptr<RouteList const> route_list = session->get_routes();
|
||||||
|
|
||||||
lo_message reply = lo_message_new();
|
lo_message reply = lo_message_new();
|
||||||
lo_message_add_int32(reply, rid);
|
lo_message_add_int32(reply, rid);
|
||||||
|
|
||||||
for (RouteList::iterator i = route_list->begin(); i != route_list->end(); ++i) {
|
for (auto const& i : *route_list) {
|
||||||
std::shared_ptr<Route> tr = std::dynamic_pointer_cast<Route> (*i);
|
std::shared_ptr<Route> tr = std::dynamic_pointer_cast<Route> (i);
|
||||||
if (!tr) {
|
if (!tr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ std::string Tempo::xml_node_name = X_("Tempo");
|
|||||||
std::string Meter::xml_node_name = X_("Meter");
|
std::string Meter::xml_node_name = X_("Meter");
|
||||||
|
|
||||||
SerializedRCUManager<TempoMap> TempoMap::_map_mgr (0);
|
SerializedRCUManager<TempoMap> TempoMap::_map_mgr (0);
|
||||||
thread_local TempoMap::WritableSharedPtr TempoMap::_tempo_map_p;
|
thread_local TempoMap::SharedPtr TempoMap::_tempo_map_p;
|
||||||
PBD::Signal0<void> TempoMap::MapChanged;
|
PBD::Signal0<void> TempoMap::MapChanged;
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -691,7 +691,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
|||||||
typedef std::shared_ptr<TempoMap const> SharedPtr;
|
typedef std::shared_ptr<TempoMap const> SharedPtr;
|
||||||
typedef std::shared_ptr<TempoMap> WritableSharedPtr;
|
typedef std::shared_ptr<TempoMap> WritableSharedPtr;
|
||||||
private:
|
private:
|
||||||
static thread_local WritableSharedPtr _tempo_map_p;
|
static thread_local SharedPtr _tempo_map_p;
|
||||||
static SerializedRCUManager<TempoMap> _map_mgr;
|
static SerializedRCUManager<TempoMap> _map_mgr;
|
||||||
public:
|
public:
|
||||||
LIBTEMPORAL_API static void init ();
|
LIBTEMPORAL_API static void init ();
|
||||||
@ -704,8 +704,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
|||||||
* tempo map only when it has changed.
|
* tempo map only when it has changed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LIBTEMPORAL_API static WritableSharedPtr read() { return _map_mgr.reader(); }
|
LIBTEMPORAL_API static SharedPtr read() { return _map_mgr.reader(); }
|
||||||
LIBTEMPORAL_API static void set (WritableSharedPtr new_map) { _tempo_map_p = new_map; /* new_map must have been fetched with read() */ }
|
LIBTEMPORAL_API static void set (SharedPtr new_map) { _tempo_map_p = new_map; /* new_map must have been fetched with read() */ }
|
||||||
|
|
||||||
/* API for typical tempo map changes */
|
/* API for typical tempo map changes */
|
||||||
|
|
||||||
@ -713,10 +713,6 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
|||||||
LIBTEMPORAL_API static int update (WritableSharedPtr m);
|
LIBTEMPORAL_API static int update (WritableSharedPtr m);
|
||||||
LIBTEMPORAL_API static void abort_update ();
|
LIBTEMPORAL_API static void abort_update ();
|
||||||
|
|
||||||
/* API to be reviewed */
|
|
||||||
|
|
||||||
LIBTEMPORAL_API static WritableSharedPtr fetch_writable() { _tempo_map_p = write_copy(); return _tempo_map_p; }
|
|
||||||
|
|
||||||
/* not part of public API */
|
/* not part of public API */
|
||||||
timepos_t reftime(TempoMetric const &) const;
|
timepos_t reftime(TempoMetric const &) const;
|
||||||
|
|
||||||
|
@ -136,9 +136,8 @@ copy_session_routes (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get route state from first session */
|
/* get route state from first session */
|
||||||
std::shared_ptr<RouteList> rl = s->get_routes ();
|
std::shared_ptr<RouteList const> rl = s->get_routes ();
|
||||||
for (RouteList::iterator i = rl->begin (); i != rl->end (); ++i) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<Route> r = *i;
|
|
||||||
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) {
|
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -177,8 +176,7 @@ copy_session_routes (
|
|||||||
* setup internal return targets.
|
* setup internal return targets.
|
||||||
*/
|
*/
|
||||||
rl = s->get_routes ();
|
rl = s->get_routes ();
|
||||||
for (RouteList::iterator i = rl->begin (); i != rl->end (); ++i) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<Route> r = *i;
|
|
||||||
/* skip special busses */
|
/* skip special busses */
|
||||||
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) {
|
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) {
|
||||||
continue;
|
continue;
|
||||||
@ -190,12 +188,12 @@ copy_session_routes (
|
|||||||
std::map<std::string,XMLNode*>::iterator it = routestate.find (r->name ());
|
std::map<std::string,XMLNode*>::iterator it = routestate.find (r->name ());
|
||||||
if (it == routestate.end ()) {
|
if (it == routestate.end ()) {
|
||||||
if (opt_verbose) {
|
if (opt_verbose) {
|
||||||
printf (" -- no match for '%s'\n", (*i)->name ().c_str ());
|
printf (" -- no match for '%s'\n", r->name ().c_str ());
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (opt_verbose) {
|
if (opt_verbose) {
|
||||||
printf ("-- found match '%s'\n", (*i)->name ().c_str ());
|
printf ("-- found match '%s'\n", r->name ().c_str ());
|
||||||
}
|
}
|
||||||
XMLNode *state = it->second;
|
XMLNode *state = it->second;
|
||||||
// copy state
|
// copy state
|
||||||
@ -204,8 +202,7 @@ copy_session_routes (
|
|||||||
|
|
||||||
/* iterate over all tracks in the target session.. */
|
/* iterate over all tracks in the target session.. */
|
||||||
rl = s->get_routes ();
|
rl = s->get_routes ();
|
||||||
for (RouteList::iterator i = rl->begin (); i != rl->end (); ++i) {
|
for (auto const& r : *rl) {
|
||||||
std::shared_ptr<Route> r = *i;
|
|
||||||
/* skip special busses */
|
/* skip special busses */
|
||||||
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) {
|
if (r->is_master () || r->is_monitor () || r->is_auditioner ()) {
|
||||||
continue;
|
continue;
|
||||||
@ -218,12 +215,12 @@ copy_session_routes (
|
|||||||
std::map<std::string,XMLNode*>::iterator it = routestate.find (r->name ());
|
std::map<std::string,XMLNode*>::iterator it = routestate.find (r->name ());
|
||||||
if (it == routestate.end ()) {
|
if (it == routestate.end ()) {
|
||||||
if (opt_verbose) {
|
if (opt_verbose) {
|
||||||
printf (" -- no match for '%s'\n", (*i)->name ().c_str ());
|
printf (" -- no match for '%s'\n", r->name ().c_str ());
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (opt_verbose) {
|
if (opt_verbose) {
|
||||||
printf ("-- found match '%s'\n", (*i)->name ().c_str ());
|
printf ("-- found match '%s'\n", r->name ().c_str ());
|
||||||
}
|
}
|
||||||
XMLNode *state = it->second;
|
XMLNode *state = it->second;
|
||||||
/* copy state */
|
/* copy state */
|
||||||
|
@ -9,7 +9,7 @@ function factory () return function ()
|
|||||||
tm = nil
|
tm = nil
|
||||||
|
|
||||||
-- set initial tempo to 140, ramp to 120 over the first 4/4 bar, then continue at BPM 80
|
-- set initial tempo to 140, ramp to 120 over the first 4/4 bar, then continue at BPM 80
|
||||||
local tm = Temporal.TempoMap.fetch_writable ()
|
local tm = Temporal.TempoMap.write_copy ()
|
||||||
tm:set_tempo (Temporal.Tempo (140, 120, 4), Temporal.timepos_t (0))
|
tm:set_tempo (Temporal.Tempo (140, 120, 4), Temporal.timepos_t (0))
|
||||||
tm:set_tempo (Temporal.Tempo (120, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
tm:set_tempo (Temporal.Tempo (120, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
||||||
tm:set_tempo (Temporal.Tempo (80, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
tm:set_tempo (Temporal.Tempo (80, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
||||||
@ -21,10 +21,10 @@ function factory () return function ()
|
|||||||
tm = nil
|
tm = nil
|
||||||
|
|
||||||
-- Abort Edit example
|
-- Abort Edit example
|
||||||
-- after every call to Temporal.TempoMap.fetch_writable ()
|
-- after every call to Temporal.TempoMap.write_copy ()
|
||||||
-- there must be a matching call to
|
-- there must be a matching call to
|
||||||
-- Temporal.TempoMap.update() or Temporal.TempoMap.abort_update()
|
-- Temporal.TempoMap.update() or Temporal.TempoMap.abort_update()
|
||||||
Temporal.TempoMap.fetch_writable()
|
Temporal.TempoMap.write_copy()
|
||||||
Temporal.TempoMap.abort_update()
|
Temporal.TempoMap.abort_update()
|
||||||
|
|
||||||
end end
|
end end
|
||||||
|
Loading…
Reference in New Issue
Block a user