From 1ffb70f6706163139896cf1d6144018828716a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Dom=C3=ADnguez?= Date: Mon, 26 Aug 2024 04:32:38 +0200 Subject: [PATCH] Replace boost::scoped_ptr with std::unique_ptr (1/2) --- libs/ardour/ardour/session.h | 3 +-- libs/ardour/ardour/ticker.h | 1 - libs/ardour/audiosource.cc | 2 -- libs/ardour/import.cc | 6 ++---- libs/ardour/wscript | 1 - libs/backends/jack/jack_audiobackend.cc | 1 - libs/backends/jack/jack_connection.cc | 6 ++---- libs/backends/jack/jack_utils.cc | 2 -- libs/backends/portaudio/winmmemidi_input_device.h | 4 +--- libs/backends/portaudio/winmmemidi_output_device.h | 4 +--- libs/pbd/openuri.cc | 3 +-- libs/waveview/waveview/wave_view.h | 4 +--- 12 files changed, 9 insertions(+), 28 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 67ba2eacb8..85a9bb2534 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -47,7 +47,6 @@ #include #include -#include #include #include @@ -1553,7 +1552,7 @@ private: bool loop_changing; samplepos_t last_loopend; - boost::scoped_ptr _session_dir; + const std::unique_ptr _session_dir; void hookup_io (); void graph_reordered (bool called_from_backend); diff --git a/libs/ardour/ardour/ticker.h b/libs/ardour/ardour/ticker.h index cf343924dd..04ac19eb8f 100644 --- a/libs/ardour/ardour/ticker.h +++ b/libs/ardour/ardour/ticker.h @@ -21,7 +21,6 @@ */ #include -#include #include "pbd/signals.h" diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 8441a9385a..80e48f6369 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -49,8 +49,6 @@ #include #include "pbd/gstdio_compat.h" -#include - #include #include diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 59708955bb..1a73351d0e 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -40,7 +40,6 @@ #include "pbd/gstdio_compat.h" #include -#include #include #include "pbd/basename.h" @@ -544,8 +543,7 @@ Session::deinterlace_midi_region (std::shared_ptr mr) smf->session_saved(); //TODO: should we just expose flush_midi() instead? /* open the SMF file for reading */ - boost::scoped_ptr smf_reader; - smf_reader.reset (new Evoral::SMF()); + const std::unique_ptr smf_reader (new Evoral::SMF()); if (smf_reader->open (source_path)) { throw Evoral::SMF::FileError (source_path); } @@ -647,7 +645,7 @@ Session::import_files (ImportStatus& status) std::shared_ptr source; const DataType type = SMFSource::safe_midi_file_extension (*p) ? DataType::MIDI : DataType::AUDIO; - boost::scoped_ptr smf_reader; + std::unique_ptr smf_reader; if (type == DataType::AUDIO) { try { diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 6da16f8c45..30f6e861a3 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -364,7 +364,6 @@ def configure(conf): conf.write_config_header('libardour-config.h', remove=False) # Boost headers - autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp') autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp') if conf.env['WINDOWS_VST_SUPPORT'] == True: diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc index 69e599d3c7..14e5362ee9 100644 --- a/libs/backends/jack/jack_audiobackend.cc +++ b/libs/backends/jack/jack_audiobackend.cc @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/libs/backends/jack/jack_connection.cc b/libs/backends/jack/jack_connection.cc index 617fe48cbb..207c4add79 100644 --- a/libs/backends/jack/jack_connection.cc +++ b/libs/backends/jack/jack_connection.cc @@ -18,8 +18,6 @@ */ #include -#include - #include #include "pbd/epa.h" @@ -63,7 +61,7 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2 */ EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa (); - boost::scoped_ptr current_epa; + std::unique_ptr current_epa; /* revert all environment settings back to whatever they were when * ardour started, because ardour's startup script may have reset @@ -97,7 +95,7 @@ int JackConnection::open () { EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa (); - boost::scoped_ptr current_epa; + std::unique_ptr current_epa; jack_status_t status; close (); diff --git a/libs/backends/jack/jack_utils.cc b/libs/backends/jack/jack_utils.cc index d9d89a0783..7ef20913c6 100644 --- a/libs/backends/jack/jack_utils.cc +++ b/libs/backends/jack/jack_utils.cc @@ -42,8 +42,6 @@ #include #endif -#include - #include "pbd/gstdio_compat.h" #include diff --git a/libs/backends/portaudio/winmmemidi_input_device.h b/libs/backends/portaudio/winmmemidi_input_device.h index 7fd830f7fa..3e7e1b728c 100644 --- a/libs/backends/portaudio/winmmemidi_input_device.h +++ b/libs/backends/portaudio/winmmemidi_input_device.h @@ -27,8 +27,6 @@ #include -#include - #include namespace ARDOUR { @@ -95,7 +93,7 @@ private: // data std::string m_name; // can't use unique_ptr yet - boost::scoped_ptr > m_midi_buffer; + const std::unique_ptr > m_midi_buffer; std::unique_ptr m_sysex_buffer; }; diff --git a/libs/backends/portaudio/winmmemidi_output_device.h b/libs/backends/portaudio/winmmemidi_output_device.h index 8ba96c1d88..7f3c8f59b3 100644 --- a/libs/backends/portaudio/winmmemidi_output_device.h +++ b/libs/backends/portaudio/winmmemidi_output_device.h @@ -27,8 +27,6 @@ #include -#include - #include #define MaxWinMidiEventSize 256 @@ -98,7 +96,7 @@ private: // Data bool m_thread_running; bool m_thread_quit; - boost::scoped_ptr > m_midi_buffer; + const std::unique_ptr > m_midi_buffer; }; } // namespace ARDOUR diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index 648b60dbda..35666fc472 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -22,7 +22,6 @@ #include "libpbd-config.h" #endif -#include #include #include @@ -55,7 +54,7 @@ PBD::open_uri (const char* uri) return cocoa_open_url (uri); #else EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa (); - boost::scoped_ptr current_epa; + std::unique_ptr current_epa; /* revert all environment settings back to whatever they were when ardour started */ diff --git a/libs/waveview/waveview/wave_view.h b/libs/waveview/waveview/wave_view.h index f9b7175039..5a033bdb5a 100644 --- a/libs/waveview/waveview/wave_view.h +++ b/libs/waveview/waveview/wave_view.h @@ -23,8 +23,6 @@ #include -#include - #include #include "ardour/types.h" @@ -152,7 +150,7 @@ private: std::shared_ptr _region; - boost::scoped_ptr _props; + const std::unique_ptr _props; mutable std::shared_ptr _image;