#include <dcp/atmos_asset.h>
+using std::make_shared;
using std::shared_ptr;
shared_ptr<dcp::AtmosAsset>
AtmosMetadata::create (dcp::Fraction edit_rate) const
{
- return shared_ptr<dcp::AtmosAsset> (new dcp::AtmosAsset(edit_rate, _first_frame, _max_channel_count, _max_object_count, _atmos_version));
+ return make_shared<dcp::AtmosAsset>(edit_rate, _first_frame, _max_channel_count, _max_object_count, _atmos_version);
}
/* You can't call this with varying channel counts */
DCPOMATIC_ASSERT (!_tail || in->channels() == _tail->channels());
- shared_ptr<AudioBuffers> out (new AudioBuffers (in->channels(), in->frames()));
+ auto out = make_shared<AudioBuffers>(in->channels(), in->frames());
if (in->frames() > _samples) {
*/
-#include "audio_filter_graph.h"
+
#include "audio_buffers.h"
+#include "audio_filter_graph.h"
#include "compose.hpp"
extern "C" {
#include <libavfilter/buffersink.h>
#include "i18n.h"
-using std::string;
+
using std::cout;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
+
AudioFilterGraph::AudioFilterGraph (int sample_rate, int channels)
: _sample_rate (sample_rate)
the constructor) so we need to create new buffers with some extra
silent channels.
*/
- shared_ptr<AudioBuffers> extended_buffers (new AudioBuffers (process_channels, buffers->frames()));
+ auto extended_buffers = make_shared<AudioBuffers>(process_channels, buffers->frames());
for (int i = 0; i < buffers->channels(); ++i) {
extended_buffers->copy_channel_from (buffers.get(), i, i);
}
*/
+
+#include "cinema.h"
+#include "colour_conversion.h"
+#include "compose.hpp"
#include "config.h"
+#include "cross.h"
+#include "crypto.h"
+#include "dcp_content_type.h"
+#include "dkdm_recipient.h"
+#include "dkdm_wrapper.h"
+#include "film.h"
#include "filter.h"
+#include "log.h"
#include "ratio.h"
#include "types.h"
-#include "log.h"
-#include "dcp_content_type.h"
-#include "colour_conversion.h"
-#include "cinema.h"
#include "util.h"
-#include "cross.h"
-#include "film.h"
-#include "dkdm_wrapper.h"
-#include "compose.hpp"
-#include "crypto.h"
-#include "dkdm_recipient.h"
-#include <dcp/raw_convert.h>
-#include <dcp/name_format.h>
#include <dcp/certificate_chain.h>
+#include <dcp/name_format.h>
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <glib.h>
#include <libxml++/libxml++.h>
#include "i18n.h"
-using std::vector;
+
using std::cout;
+using std::dynamic_pointer_cast;
using std::ifstream;
-using std::string;
using std::list;
-using std::min;
+using std::make_shared;
using std::max;
+using std::min;
using std::remove;
using std::shared_ptr;
-using std::make_shared;
-using boost::optional;
-using std::dynamic_pointer_cast;
+using std::string;
+using std::vector;
using boost::algorithm::trim;
+using boost::optional;
using dcp::raw_convert;
+
Config* Config::_instance = 0;
int const Config::_current_version = 3;
boost::signals2::signal<void ()> Config::FailedToLoad;
boost::signals2::signal<void (string)> Config::Warning;
boost::signals2::signal<bool (Config::BadReason)> Config::Bad;
+
/** Construct default configuration */
Config::Config ()
/* DKDMs are not considered a thing to reset on set_defaults() */
_dkdms = dynamic_pointer_cast<DKDMGroup> (DKDMBase::read (f.node_child("DKDMGroup")));
} else {
/* Old-style: one or more DKDM nodes */
- _dkdms.reset (new DKDMGroup ("root"));
+ _dkdms = make_shared<DKDMGroup>("root");
for (auto i: f.node_children("DKDM")) {
_dkdms->add (DKDMBase::read (i));
}
{
_dkdm_recipients.clear ();
for (auto i: f.node_children("DKDMRecipient")) {
- _dkdm_recipients.push_back (shared_ptr<DKDMRecipient>(new DKDMRecipient(i)));
+ _dkdm_recipients.push_back (make_shared<DKDMRecipient>(i));
}
}
You should have received a copy of the GNU General Public License
along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
*/
-#include "image_content.h"
-#include "video_content.h"
-#include "image_examiner.h"
#include "compose.hpp"
+#include "exceptions.h"
#include "film.h"
-#include "job.h"
#include "frame_rate_change.h"
-#include "exceptions.h"
+#include "image_content.h"
+#include "image_examiner.h"
#include "image_filename_sorter.h"
+#include "job.h"
+#include "video_content.h"
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <iostream>
#include "i18n.h"
-using std::string;
+
using std::cout;
using std::list;
-using std::vector;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
+using std::vector;
using namespace dcpomatic;
+
ImageContent::ImageContent (boost::filesystem::path p)
{
- video.reset (new VideoContent (this));
+ video = make_shared<VideoContent>(this);
if (boost::filesystem::is_regular_file (p) && valid_image_file (p)) {
add_path (p);
job->sub (_("Scanning image files"));
vector<boost::filesystem::path> paths;
int n = 0;
- for (boost::filesystem::directory_iterator i(*_path_to_scan); i != boost::filesystem::directory_iterator(); ++i) {
- if (boost::filesystem::is_regular_file (i->path()) && valid_image_file (i->path())) {
- paths.push_back (i->path());
+ for (auto i: boost::filesystem::directory_iterator(*_path_to_scan)) {
+ if (boost::filesystem::is_regular_file(i.path()) && valid_image_file(i.path())) {
+ paths.push_back (i.path());
}
++n;
if ((n % 1000) == 0) {
Content::examine (film, job);
- shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
+ auto examiner = make_shared<ImageExaminer>(film, shared_from_this(), job);
video->take_from_examiner (examiner);
set_default_colour_conversion ();
}
*/
-#include "json_server.h"
-#include "job_manager.h"
-#include "job.h"
-#include "util.h"
#include "film.h"
+#include "job.h"
+#include "job_manager.h"
+#include "json_server.h"
#include "transcode_job.h"
+#include "util.h"
#include <dcp/raw_convert.h>
#include <boost/asio.hpp>
#include <boost/bind/bind.hpp>
#include <iostream>
-using std::string;
using std::cout;
-using std::map;
+using std::dynamic_pointer_cast;
using std::list;
-using boost::thread;
+using std::make_shared;
+using std::map;
using std::shared_ptr;
-using std::dynamic_pointer_cast;
+using std::string;
using boost::asio::ip::tcp;
+using boost::thread;
using dcp::raw_convert;
tcp::acceptor a (io_service, tcp::endpoint (tcp::v4 (), port));
while (true) {
try {
- shared_ptr<tcp::socket> s (new tcp::socket (io_service));
+ auto s = make_shared<tcp::socket>(io_service);
a.accept (*s);
handle (s);
}
DCPOMATIC_ASSERT ((part_frames[0] + part_frames[1]) <= audio->frames());
if (part_frames[0]) {
- shared_ptr<AudioBuffers> part (new AudioBuffers(audio, part_frames[0], 0));
- _audio_reel->write (part);
+ _audio_reel->write (make_shared<AudioBuffers>(audio, part_frames[0], 0));
}
if (part_frames[1]) {
- audio.reset (new AudioBuffers(audio, part_frames[1], part_frames[0]));
+ audio = make_shared<AudioBuffers>(audio, part_frames[1], part_frames[0]);
} else {
audio.reset ();
}
*/
-#include "zipper.h"
-#include "exceptions.h"
#include "dcpomatic_assert.h"
+#include "exceptions.h"
+#include "zipper.h"
#include <zip.h>
#include <boost/filesystem.hpp>
#include <stdexcept>
-using std::string;
+using std::make_shared;
using std::runtime_error;
using std::shared_ptr;
+using std::string;
Zipper::Zipper (boost::filesystem::path file)
void
Zipper::add (string name, string content)
{
- shared_ptr<string> copy(new string(content));
+ auto copy = make_shared<string>(content);
_store.push_back (copy);
auto source = zip_source_buffer (_zip, copy->c_str(), copy->length(), 0);
if (zip_close(_zip) == -1) {
throw runtime_error ("failed to close ZIP archive");
}
- _zip = 0;
+ _zip = nullptr;
}
int const r = d->ShowModal ();
if (r == wxID_OK && d->check_path() && maybe_save_film<FilmChangedDuplicatingDialog>()) {
- shared_ptr<Film> film (new Film (d->path()));
+ auto film = make_shared<Film>(d->path());
film->copy_from (_film);
film->set_name (d->path().filename().generic_string());
film->write_metadata ();
*/
-#include "job_manager_view.h"
#include "batch_job_view.h"
+#include "job_manager_view.h"
#include "normal_job_view.h"
#include "wx_util.h"
-#include "lib/job_manager.h"
+#include "lib/compose.hpp"
+#include "lib/exceptions.h"
#include "lib/job.h"
+#include "lib/job_manager.h"
#include "lib/util.h"
-#include "lib/exceptions.h"
-#include "lib/compose.hpp"
#include <iostream>
-using std::string;
+using std::cout;
using std::list;
using std::map;
using std::min;
-using std::cout;
using std::shared_ptr;
+using std::string;
using std::weak_ptr;
using boost::bind;
#if BOOST_VERSION >= 106100
DCPOMATIC_ENABLE_WARNINGS
+using std::dynamic_pointer_cast;
+using std::make_shared;
using std::map;
-using std::string;
using std::shared_ptr;
+using std::string;
using boost::bind;
-using std::dynamic_pointer_cast;
using boost::optional;
using namespace dcpomatic;
#if BOOST_VERSION >= 106100
/* XXX: assuming that all FFmpeg streams have bitmap subs */
if (_stream->colours().empty()) {
_job_manager_connection = JobManager::instance()->ActiveJobsChanged.connect(boost::bind(&SubtitleAppearanceDialog::active_jobs_changed, this, _1));
- _job = JobManager::instance()->add(shared_ptr<Job>(new ExamineFFmpegSubtitlesJob(film, ff)));
+ _job = JobManager::instance()->add(make_shared<ExamineFFmpegSubtitlesJob>(film, ff));
}
}