switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr

This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
This commit is contained in:
Paul Davis 2023-02-16 16:33:28 -07:00
parent 90c5524e7b
commit b35518e212
819 changed files with 9736 additions and 9709 deletions

View file

@ -448,7 +448,7 @@ BasicUI::trigger_cue_row (int cue_idx)
void
BasicUI::trigger_stop_col (int col, bool immediately)
{
boost::shared_ptr<TriggerBox> tb = session->triggerbox_at (col);
std::shared_ptr<TriggerBox> tb = session->triggerbox_at (col);
if (tb) {
if (immediately) {
tb->stop_all_immediately ();
@ -615,7 +615,7 @@ void
BasicUI::toggle_monitor_mute ()
{
if (session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
std::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
if (mon->cut_all ()) {
mon->set_cut_all (false);
} else {
@ -628,7 +628,7 @@ void
BasicUI::toggle_monitor_dim ()
{
if (session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
std::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
if (mon->dim_all ()) {
mon->set_dim_all (false);
} else {
@ -641,7 +641,7 @@ void
BasicUI::toggle_monitor_mono ()
{
if (session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
std::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
if (mon->mono()) {
mon->set_mono (false);
} else {
@ -845,11 +845,11 @@ BasicUI::goto_nth_marker (int n)
ARDOUR::TriggerPtr
BasicUI::find_trigger (int x, int y)
{
boost::shared_ptr<Route> r = session->get_remote_nth_route (x);
std::shared_ptr<Route> r = session->get_remote_nth_route (x);
if (!r) {
return TriggerPtr();
}
boost::shared_ptr<TriggerBox> tb = r->triggerbox();
std::shared_ptr<TriggerBox> tb = r->triggerbox();
if (!tb || !tb->active()) {
return TriggerPtr();
@ -867,7 +867,7 @@ BasicUI::find_trigger (int x, int y)
float
BasicUI::trigger_progress_at (int x)
{
boost::shared_ptr<TriggerBox> tb = session->triggerbox_at (_tbank_start_route + x);
std::shared_ptr<TriggerBox> tb = session->triggerbox_at (_tbank_start_route + x);
if (tb) {
ARDOUR::TriggerPtr trigger = tb->currently_playing ();
if (trigger) {
@ -882,7 +882,7 @@ BasicUI::trigger_display_at (int x, int y)
{
TriggerDisplay disp;
boost::shared_ptr<TriggerBox> tb = session->triggerbox_at (_tbank_start_route + x);
std::shared_ptr<TriggerBox> tb = session->triggerbox_at (_tbank_start_route + x);
if (tb) {
ARDOUR::TriggerPtr current = tb->currently_playing ();
TriggerPtr tp = tb->trigger (_tbank_start_row + y);
@ -916,12 +916,12 @@ BasicUI::unbang_trigger_at (int x, int y)
this stuff is waiting to go in so that all UIs can offer complex solo/mute functionality
void
BasicUI::solo_release (boost::shared_ptr<Route> r)
BasicUI::solo_release (std::shared_ptr<Route> r)
{
}
void
BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bool exclusive, bool isolate, bool solo_group)
BasicUI::solo_press (std::shared_ptr<Route> r, bool momentary, bool global, bool exclusive, bool isolate, bool solo_group)
{
if (momentary) {
_solo_release = new SoloMuteRelease (_route->soloed());
@ -944,7 +944,7 @@ BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bo
if (_solo_release) {
_solo_release->exclusive = true;
boost::shared_ptr<RouteList> routes = _session->get_routes();
std::shared_ptr<RouteList> routes = _session->get_routes();
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
if ((*i)->soloed ()) {
@ -992,7 +992,7 @@ BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bo
/* click: solo this route */
boost::shared_ptr<RouteList> rl (new RouteList);
std::shared_ptr<RouteList> rl (new RouteList);
rl->push_back (route());
if (_solo_release) {

View file

@ -119,12 +119,12 @@ void
ControlProtocol::set_route_table_size (uint32_t size)
{
while (route_table.size() < size) {
route_table.push_back (boost::shared_ptr<Route> ((Route*) 0));
route_table.push_back (std::shared_ptr<Route> ((Route*) 0));
}
}
void
ControlProtocol::set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR::Route> r)
ControlProtocol::set_route_table (uint32_t table_index, std::shared_ptr<ARDOUR::Route> r)
{
if (table_index >= route_table.size()) {
return;
@ -139,7 +139,7 @@ bool
ControlProtocol::set_route_table (uint32_t table_index, uint32_t remote_control_id)
{
#if 0 // STRIPABLE
boost::shared_ptr<Route> r = session->route_by_remote_id (remote_control_id);
std::shared_ptr<Route> r = session->route_by_remote_id (remote_control_id);
if (!r) {
return false;
@ -157,9 +157,9 @@ ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
return;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(r);
std::shared_ptr<AudioTrack> at = std::dynamic_pointer_cast<AudioTrack>(r);
if (at) {
at->rec_enable_control()->set_value (1.0, Controllable::UseGroup);
@ -173,9 +173,9 @@ ControlProtocol::route_get_rec_enable (uint32_t table_index)
return false;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(r);
std::shared_ptr<AudioTrack> at = std::dynamic_pointer_cast<AudioTrack>(r);
if (at) {
return at->rec_enable_control()->get_value();
@ -192,7 +192,7 @@ ControlProtocol::route_get_gain (uint32_t table_index)
return 0.0f;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r == 0) {
return 0.0f;
@ -208,7 +208,7 @@ ControlProtocol::route_set_gain (uint32_t table_index, float gain)
return;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
r->gain_control()->set_value (gain, Controllable::UseGroup);
@ -222,7 +222,7 @@ ControlProtocol::route_get_effective_gain (uint32_t table_index)
return 0.0f;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r == 0) {
return 0.0f;
@ -239,7 +239,7 @@ ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t whic
return 0.0f;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r == 0) {
return 0.0f;
@ -255,7 +255,7 @@ ControlProtocol::route_get_muted (uint32_t table_index)
return false;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r == 0) {
return false;
@ -271,7 +271,7 @@ ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
return;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
r->mute_control()->set_value (yn ? 1.0 : 0.0, Controllable::UseGroup);
@ -286,7 +286,7 @@ ControlProtocol::route_get_soloed (uint32_t table_index)
return false;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r == 0) {
return false;
@ -302,7 +302,7 @@ ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
return;
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
session->set_control (r->solo_control(), yn ? 1.0 : 0.0, Controllable::UseGroup);
@ -316,7 +316,7 @@ ControlProtocol:: route_get_name (uint32_t table_index)
return "";
}
boost::shared_ptr<Route> r = route_table[table_index];
std::shared_ptr<Route> r = route_table[table_index];
if (r == 0) {
return "";
@ -325,10 +325,10 @@ ControlProtocol:: route_get_name (uint32_t table_index)
return r->name();
}
list<boost::shared_ptr<Bundle> >
list<std::shared_ptr<Bundle> >
ControlProtocol::bundles ()
{
return list<boost::shared_ptr<Bundle> > ();
return list<std::shared_ptr<Bundle> > ();
}
XMLNode&
@ -353,49 +353,49 @@ ControlProtocol::set_state (XMLNode const & node, int /* version */)
return 0;
}
boost::shared_ptr<Stripable>
std::shared_ptr<Stripable>
ControlProtocol::first_selected_stripable () const
{
return session->selection().first_selected_stripable ();
}
void
ControlProtocol::add_stripable_to_selection (boost::shared_ptr<ARDOUR::Stripable> s)
ControlProtocol::add_stripable_to_selection (std::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().add (s, boost::shared_ptr<AutomationControl>());
session->selection().add (s, std::shared_ptr<AutomationControl>());
}
void
ControlProtocol::set_stripable_selection (boost::shared_ptr<ARDOUR::Stripable> s)
ControlProtocol::set_stripable_selection (std::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().select_stripable_and_maybe_group (s, true, true, 0);
}
void
ControlProtocol::toggle_stripable_selection (boost::shared_ptr<ARDOUR::Stripable> s)
ControlProtocol::toggle_stripable_selection (std::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
session->selection().toggle (s, std::shared_ptr<AutomationControl>());
}
void
ControlProtocol::remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stripable> s)
ControlProtocol::remove_stripable_from_selection (std::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
session->selection().remove (s, std::shared_ptr<AutomationControl>());
}
void
ControlProtocol::add_rid_to_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().add (s, boost::shared_ptr<AutomationControl>());
session->selection().add (s, std::shared_ptr<AutomationControl>());
}
}
void
ControlProtocol::set_rid_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().select_stripable_and_maybe_group (s, true, true, 0);
}
@ -404,18 +404,18 @@ ControlProtocol::set_rid_selection (int rid)
void
ControlProtocol::toggle_rid_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
session->selection().toggle (s, std::shared_ptr<AutomationControl>());
}
}
void
ControlProtocol::remove_rid_from_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
session->selection().remove (s, std::shared_ptr<AutomationControl>());
}
}

View file

@ -194,7 +194,7 @@ class LIBCONTROLCP_API BasicUI {
void unbang_trigger_at (int x, int y);
/* it would be nice to use TriggerPtr here but that implies including ardour/triggerbox.h */
boost::shared_ptr<ARDOUR::Trigger> find_trigger (int x, int y);
std::shared_ptr<ARDOUR::Trigger> find_trigger (int x, int y);
protected:
BasicUI ();

View file

@ -83,10 +83,10 @@ public:
static PBD::Signal0<void> StepTracksDown;
static PBD::Signal0<void> StepTracksUp;
void add_stripable_to_selection (boost::shared_ptr<ARDOUR::Stripable>);
void set_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
void toggle_stripable_selection (boost::shared_ptr<ARDOUR::Stripable>);
void remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stripable>);
void add_stripable_to_selection (std::shared_ptr<ARDOUR::Stripable>);
void set_stripable_selection (std::shared_ptr<ARDOUR::Stripable>);
void toggle_stripable_selection (std::shared_ptr<ARDOUR::Stripable>);
void remove_stripable_from_selection (std::shared_ptr<ARDOUR::Stripable>);
void clear_stripable_selection ();
virtual void add_rid_to_selection (int rid);
@ -94,7 +94,7 @@ public:
virtual void toggle_rid_selection (int rid);
virtual void remove_rid_from_selection (int rid);
boost::shared_ptr<ARDOUR::Stripable> first_selected_stripable () const;
std::shared_ptr<ARDOUR::Stripable> first_selected_stripable () const;
/* the model here is as follows:
@ -113,7 +113,7 @@ public:
*/
void set_route_table_size (uint32_t size);
void set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR::Route>);
void set_route_table (uint32_t table_index, std::shared_ptr<ARDOUR::Route>);
bool set_route_table (uint32_t table_index, uint32_t remote_control_id);
void route_set_rec_enable (uint32_t table_index, bool yn);
@ -133,7 +133,7 @@ public:
std::string route_get_name (uint32_t table_index);
virtual std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
virtual std::list<std::shared_ptr<ARDOUR::Bundle> > bundles ();
virtual bool has_editor () const { return false; }
virtual void* get_gui () const { return 0; }
@ -151,7 +151,7 @@ protected:
void next_track (uint32_t initial_id);
void prev_track (uint32_t initial_id);
std::vector<boost::shared_ptr<ARDOUR::Route> > route_table;
std::vector<std::shared_ptr<ARDOUR::Route> > route_table;
std::string _name;
GlibEventLoopCallback glib_event_callback;
virtual void event_loop_precall ();

View file

@ -26,13 +26,13 @@ namespace ARDOUR {
class Route;
class Stripable;
typedef std::vector<boost::weak_ptr<ARDOUR::Route> > RouteNotificationList;
typedef boost::shared_ptr<RouteNotificationList> RouteNotificationListPtr;
typedef std::vector<boost::shared_ptr<ARDOUR::Route> > StrongRouteNotificationList;
typedef std::vector<std::weak_ptr<ARDOUR::Route> > RouteNotificationList;
typedef std::shared_ptr<RouteNotificationList> RouteNotificationListPtr;
typedef std::vector<std::shared_ptr<ARDOUR::Route> > StrongRouteNotificationList;
typedef std::vector<boost::weak_ptr<ARDOUR::Stripable> > StripableNotificationList;
typedef boost::shared_ptr<StripableNotificationList> StripableNotificationListPtr;
typedef std::vector<boost::shared_ptr<ARDOUR::Stripable> > StrongStripableNotificationList;
typedef std::vector<std::weak_ptr<ARDOUR::Stripable> > StripableNotificationList;
typedef std::shared_ptr<StripableNotificationList> StripableNotificationListPtr;
typedef std::vector<std::shared_ptr<ARDOUR::Stripable> > StrongStripableNotificationList;
}
#endif /* __ardour_control_protocol_types_h__ */

View file

@ -93,8 +93,8 @@ MIDISurface::ports_acquire ()
* really insist on that (and use JACK)
*/
_input_port = boost::dynamic_pointer_cast<AsyncMIDIPort>(_async_in).get();
_output_port = boost::dynamic_pointer_cast<AsyncMIDIPort>(_async_out).get();
_input_port = std::dynamic_pointer_cast<AsyncMIDIPort>(_async_in).get();
_output_port = std::dynamic_pointer_cast<AsyncMIDIPort>(_async_out).get();
/* Create a shadow port where, depending on the state of the surface,
* we will make pad note on/off events appear. The surface code will
@ -102,8 +102,8 @@ MIDISurface::ports_acquire ()
*/
if (with_pad_filter) {
boost::dynamic_pointer_cast<AsyncMIDIPort>(_async_in)->add_shadow_port (string_compose (_("%1 Pads"), port_name_prefix), boost::bind (&MIDISurface::pad_filter, this, _1, _2));
boost::shared_ptr<MidiPort> shadow_port = boost::dynamic_pointer_cast<AsyncMIDIPort>(_async_in)->shadow_port();
std::dynamic_pointer_cast<AsyncMIDIPort>(_async_in)->add_shadow_port (string_compose (_("%1 Pads"), port_name_prefix), boost::bind (&MIDISurface::pad_filter, this, _1, _2));
std::shared_ptr<MidiPort> shadow_port = std::dynamic_pointer_cast<AsyncMIDIPort>(_async_in)->shadow_port();
if (shadow_port) {
@ -184,15 +184,15 @@ MIDISurface::port_registration_handler ()
}
bool
MIDISurface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn)
MIDISurface::connection_handler (std::weak_ptr<ARDOUR::Port>, std::string name1, std::weak_ptr<ARDOUR::Port>, std::string name2, bool yn)
{
DEBUG_TRACE (DEBUG::MIDISurface, "FaderPort::connection_handler start\n");
if (!_input_port || !_output_port) {
return false;
}
std::string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_in)->name());
std::string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_out)->name());
std::string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (std::shared_ptr<ARDOUR::Port>(_async_in)->name());
std::string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (std::shared_ptr<ARDOUR::Port>(_async_out)->name());
if (ni == name1 || ni == name2) {
if (yn) {
@ -245,13 +245,13 @@ MIDISurface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name
return true; /* connection status changed */
}
boost::shared_ptr<Port>
std::shared_ptr<Port>
MIDISurface::output_port()
{
return _async_out;
}
boost::shared_ptr<Port>
std::shared_ptr<Port>
MIDISurface::input_port()
{
return _async_in;
@ -424,10 +424,10 @@ MIDISurface::stop_using_device ()
return 0;
}
std::list<boost::shared_ptr<ARDOUR::Bundle> >
std::list<std::shared_ptr<ARDOUR::Bundle> >
MIDISurface::bundles ()
{
std::list<boost::shared_ptr<ARDOUR::Bundle> > b;
std::list<std::shared_ptr<ARDOUR::Bundle> > b;
if (_output_bundle) {
b.push_back (_output_bundle);

View file

@ -50,13 +50,13 @@ class MIDISurface : public ARDOUR::ControlProtocol
static void* request_factory (uint32_t num_requests);
boost::shared_ptr<ARDOUR::Port> input_port();
boost::shared_ptr<ARDOUR::Port> output_port();
std::shared_ptr<ARDOUR::Port> input_port();
std::shared_ptr<ARDOUR::Port> output_port();
// Bundle to represent our input ports
boost::shared_ptr<ARDOUR::Bundle> _input_bundle;
std::shared_ptr<ARDOUR::Bundle> _input_bundle;
// Bundle to represent our output ports
boost::shared_ptr<ARDOUR::Bundle> _output_bundle;
std::shared_ptr<ARDOUR::Bundle> _output_bundle;
ARDOUR::Session & get_session() { return *session; }
@ -69,7 +69,7 @@ class MIDISurface : public ARDOUR::ControlProtocol
XMLNode& get_state() const;
int set_state (const XMLNode & node, int version);
std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
std::list<std::shared_ptr<ARDOUR::Bundle> > bundles ();
PBD::Signal0<void> ConnectionChange;
@ -82,8 +82,8 @@ class MIDISurface : public ARDOUR::ControlProtocol
MIDI::Port* _input_port;
MIDI::Port* _output_port;
boost::shared_ptr<ARDOUR::Port> _async_in;
boost::shared_ptr<ARDOUR::Port> _async_out;
std::shared_ptr<ARDOUR::Port> _async_in;
std::shared_ptr<ARDOUR::Port> _async_out;
void do_request (MidiSurfaceRequest*);
@ -118,7 +118,7 @@ class MIDISurface : public ARDOUR::ControlProtocol
int _connection_state;
virtual bool connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn);
virtual bool connection_handler (std::weak_ptr<ARDOUR::Port>, std::string name1, std::weak_ptr<ARDOUR::Port>, std::string name2, bool yn);
PBD::ScopedConnectionList port_connections;
virtual int ports_acquire ();