Move make_unique to its own header file

Rebuilding the entire project after touching util.h gets old fast.
This commit is contained in:
Thomas Goyne 2014-04-23 13:53:24 -07:00
parent c248dc56da
commit 6fc4c8da14
101 changed files with 506 additions and 474 deletions

View file

@ -65,6 +65,7 @@
<ClInclude Include="$(SrcDir)include\libaegisub\line_iterator.h" />
<ClInclude Include="$(SrcDir)include\libaegisub\line_wrap.h" />
<ClInclude Include="$(SrcDir)include\libaegisub\log.h" />
<ClInclude Include="$(SrcDir)include\libaegisub\make_unique.h" />
<ClInclude Include="$(SrcDir)include\libaegisub\mru.h" />
<ClInclude Include="$(SrcDir)include\libaegisub\of_type_adaptor.h" />
<ClInclude Include="$(SrcDir)include\libaegisub\option.h" />

View file

@ -170,6 +170,9 @@
<ClInclude Include="$(SrcDir)include\libaegisub\character_count.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)include\libaegisub\make_unique.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SrcDir)windows\lagi_pre.cpp">

View file

@ -17,6 +17,7 @@
#include "libaegisub/file_mapping.h"
#include "libaegisub/fs.h"
#include "libaegisub/make_unique.h"
#include "libaegisub/util.h"
#include <boost/filesystem.hpp>
@ -58,7 +59,7 @@ char *map(int64_t s_offset, uint64_t length, boost::interprocess::mode_t mode,
throw std::bad_alloc();
try {
region = agi::util::make_unique<mapped_region>(file, mode, mapping_start, static_cast<size_t>(length));
region = agi::make_unique<mapped_region>(file, mode, mapping_start, static_cast<size_t>(length));
}
catch (interprocess_exception const&) {
throw agi::fs::FileSystemUnknownError("Failed mapping a view of the file");

View file

@ -21,6 +21,7 @@
#include <libaegisub/access.h>
#include "libaegisub/fs.h"
#include "libaegisub/log.h"
#include "libaegisub/make_unique.h"
#include "libaegisub/path.h"
#include "libaegisub/util.h"
@ -34,7 +35,7 @@ std::unique_ptr<std::istream> Open(fs::path const& file, bool binary) {
LOG_D("agi/io/open/file") << file;
acs::CheckFileRead(file);
auto stream = util::make_unique<boost::filesystem::ifstream>(file, (binary ? std::ios::binary : std::ios::in));
auto stream = agi::make_unique<boost::filesystem::ifstream>(file, (binary ? std::ios::binary : std::ios::in));
if (stream->fail())
throw IOFatal("Unknown fatal error as occurred");
@ -56,7 +57,7 @@ Save::Save(fs::path const& file, bool binary)
// Not an error
}
fp = util::make_unique<boost::filesystem::ofstream>(tmp_name, binary ? std::ios::binary : std::ios::out);
fp = agi::make_unique<boost::filesystem::ofstream>(tmp_name, binary ? std::ios::binary : std::ios::out);
if (!fp->good())
throw fs::WriteDenied(tmp_name);
}

View file

@ -21,7 +21,7 @@
#include "libaegisub/fs.h"
#include "libaegisub/io.h"
#include "libaegisub/log.h"
#include "libaegisub/util.h"
#include "libaegisub/make_unique.h"
#include <boost/interprocess/streams/bufferstream.hpp>

View file

@ -25,7 +25,7 @@
#include <libaegisub/color.h>
#include <libaegisub/log.h>
#include <libaegisub/option_value.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
@ -75,7 +75,7 @@ std::unique_ptr<OptionValue> ConfigVisitor::ReadArray(json::Array const& src, st
arr.push_back((typename OptionValueType::value_type::value_type)(obj.begin()->second));
}
return util::make_unique<OptionValueType>(name, std::move(arr));
return agi::make_unique<OptionValueType>(name, std::move(arr));
}
void ConfigVisitor::Visit(const json::Array& array) {
@ -107,11 +107,11 @@ void ConfigVisitor::Visit(const json::Array& array) {
}
void ConfigVisitor::Visit(const json::Integer& number) {
AddOptionValue(util::make_unique<OptionValueInt>(name, number));
AddOptionValue(agi::make_unique<OptionValueInt>(name, number));
}
void ConfigVisitor::Visit(const json::Double& number) {
AddOptionValue(util::make_unique<OptionValueDouble>(name, number));
AddOptionValue(agi::make_unique<OptionValueDouble>(name, number));
}
void ConfigVisitor::Visit(const json::String& string) {
@ -121,14 +121,14 @@ void ConfigVisitor::Visit(const json::String& string) {
(size >= 10 && boost::starts_with(string, "rgb(")) ||
((size == 9 || size == 10) && boost::starts_with(string, "&H")))
{
AddOptionValue(util::make_unique<OptionValueColor>(name, string));
AddOptionValue(agi::make_unique<OptionValueColor>(name, string));
} else {
AddOptionValue(util::make_unique<OptionValueString>(name, string));
AddOptionValue(agi::make_unique<OptionValueString>(name, string));
}
}
void ConfigVisitor::Visit(const json::Boolean& boolean) {
AddOptionValue(util::make_unique<OptionValueBool>(name, boolean));
AddOptionValue(agi::make_unique<OptionValueBool>(name, boolean));
}
void ConfigVisitor::Visit(const json::Null& null) {

View file

@ -21,7 +21,7 @@
#include "libaegisub/path.h"
#include "libaegisub/fs.h"
#include "libaegisub/util.h"
#include "libaegisub/make_unique.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>

View file

@ -21,7 +21,7 @@
#include "libaegisub/charset_conv.h"
#include "libaegisub/file_mapping.h"
#include "libaegisub/line_iterator.h"
#include "libaegisub/util.h"
#include "libaegisub/make_unique.h"
#include <boost/algorithm/string.hpp>
#include <boost/interprocess/streams/bufferstream.hpp>
@ -33,7 +33,7 @@ using boost::phoenix::placeholders::_1;
namespace agi {
Thesaurus::Thesaurus(agi::fs::path const& dat_path, agi::fs::path const& idx_path)
: dat(util::make_unique<read_file_mapping>(dat_path))
: dat(make_unique<read_file_mapping>(dat_path))
{
read_file_mapping idx_file(idx_path);
boost::interprocess::ibufferstream idx(idx_file.read(), static_cast<size_t>(idx_file.size()));

View file

@ -0,0 +1,24 @@
// Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// Aegisub Project http://www.aegisub.org/
#include <memory>
namespace agi {
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
}

View file

@ -57,11 +57,6 @@ namespace agi {
/// @param name New name for the thread
void SetThreadName(const char *name);
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
/// A thin wrapper around this_thread::sleep_for that uses std::thread on
/// Windows (to avoid having to compile boost.thread) and boost::thread
/// elsewhere (because libstcc++ 4.7 is missing it).

View file

@ -23,7 +23,7 @@
#include <unistd.h>
#include "libaegisub/log.h"
#include "libaegisub/util.h"
#include "libaegisub/make_unique.h"
namespace agi {
namespace log {

View file

@ -16,7 +16,7 @@
/// @brief Unix utility methods.
/// @ingroup libaegisub unix
#include "libaegisub/util.h"
#include "libaegisub/make_unique.h"
#include <boost/thread.hpp>

View file

@ -23,7 +23,7 @@
#include "libaegisub/log.h"
#include "libaegisub/charset_conv_win.h"
#include "libaegisub/util.h"
#include "libaegisub/make_unique.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

View file

@ -20,7 +20,7 @@
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/filesystem.hpp>

View file

@ -37,7 +37,7 @@
#include <libaegisub/of_type_adaptor.h>
#include <libaegisub/split.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/join.hpp>
@ -171,7 +171,7 @@ std::vector<std::unique_ptr<AssDialogueBlock>> AssDialogue::ParseTags() const {
// Empty line, make an empty block
if (Text.get().empty()) {
Blocks.push_back(agi::util::make_unique<AssDialogueBlockPlain>());
Blocks.push_back(agi::make_unique<AssDialogueBlockPlain>());
return Blocks;
}
@ -196,11 +196,11 @@ std::vector<std::unique_ptr<AssDialogueBlock>> AssDialogue::ParseTags() const {
if (work.size() && work.find('\\') == std::string::npos) {
//We've found an override block with no backslashes
//We're going to assume it's a comment and not consider it an override block
Blocks.push_back(agi::util::make_unique<AssDialogueBlockComment>(work));
Blocks.push_back(agi::make_unique<AssDialogueBlockComment>(work));
}
else {
// Create block
auto block = agi::util::make_unique<AssDialogueBlockOverride>(work);
auto block = agi::make_unique<AssDialogueBlockOverride>(work);
block->ParseTags();
// Look for \p in block
@ -228,9 +228,9 @@ plain:
}
if (drawingLevel == 0)
Blocks.push_back(agi::util::make_unique<AssDialogueBlockPlain>(work));
Blocks.push_back(agi::make_unique<AssDialogueBlockPlain>(work));
else
Blocks.push_back(agi::util::make_unique<AssDialogueBlockDrawing>(work, drawingLevel));
Blocks.push_back(agi::make_unique<AssDialogueBlockDrawing>(work, drawingLevel));
}
return Blocks;

View file

@ -38,7 +38,7 @@
#include "utils.h"
#include <libaegisub/color.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp>
@ -114,7 +114,7 @@ template<> agi::Color AssOverrideParameter::Get<agi::Color>() const {
template<> AssDialogueBlockOverride *AssOverrideParameter::Get<AssDialogueBlockOverride*>() const {
if (!block.get()) {
block = agi::util::make_unique<AssDialogueBlockOverride>(Get<std::string>());
block = agi::make_unique<AssDialogueBlockOverride>(Get<std::string>());
block->ParseTags();
}
return block.get();

View file

@ -21,7 +21,7 @@
#include "ass_style.h"
#include "subtitle_format.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string/case_conv.hpp>
@ -105,12 +105,12 @@ void AssParser::ParseStyleLine(std::string const& data) {
void AssParser::ParseFontLine(std::string const& data) {
if (boost::starts_with(data, "fontname: "))
attach = agi::util::make_unique<AssAttachment>(data, AssEntryGroup::FONT);
attach = agi::make_unique<AssAttachment>(data, AssEntryGroup::FONT);
}
void AssParser::ParseGraphicsLine(std::string const& data) {
if (boost::starts_with(data, "filename: "))
attach = agi::util::make_unique<AssAttachment>(data, AssEntryGroup::GRAPHIC);
attach = agi::make_unique<AssAttachment>(data, AssEntryGroup::GRAPHIC);
}
void AssParser::AddLine(std::string const& data) {

View file

@ -39,7 +39,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/io.h>
#include <libaegisub/line_iterator.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
@ -67,7 +67,7 @@ void AssStyleStorage::Load(agi::fs::path const& filename) {
auto in = agi::io::Open(file);
for (auto const& line : agi::line_iterator<std::string>(*in)) {
try {
style.emplace_back(agi::util::make_unique<AssStyle>(line));
style.emplace_back(agi::make_unique<AssStyle>(line));
} catch(...) {
/* just ignore invalid lines for now */
}

View file

@ -52,7 +52,7 @@
#include "utils.h"
#include "video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
@ -551,10 +551,10 @@ AudioDisplay::AudioDisplay(wxWindow *parent, AudioController *controller, agi::C
: wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS|wxBORDER_SIMPLE)
, audio_open_connection(controller->AddAudioOpenListener(&AudioDisplay::OnAudioOpen, this))
, context(context)
, audio_renderer(agi::util::make_unique<AudioRenderer>())
, audio_renderer(agi::make_unique<AudioRenderer>())
, controller(controller)
, scrollbar(agi::util::make_unique<AudioDisplayScrollbar>(this))
, timeline(agi::util::make_unique<AudioDisplayTimeline>(this))
, scrollbar(agi::make_unique<AudioDisplayScrollbar>(this))
, timeline(agi::make_unique<AudioDisplayTimeline>(this))
{
style_ranges[0] = AudioStyle_Normal;
@ -722,7 +722,7 @@ void AudioDisplay::ReloadRenderingSettings()
if (OPT_GET("Audio/Spectrum")->GetBool())
{
colour_scheme_name = OPT_GET("Colour/Audio Display/Spectrum")->GetString();
auto audio_spectrum_renderer = agi::util::make_unique<AudioSpectrumRenderer>(colour_scheme_name);
auto audio_spectrum_renderer = agi::make_unique<AudioSpectrumRenderer>(colour_scheme_name);
int64_t spectrum_quality = OPT_GET("Audio/Renderer/Spectrum/Quality")->GetInt();
#ifdef WITH_FFTW3
@ -744,7 +744,7 @@ void AudioDisplay::ReloadRenderingSettings()
else
{
colour_scheme_name = OPT_GET("Colour/Audio Display/Waveform")->GetString();
audio_renderer_provider = agi::util::make_unique<AudioWaveformRenderer>(colour_scheme_name);
audio_renderer_provider = agi::make_unique<AudioWaveformRenderer>(colour_scheme_name);
}
audio_renderer->SetRenderer(audio_renderer_provider.get());
@ -1087,7 +1087,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event)
if (markers.size())
{
RemoveTrackCursor();
audio_marker = agi::util::make_unique<AudioMarkerInteractionObject>(markers, timing, this, (wxMouseButton)event.GetButton());
audio_marker = agi::make_unique<AudioMarkerInteractionObject>(markers, timing, this, (wxMouseButton)event.GetButton());
SetDraggedObject(audio_marker.get());
return;
}

View file

@ -35,7 +35,7 @@
#include "selection_controller.h"
#include "utils.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/locale/boundary.hpp>
@ -66,7 +66,7 @@ AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c)
, audio_opened(c->audioController->AddAudioOpenListener(&AudioKaraoke::OnAudioOpened, this))
, audio_closed(c->audioController->AddAudioCloseListener(&AudioKaraoke::OnAudioClosed, this))
, active_line_changed(c->selectionController->AddActiveLineListener(&AudioKaraoke::OnActiveLineChanged, this))
, kara(agi::util::make_unique<AssKaraoke>())
, kara(agi::make_unique<AssKaraoke>())
{
using std::bind;

View file

@ -26,7 +26,7 @@
#include "pen.h"
#include "video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
@ -48,7 +48,7 @@ AudioMarkerProviderKeyframes::AudioMarkerProviderKeyframes(agi::Context *c, cons
, timecode_slot(vc->AddTimecodesListener(&AudioMarkerProviderKeyframes::Update, this))
, enabled_slot(OPT_SUB(opt_name, &AudioMarkerProviderKeyframes::Update, this))
, enabled_opt(OPT_GET(opt_name))
, style(agi::util::make_unique<Pen>("Colour/Audio Display/Keyframe"))
, style(agi::make_unique<Pen>("Colour/Audio Display/Keyframe"))
{
Update();
}
@ -122,7 +122,7 @@ void VideoPositionMarkerProvider::Update(int frame_number) {
void VideoPositionMarkerProvider::OptChanged(agi::OptionValue const& opt) {
if (opt.GetBool()) {
video_seek_slot.Unblock();
marker = agi::util::make_unique<VideoPositionMarker>();
marker = agi::make_unique<VideoPositionMarker>();
marker->SetPosition(vc->GetFrameN());
}
else {
@ -137,7 +137,7 @@ void VideoPositionMarkerProvider::GetMarkers(const TimeRange &range, AudioMarker
}
SecondsMarkerProvider::SecondsMarkerProvider()
: pen(agi::util::make_unique<Pen>("Colour/Audio Display/Seconds Line", 1, wxPENSTYLE_DOT))
: pen(agi::make_unique<Pen>("Colour/Audio Display/Seconds Line", 1, wxPENSTYLE_DOT))
, enabled(OPT_GET("Audio/Display/Draw/Seconds"))
, enabled_opt_changed(OPT_SUB("Audio/Display/Draw/Seconds", &SecondsMarkerProvider::EnabledOptChanged, this))
{

View file

@ -42,7 +42,7 @@
#include "options.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <alsa/asoundlib.h>
@ -461,7 +461,7 @@ void AlsaPlayer::SetVolume(double vol)
std::unique_ptr<AudioPlayer> CreateAlsaPlayer(AudioProvider *provider, wxWindow *)
{
return agi::util::make_unique<AlsaPlayer>(provider);
return agi::make_unique<AlsaPlayer>(provider);
}
#endif // WITH_ALSA

View file

@ -41,7 +41,7 @@
#include "utils.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <mmsystem.h>
#include <dsound.h>
@ -368,7 +368,7 @@ void DirectSoundPlayerThread::Stop() {
}
std::unique_ptr<AudioPlayer> CreateDirectSoundPlayer(AudioProvider *provider, wxWindow *parent) {
return agi::util::make_unique<DirectSoundPlayer>(provider, parent);
return agi::make_unique<DirectSoundPlayer>(provider, parent);
}
#endif // WITH_DIRECTSOUND

View file

@ -43,7 +43,7 @@
#include <libaegisub/scoped_ptr.h>
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <mmsystem.h>
#include <process.h>
@ -821,7 +821,7 @@ DirectSoundPlayer2::DirectSoundPlayer2(AudioProvider *provider, wxWindow *parent
try
{
thread = agi::util::make_unique<DirectSoundPlayer2Thread>(provider, WantedLatency, BufferLength, parent);
thread = agi::make_unique<DirectSoundPlayer2Thread>(provider, WantedLatency, BufferLength, parent);
}
catch (const char *msg)
{
@ -936,7 +936,7 @@ void DirectSoundPlayer2::SetVolume(double vol)
}
std::unique_ptr<AudioPlayer> CreateDirectSound2Player(AudioProvider *provider, wxWindow *parent) {
return agi::util::make_unique<DirectSoundPlayer2>(provider, parent);
return agi::make_unique<DirectSoundPlayer2>(provider, parent);
}
#endif // WITH_DIRECTSOUND

View file

@ -40,7 +40,7 @@
#include "utils.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#ifdef __WINDOWS__
#include <al.h>
@ -286,7 +286,7 @@ int64_t OpenALPlayer::GetCurrentPosition()
std::unique_ptr<AudioPlayer> CreateOpenALPlayer(AudioProvider *provider, wxWindow *)
{
return agi::util::make_unique<OpenALPlayer>(provider);
return agi::make_unique<OpenALPlayer>(provider);
}
#endif // WITH_OPENAL

View file

@ -40,7 +40,7 @@
#include "utils.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@ -281,7 +281,7 @@ int64_t OSSPlayer::GetCurrentPosition()
}
std::unique_ptr<AudioPlayer> CreateOSSPlayer(AudioProvider *provider, wxWindow *) {
return agi::util::make_unique<OSSPlayer>(provider);
return agi::make_unique<OSSPlayer>(provider);
}
#endif // WITH_OSS

View file

@ -42,7 +42,7 @@
#include "utils.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
DEFINE_SIMPLE_EXCEPTION(PortAudioError, agi::AudioPlayerOpenError, "audio/player/open/portaudio")
@ -282,7 +282,7 @@ bool PortAudioPlayer::IsPlaying() {
}
std::unique_ptr<AudioPlayer> CreatePortAudioPlayer(AudioProvider *provider, wxWindow *) {
return agi::util::make_unique<PortAudioPlayer>(provider);
return agi::make_unique<PortAudioPlayer>(provider);
}
#endif // WITH_PORTAUDIO

View file

@ -40,7 +40,7 @@
#include "utils.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <cstdio>
#include <pulse/pulseaudio.h>
@ -334,6 +334,6 @@ void PulseAudioPlayer::pa_stream_notify(pa_stream *p, PulseAudioPlayer *thread)
}
std::unique_ptr<AudioPlayer> CreatePulseAudioPlayer(AudioProvider *provider, wxWindow *) {
return agi::util::make_unique<PulseAudioPlayer>(provider);
return agi::make_unique<PulseAudioPlayer>(provider);
}
#endif // WITH_LIBPULSE

View file

@ -43,7 +43,7 @@
#include <libaegisub/background_runner.h>
#include <libaegisub/fs.h>
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/range/iterator_range.hpp>

View file

@ -45,7 +45,7 @@
#include <libaegisub/charset_conv.h>
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <mutex>
@ -146,6 +146,6 @@ void AvisynthAudioProvider::FillBuffer(void *buf, int64_t start, int64_t count)
}
std::unique_ptr<AudioProvider> CreateAvisynthAudioProvider(agi::fs::path const& file, agi::BackgroundRunner *) {
return agi::util::make_unique<AvisynthAudioProvider>(file);
return agi::make_unique<AvisynthAudioProvider>(file);
}
#endif

View file

@ -24,7 +24,7 @@
#include "audio_controller.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <limits>
@ -131,7 +131,7 @@ public:
}
};
/// Sample doubler with linear interpolation for the agi::util::make_unique<samples>
/// Sample doubler with linear interpolation for the agi::make_unique<samples>
/// Requires 16-bit mono input
class SampleDoublingAudioProvider final : public AudioProviderWrapper {
public:
@ -177,25 +177,25 @@ std::unique_ptr<AudioProvider> CreateConvertAudioProvider(std::unique_ptr<AudioP
if (provider->AreSamplesFloat()) {
LOG_D("audio_provider") << "Converting float to S16";
if (provider->GetBytesPerSample() == sizeof(float))
provider = agi::util::make_unique<FloatConvertAudioProvider<float, int16_t>>(std::move(provider));
provider = agi::make_unique<FloatConvertAudioProvider<float, int16_t>>(std::move(provider));
else
provider = agi::util::make_unique<FloatConvertAudioProvider<double, int16_t>>(std::move(provider));
provider = agi::make_unique<FloatConvertAudioProvider<double, int16_t>>(std::move(provider));
}
if (provider->GetBytesPerSample() != 2) {
LOG_D("audio_provider") << "Converting " << provider->GetBytesPerSample() << " bytes per sample or wrong endian to S16";
provider = agi::util::make_unique<BitdepthConvertAudioProvider<int16_t>>(std::move(provider));
provider = agi::make_unique<BitdepthConvertAudioProvider<int16_t>>(std::move(provider));
}
// We currently only support mono audio
if (provider->GetChannels() != 1) {
LOG_D("audio_provider") << "Downmixing to mono from " << provider->GetChannels() << " channels";
provider = agi::util::make_unique<DownmixAudioProvider>(std::move(provider));
provider = agi::make_unique<DownmixAudioProvider>(std::move(provider));
}
// Some players don't like low sample rate audio
while (provider->GetSampleRate() < 32000) {
LOG_D("audio_provider") << "Doubling sample rate";
provider = agi::util::make_unique<SampleDoublingAudioProvider>(std::move(provider));
provider = agi::make_unique<SampleDoublingAudioProvider>(std::move(provider));
}
return provider;

View file

@ -35,7 +35,7 @@
#include "include/aegisub/audio_provider.h"
#include <libaegisub/fs.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
@ -89,5 +89,5 @@ public:
std::unique_ptr<AudioProvider> CreateDummyAudioProvider(agi::fs::path const& file, agi::BackgroundRunner *) {
if (!boost::starts_with(file.string(), "dummy-audio:"))
return {};
return agi::util::make_unique<DummyAudioProvider>(file);
return agi::make_unique<DummyAudioProvider>(file);
}

View file

@ -40,7 +40,7 @@
#include "options.h"
#include <libaegisub/fs.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <map>
@ -207,7 +207,7 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) {
}
std::unique_ptr<AudioProvider> CreateFFmpegSourceAudioProvider(agi::fs::path const& file, agi::BackgroundRunner *br) {
return agi::util::make_unique<FFmpegSourceAudioProvider>(file, br);
return agi::make_unique<FFmpegSourceAudioProvider>(file, br);
}
#endif /* WITH_FFMS2 */

View file

@ -23,7 +23,7 @@
#include <libaegisub/file_mapping.h>
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
@ -72,7 +72,7 @@ public:
% (long long)time(nullptr)
% (long long)boost::interprocess::ipcdetail::get_current_process_id());
file = agi::util::make_unique<agi::temp_file_mapping>(cache_dir / filename, num_samples * bytes_per_sample);
file = agi::make_unique<agi::temp_file_mapping>(cache_dir / filename, num_samples * bytes_per_sample);
decoder = std::thread([&] {
int64_t block = 65536;
for (int64_t i = 0; i < num_samples; i += block) {
@ -92,5 +92,5 @@ public:
}
std::unique_ptr<AudioProvider> CreateHDAudioProvider(std::unique_ptr<AudioProvider> src) {
return agi::util::make_unique<HDAudioProvider>(std::move(src));
return agi::make_unique<HDAudioProvider>(std::move(src));
}

View file

@ -18,7 +18,7 @@
#include "include/aegisub/audio_provider.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <memory>
#include <mutex>
@ -41,5 +41,5 @@ public:
}
std::unique_ptr<AudioProvider> CreateLockAudioProvider(std::unique_ptr<AudioProvider> src) {
return agi::util::make_unique<LockAudioProvider>(std::move(src));
return agi::make_unique<LockAudioProvider>(std::move(src));
}

View file

@ -40,7 +40,7 @@
#include <libaegisub/file_mapping.h>
#include <libaegisub/fs.h>
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <vector>
@ -51,7 +51,7 @@ protected:
std::unique_ptr<agi::read_file_mapping> file;
PCMAudioProvider(agi::fs::path const& filename)
: file(agi::util::make_unique<agi::read_file_mapping>(filename))
: file(agi::make_unique<agi::read_file_mapping>(filename))
{
float_samples = false;
}
@ -365,7 +365,7 @@ std::unique_ptr<AudioProvider> CreatePCMAudioProvider(agi::fs::path const& filen
std::string msg;
try {
return agi::util::make_unique<RiffWavPCMAudioProvider>(filename);
return agi::make_unique<RiffWavPCMAudioProvider>(filename);
}
catch (agi::AudioDataNotFoundError const& err) {
msg = "RIFF PCM WAV audio provider: " + err.GetMessage();
@ -376,7 +376,7 @@ std::unique_ptr<AudioProvider> CreatePCMAudioProvider(agi::fs::path const& filen
}
try {
return agi::util::make_unique<Wave64AudioProvider>(filename);
return agi::make_unique<Wave64AudioProvider>(filename);
}
catch (agi::AudioDataNotFoundError const& err) {
msg += "\nWave64 audio provider: " + err.GetMessage();

View file

@ -37,7 +37,7 @@
#include "audio_controller.h"
#include "compat.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <array>
#include <boost/container/stable_vector.hpp>
@ -112,5 +112,5 @@ void RAMAudioProvider::FillBuffer(void *buf, int64_t start, int64_t count) const
}
std::unique_ptr<AudioProvider> CreateRAMAudioProvider(std::unique_ptr<AudioProvider> src) {
return agi::util::make_unique<RAMAudioProvider>(std::move(src));
return agi::make_unique<RAMAudioProvider>(std::move(src));
}

View file

@ -35,7 +35,7 @@
#include "include/aegisub/audio_provider.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <functional>
@ -61,7 +61,7 @@ AudioRendererBitmapCacheBitmapFactory::AudioRendererBitmapCacheBitmapFactory(Aud
std::unique_ptr<wxBitmap> AudioRendererBitmapCacheBitmapFactory::ProduceBlock(int /* i */)
{
return agi::util::make_unique<wxBitmap>(renderer->cache_bitmap_width, renderer->pixel_height, 24);
return agi::make_unique<wxBitmap>(renderer->cache_bitmap_width, renderer->pixel_height, 24);
}
size_t AudioRendererBitmapCacheBitmapFactory::GetBlockSize() const

View file

@ -42,7 +42,7 @@
#include "utils.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
@ -123,7 +123,7 @@ void AudioSpectrumRenderer::RecreateCache()
if (provider)
{
size_t block_count = (size_t)((provider->GetNumSamples() + (size_t)(1<<derivation_dist) - 1) >> derivation_dist);
cache = agi::util::make_unique<AudioSpectrumCache>(block_count, this);
cache = agi::make_unique<AudioSpectrumCache>(block_count, this);
#ifdef WITH_FFTW3
dft_input = fftw_alloc_real(2<<derivation_size);

View file

@ -43,7 +43,7 @@
#include "selection_controller.h"
#include "utils.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/range/algorithm.hpp>
#include <cstdint>
@ -411,7 +411,7 @@ public:
std::unique_ptr<AudioTimingController> CreateDialogueTimingController(agi::Context *c)
{
return agi::util::make_unique<AudioTimingControllerDialogue>(c);
return agi::make_unique<AudioTimingControllerDialogue>(c);
}
AudioTimingControllerDialogue::AudioTimingControllerDialogue(agi::Context *c)

View file

@ -34,7 +34,7 @@
#include "selection_controller.h"
#include "utils.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/adaptor/filtered.hpp>
@ -152,7 +152,7 @@ public:
std::unique_ptr<AudioTimingController> CreateKaraokeTimingController(agi::Context *c, AssKaraoke *kara, agi::signal::Connection& file_changed)
{
return agi::util::make_unique<AudioTimingControllerKaraoke>(c, kara, file_changed);
return agi::make_unique<AudioTimingControllerKaraoke>(c, kara, file_changed);
}
AudioTimingControllerKaraoke::AudioTimingControllerKaraoke(agi::Context *c, AssKaraoke *kara, agi::signal::Connection& file_changed)

View file

@ -48,7 +48,7 @@
#include <libaegisub/dispatch.h>
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/trim.hpp>
@ -482,7 +482,7 @@ namespace Automation4 {
wxLogError(_("The file was not recognised as an Automation script: %s"), filename.wstring());
}
return create_unknown ? agi::util::make_unique<UnknownScript>(filename) : nullptr;
return create_unknown ? agi::make_unique<UnknownScript>(filename) : nullptr;
}
std::vector<std::unique_ptr<ScriptFactory>>& ScriptFactory::Factories()

View file

@ -53,7 +53,7 @@
#include <libaegisub/access.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string/classification.hpp>
@ -773,7 +773,7 @@ namespace Automation4 {
int LuaCommand::LuaRegister(lua_State *L)
{
static std::mutex mutex;
auto command = agi::util::make_unique<LuaCommand>(L);
auto command = agi::make_unique<LuaCommand>(L);
{
std::lock_guard<std::mutex> lock(mutex);
cmd::reg(std::move(command));
@ -1048,7 +1048,7 @@ namespace Automation4 {
int LuaExportFilter::LuaRegister(lua_State *L)
{
static std::mutex mutex;
auto filter = agi::util::make_unique<LuaExportFilter>(L);
auto filter = agi::make_unique<LuaExportFilter>(L);
{
std::lock_guard<std::mutex> lock(mutex);
AssExportFilterChain::Register(std::move(filter));
@ -1130,7 +1130,7 @@ namespace Automation4 {
std::unique_ptr<Script> LuaScriptFactory::Produce(agi::fs::path const& filename) const
{
if (agi::fs::HasExtension(filename, "lua") || agi::fs::HasExtension(filename, "moon"))
return agi::util::make_unique<LuaScript>(filename);
return agi::make_unique<LuaScript>(filename);
return nullptr;
}
}

View file

@ -43,7 +43,7 @@
#include "utils.h"
#include <libaegisub/exception.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string/case_conv.hpp>
@ -241,7 +241,7 @@ namespace Automation4 {
try {
if (lclass == "info")
result = agi::util::make_unique<AssInfo>(get_string_field(L, "key", "info"), get_string_field(L, "value", "info"));
result = agi::make_unique<AssInfo>(get_string_field(L, "key", "info"), get_string_field(L, "value", "info"));
else if (lclass == "style") {
auto sty = new AssStyle;
result.reset(sty);
@ -357,7 +357,7 @@ namespace Automation4 {
// Just in case an insane user inserted non-info lines into the
// script info section...
while (lines[i]) ++i;
lines_to_delete.emplace_back(agi::util::make_unique<AssInfo>(info));
lines_to_delete.emplace_back(agi::make_unique<AssInfo>(info));
lines[i++] = lines_to_delete.back().get();
}
script_info_copied = true;

View file

@ -42,7 +42,7 @@
#include "utils.h"
#include "validators.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/range/adaptors.hpp>
@ -426,26 +426,26 @@ namespace Automation4 {
// Check control class and create relevant control
if (controlclass == "label")
ctl = agi::util::make_unique<LuaControl::Label>(L);
ctl = agi::make_unique<LuaControl::Label>(L);
else if (controlclass == "edit")
ctl = agi::util::make_unique<LuaControl::Edit>(L);
ctl = agi::make_unique<LuaControl::Edit>(L);
else if (controlclass == "intedit")
ctl = agi::util::make_unique<LuaControl::IntEdit>(L);
ctl = agi::make_unique<LuaControl::IntEdit>(L);
else if (controlclass == "floatedit")
ctl = agi::util::make_unique<LuaControl::FloatEdit>(L);
ctl = agi::make_unique<LuaControl::FloatEdit>(L);
else if (controlclass == "textbox")
ctl = agi::util::make_unique<LuaControl::Textbox>(L);
ctl = agi::make_unique<LuaControl::Textbox>(L);
else if (controlclass == "dropdown")
ctl = agi::util::make_unique<LuaControl::Dropdown>(L);
ctl = agi::make_unique<LuaControl::Dropdown>(L);
else if (controlclass == "checkbox")
ctl = agi::util::make_unique<LuaControl::Checkbox>(L);
ctl = agi::make_unique<LuaControl::Checkbox>(L);
else if (controlclass == "color")
ctl = agi::util::make_unique<LuaControl::Color>(L, false);
ctl = agi::make_unique<LuaControl::Color>(L, false);
else if (controlclass == "coloralpha")
ctl = agi::util::make_unique<LuaControl::Color>(L, true);
ctl = agi::make_unique<LuaControl::Color>(L, true);
else if (controlclass == "alpha")
// FIXME
ctl = agi::util::make_unique<LuaControl::Edit>(L);
ctl = agi::make_unique<LuaControl::Edit>(L);
else
luaL_error(L, "bad control table entry");

View file

@ -34,7 +34,7 @@
#include "command.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include "../audio_controller.h"
#include "../compat.h"
@ -273,20 +273,20 @@ struct app_updates final : public Command {
namespace cmd {
void init_app() {
reg(agi::util::make_unique<app_about>());
reg(agi::util::make_unique<app_display_audio_subs>());
reg(agi::util::make_unique<app_display_full>());
reg(agi::util::make_unique<app_display_subs>());
reg(agi::util::make_unique<app_display_video_subs>());
reg(agi::util::make_unique<app_exit>());
reg(agi::util::make_unique<app_language>());
reg(agi::util::make_unique<app_log>());
reg(agi::util::make_unique<app_new_window>());
reg(agi::util::make_unique<app_options>());
reg(agi::util::make_unique<app_toggle_global_hotkeys>());
reg(agi::util::make_unique<app_toggle_toolbar>());
reg(agi::make_unique<app_about>());
reg(agi::make_unique<app_display_audio_subs>());
reg(agi::make_unique<app_display_full>());
reg(agi::make_unique<app_display_subs>());
reg(agi::make_unique<app_display_video_subs>());
reg(agi::make_unique<app_exit>());
reg(agi::make_unique<app_language>());
reg(agi::make_unique<app_log>());
reg(agi::make_unique<app_new_window>());
reg(agi::make_unique<app_options>());
reg(agi::make_unique<app_toggle_global_hotkeys>());
reg(agi::make_unique<app_toggle_toolbar>());
#ifdef WITH_UPDATE_CHECKER
reg(agi::util::make_unique<app_updates>());
reg(agi::make_unique<app_updates>());
#endif
}
}

View file

@ -44,7 +44,7 @@
#include "../utils.h"
#include "../video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/msgdlg.h>
@ -555,36 +555,36 @@ struct audio_karaoke final : public Command {
namespace cmd {
void init_audio() {
reg(agi::util::make_unique<audio_autocommit>());
reg(agi::util::make_unique<audio_autonext>());
reg(agi::util::make_unique<audio_autoscroll>());
reg(agi::util::make_unique<audio_close>());
reg(agi::util::make_unique<audio_commit>());
reg(agi::util::make_unique<audio_commit_default>());
reg(agi::util::make_unique<audio_commit_next>());
reg(agi::util::make_unique<audio_commit_stay>());
reg(agi::util::make_unique<audio_go_to>());
reg(agi::util::make_unique<audio_karaoke>());
reg(agi::util::make_unique<audio_open>());
reg(agi::util::make_unique<audio_open_blank>());
reg(agi::util::make_unique<audio_open_noise>());
reg(agi::util::make_unique<audio_open_video>());
reg(agi::util::make_unique<audio_play_after>());
reg(agi::util::make_unique<audio_play_before>());
reg(agi::util::make_unique<audio_play_begin>());
reg(agi::util::make_unique<audio_play_end>());
reg(agi::util::make_unique<audio_play_current_selection>());
reg(agi::util::make_unique<audio_play_current_line>());
reg(agi::util::make_unique<audio_play_selection>());
reg(agi::util::make_unique<audio_play_to_end>());
reg(agi::util::make_unique<audio_play_toggle>());
reg(agi::util::make_unique<audio_save_clip>());
reg(agi::util::make_unique<audio_scroll_left>());
reg(agi::util::make_unique<audio_scroll_right>());
reg(agi::util::make_unique<audio_stop>());
reg(agi::util::make_unique<audio_toggle_spectrum>());
reg(agi::util::make_unique<audio_vertical_link>());
reg(agi::util::make_unique<audio_view_spectrum>());
reg(agi::util::make_unique<audio_view_waveform>());
reg(agi::make_unique<audio_autocommit>());
reg(agi::make_unique<audio_autonext>());
reg(agi::make_unique<audio_autoscroll>());
reg(agi::make_unique<audio_close>());
reg(agi::make_unique<audio_commit>());
reg(agi::make_unique<audio_commit_default>());
reg(agi::make_unique<audio_commit_next>());
reg(agi::make_unique<audio_commit_stay>());
reg(agi::make_unique<audio_go_to>());
reg(agi::make_unique<audio_karaoke>());
reg(agi::make_unique<audio_open>());
reg(agi::make_unique<audio_open_blank>());
reg(agi::make_unique<audio_open_noise>());
reg(agi::make_unique<audio_open_video>());
reg(agi::make_unique<audio_play_after>());
reg(agi::make_unique<audio_play_before>());
reg(agi::make_unique<audio_play_begin>());
reg(agi::make_unique<audio_play_end>());
reg(agi::make_unique<audio_play_current_selection>());
reg(agi::make_unique<audio_play_current_line>());
reg(agi::make_unique<audio_play_selection>());
reg(agi::make_unique<audio_play_to_end>());
reg(agi::make_unique<audio_play_toggle>());
reg(agi::make_unique<audio_save_clip>());
reg(agi::make_unique<audio_scroll_left>());
reg(agi::make_unique<audio_scroll_right>());
reg(agi::make_unique<audio_stop>());
reg(agi::make_unique<audio_toggle_spectrum>());
reg(agi::make_unique<audio_vertical_link>());
reg(agi::make_unique<audio_view_spectrum>());
reg(agi::make_unique<audio_view_waveform>());
}
}

View file

@ -42,7 +42,7 @@
#include "../utils.h"
#include "../video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
namespace {
using cmd::Command;
@ -107,9 +107,9 @@ struct meta final : public Command {
namespace cmd {
void init_automation() {
reg(agi::util::make_unique<meta>());
reg(agi::util::make_unique<open_manager>());
reg(agi::util::make_unique<reload_all>());
reg(agi::util::make_unique<reload_autoload>());
reg(agi::make_unique<meta>());
reg(agi::make_unique<open_manager>());
reg(agi::make_unique<reload_all>());
reg(agi::make_unique<reload_autoload>());
}
}

View file

@ -53,7 +53,7 @@
#include <libaegisub/address_of_adaptor.h>
#include <libaegisub/of_type_adaptor.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
@ -1254,37 +1254,37 @@ struct edit_insert_original final : public Command {
namespace cmd {
void init_edit() {
reg(agi::util::make_unique<edit_color_primary>());
reg(agi::util::make_unique<edit_color_secondary>());
reg(agi::util::make_unique<edit_color_outline>());
reg(agi::util::make_unique<edit_color_shadow>());
reg(agi::util::make_unique<edit_font>());
reg(agi::util::make_unique<edit_find_replace>());
reg(agi::util::make_unique<edit_line_copy>());
reg(agi::util::make_unique<edit_line_cut>());
reg(agi::util::make_unique<edit_line_delete>());
reg(agi::util::make_unique<edit_line_duplicate>());
reg(agi::util::make_unique<edit_line_duplicate_shift>());
reg(agi::util::make_unique<edit_line_duplicate_shift_back>());
reg(agi::util::make_unique<edit_line_join_as_karaoke>());
reg(agi::util::make_unique<edit_line_join_concatenate>());
reg(agi::util::make_unique<edit_line_join_keep_first>());
reg(agi::util::make_unique<edit_line_paste>());
reg(agi::util::make_unique<edit_line_paste_over>());
reg(agi::util::make_unique<edit_line_recombine>());
reg(agi::util::make_unique<edit_line_split_by_karaoke>());
reg(agi::util::make_unique<edit_line_split_estimate>());
reg(agi::util::make_unique<edit_line_split_preserve>());
reg(agi::util::make_unique<edit_line_split_video>());
reg(agi::util::make_unique<edit_style_bold>());
reg(agi::util::make_unique<edit_style_italic>());
reg(agi::util::make_unique<edit_style_underline>());
reg(agi::util::make_unique<edit_style_strikeout>());
reg(agi::util::make_unique<edit_redo>());
reg(agi::util::make_unique<edit_undo>());
reg(agi::util::make_unique<edit_revert>());
reg(agi::util::make_unique<edit_insert_original>());
reg(agi::util::make_unique<edit_clear>());
reg(agi::util::make_unique<edit_clear_text>());
reg(agi::make_unique<edit_color_primary>());
reg(agi::make_unique<edit_color_secondary>());
reg(agi::make_unique<edit_color_outline>());
reg(agi::make_unique<edit_color_shadow>());
reg(agi::make_unique<edit_font>());
reg(agi::make_unique<edit_find_replace>());
reg(agi::make_unique<edit_line_copy>());
reg(agi::make_unique<edit_line_cut>());
reg(agi::make_unique<edit_line_delete>());
reg(agi::make_unique<edit_line_duplicate>());
reg(agi::make_unique<edit_line_duplicate_shift>());
reg(agi::make_unique<edit_line_duplicate_shift_back>());
reg(agi::make_unique<edit_line_join_as_karaoke>());
reg(agi::make_unique<edit_line_join_concatenate>());
reg(agi::make_unique<edit_line_join_keep_first>());
reg(agi::make_unique<edit_line_paste>());
reg(agi::make_unique<edit_line_paste_over>());
reg(agi::make_unique<edit_line_recombine>());
reg(agi::make_unique<edit_line_split_by_karaoke>());
reg(agi::make_unique<edit_line_split_estimate>());
reg(agi::make_unique<edit_line_split_preserve>());
reg(agi::make_unique<edit_line_split_video>());
reg(agi::make_unique<edit_style_bold>());
reg(agi::make_unique<edit_style_italic>());
reg(agi::make_unique<edit_style_underline>());
reg(agi::make_unique<edit_style_strikeout>());
reg(agi::make_unique<edit_redo>());
reg(agi::make_unique<edit_undo>());
reg(agi::make_unique<edit_revert>());
reg(agi::make_unique<edit_insert_original>());
reg(agi::make_unique<edit_clear>());
reg(agi::make_unique<edit_clear_text>());
}
}

View file

@ -42,7 +42,7 @@
#include "../selection_controller.h"
#include "../utils.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
namespace {
using cmd::Command;
@ -403,27 +403,27 @@ struct grid_swap final : public Command {
namespace cmd {
void init_grid() {
reg(agi::util::make_unique<grid_line_next>());
reg(agi::util::make_unique<grid_line_next_create>());
reg(agi::util::make_unique<grid_line_prev>());
reg(agi::util::make_unique<grid_sort_actor>());
reg(agi::util::make_unique<grid_sort_effect>());
reg(agi::util::make_unique<grid_sort_end>());
reg(agi::util::make_unique<grid_sort_layer>());
reg(agi::util::make_unique<grid_sort_start>());
reg(agi::util::make_unique<grid_sort_style>());
reg(agi::util::make_unique<grid_sort_actor_selected>());
reg(agi::util::make_unique<grid_sort_effect_selected>());
reg(agi::util::make_unique<grid_sort_end_selected>());
reg(agi::util::make_unique<grid_sort_layer_selected>());
reg(agi::util::make_unique<grid_sort_start_selected>());
reg(agi::util::make_unique<grid_sort_style_selected>());
reg(agi::util::make_unique<grid_move_down>());
reg(agi::util::make_unique<grid_move_up>());
reg(agi::util::make_unique<grid_swap>());
reg(agi::util::make_unique<grid_tag_cycle_hiding>());
reg(agi::util::make_unique<grid_tags_hide>());
reg(agi::util::make_unique<grid_tags_show>());
reg(agi::util::make_unique<grid_tags_simplify>());
reg(agi::make_unique<grid_line_next>());
reg(agi::make_unique<grid_line_next_create>());
reg(agi::make_unique<grid_line_prev>());
reg(agi::make_unique<grid_sort_actor>());
reg(agi::make_unique<grid_sort_effect>());
reg(agi::make_unique<grid_sort_end>());
reg(agi::make_unique<grid_sort_layer>());
reg(agi::make_unique<grid_sort_start>());
reg(agi::make_unique<grid_sort_style>());
reg(agi::make_unique<grid_sort_actor_selected>());
reg(agi::make_unique<grid_sort_effect_selected>());
reg(agi::make_unique<grid_sort_end_selected>());
reg(agi::make_unique<grid_sort_layer_selected>());
reg(agi::make_unique<grid_sort_start_selected>());
reg(agi::make_unique<grid_sort_style_selected>());
reg(agi::make_unique<grid_move_down>());
reg(agi::make_unique<grid_move_up>());
reg(agi::make_unique<grid_swap>());
reg(agi::make_unique<grid_tag_cycle_hiding>());
reg(agi::make_unique<grid_tags_hide>());
reg(agi::make_unique<grid_tags_show>());
reg(agi::make_unique<grid_tags_simplify>());
}
}

View file

@ -36,7 +36,7 @@
#include "../libresrc/libresrc.h"
#include "../options.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/msgdlg.h>
@ -127,11 +127,11 @@ struct help_website final : public Command {
namespace cmd {
void init_help() {
reg(agi::util::make_unique<help_bugs>());
reg(agi::util::make_unique<help_contents>());
reg(agi::util::make_unique<help_forums>());
reg(agi::util::make_unique<help_irc>());
reg(agi::util::make_unique<help_video>());
reg(agi::util::make_unique<help_website>());
reg(agi::make_unique<help_bugs>());
reg(agi::make_unique<help_contents>());
reg(agi::make_unique<help_forums>());
reg(agi::make_unique<help_irc>());
reg(agi::make_unique<help_video>());
reg(agi::make_unique<help_website>());
}
}

View file

@ -37,7 +37,7 @@
#include "../utils.h"
#include "../video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
namespace {
using cmd::Command;
@ -100,8 +100,8 @@ struct keyframe_save final : public Command {
namespace cmd {
void init_keyframe() {
reg(agi::util::make_unique<keyframe_close>());
reg(agi::util::make_unique<keyframe_open>());
reg(agi::util::make_unique<keyframe_save>());
reg(agi::make_unique<keyframe_close>());
reg(agi::make_unique<keyframe_open>());
reg(agi::make_unique<keyframe_save>());
}
}

View file

@ -37,7 +37,7 @@
#include "../subs_controller.h"
#include "../video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/event.h>
#include <wx/msgdlg.h>
@ -128,18 +128,18 @@ public:
namespace cmd {
void init_recent() {
reg(agi::util::make_unique<recent_audio>());
reg(agi::util::make_unique<recent_keyframes>());
reg(agi::util::make_unique<recent_subtitle>());
reg(agi::util::make_unique<recent_timecodes>());
reg(agi::util::make_unique<recent_video>());
reg(agi::make_unique<recent_audio>());
reg(agi::make_unique<recent_keyframes>());
reg(agi::make_unique<recent_subtitle>());
reg(agi::make_unique<recent_timecodes>());
reg(agi::make_unique<recent_video>());
for (int i = 0; i < 16; ++i) {
reg(agi::util::make_unique<mru_wrapper<recent_audio_entry>>(i));
reg(agi::util::make_unique<mru_wrapper<recent_keyframes_entry>>(i));
reg(agi::util::make_unique<mru_wrapper<recent_subtitle_entry>>(i));
reg(agi::util::make_unique<mru_wrapper<recent_timecodes_entry>>(i));
reg(agi::util::make_unique<mru_wrapper<recent_video_entry>>(i));
reg(agi::make_unique<mru_wrapper<recent_audio_entry>>(i));
reg(agi::make_unique<mru_wrapper<recent_keyframes_entry>>(i));
reg(agi::make_unique<mru_wrapper<recent_subtitle_entry>>(i));
reg(agi::make_unique<mru_wrapper<recent_timecodes_entry>>(i));
reg(agi::make_unique<mru_wrapper<recent_video_entry>>(i));
}
}
}

View file

@ -52,7 +52,7 @@
#include <libaegisub/address_of_adaptor.h>
#include <libaegisub/charset_conv.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/range/algorithm.hpp>
#include <wx/msgdlg.h>
@ -424,23 +424,23 @@ struct subtitle_spellcheck final : public Command {
namespace cmd {
void init_subtitle() {
reg(agi::util::make_unique<subtitle_attachment>());
reg(agi::util::make_unique<subtitle_find>());
reg(agi::util::make_unique<subtitle_find_next>());
reg(agi::util::make_unique<subtitle_insert_after>());
reg(agi::util::make_unique<subtitle_insert_after_videotime>());
reg(agi::util::make_unique<subtitle_insert_before>());
reg(agi::util::make_unique<subtitle_insert_before_videotime>());
reg(agi::util::make_unique<subtitle_new>());
reg(agi::util::make_unique<subtitle_open>());
reg(agi::util::make_unique<subtitle_open_autosave>());
reg(agi::util::make_unique<subtitle_open_charset>());
reg(agi::util::make_unique<subtitle_open_video>());
reg(agi::util::make_unique<subtitle_properties>());
reg(agi::util::make_unique<subtitle_save>());
reg(agi::util::make_unique<subtitle_save_as>());
reg(agi::util::make_unique<subtitle_select_all>());
reg(agi::util::make_unique<subtitle_select_visible>());
reg(agi::util::make_unique<subtitle_spellcheck>());
reg(agi::make_unique<subtitle_attachment>());
reg(agi::make_unique<subtitle_find>());
reg(agi::make_unique<subtitle_find_next>());
reg(agi::make_unique<subtitle_insert_after>());
reg(agi::make_unique<subtitle_insert_after_videotime>());
reg(agi::make_unique<subtitle_insert_before>());
reg(agi::make_unique<subtitle_insert_before_videotime>());
reg(agi::make_unique<subtitle_new>());
reg(agi::make_unique<subtitle_open>());
reg(agi::make_unique<subtitle_open_autosave>());
reg(agi::make_unique<subtitle_open_charset>());
reg(agi::make_unique<subtitle_open_video>());
reg(agi::make_unique<subtitle_properties>());
reg(agi::make_unique<subtitle_save>());
reg(agi::make_unique<subtitle_save_as>());
reg(agi::make_unique<subtitle_select_all>());
reg(agi::make_unique<subtitle_select_visible>());
reg(agi::make_unique<subtitle_spellcheck>());
}
}

View file

@ -43,7 +43,7 @@
#include "../selection_controller.h"
#include "../video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
@ -378,23 +378,23 @@ struct time_prev final : public Command {
namespace cmd {
void init_time() {
reg(agi::util::make_unique<time_add_lead_both>());
reg(agi::util::make_unique<time_add_lead_in>());
reg(agi::util::make_unique<time_add_lead_out>());
reg(agi::util::make_unique<time_continuous_end>());
reg(agi::util::make_unique<time_continuous_start>());
reg(agi::util::make_unique<time_frame_current>());
reg(agi::util::make_unique<time_length_decrease>());
reg(agi::util::make_unique<time_length_decrease_shift>());
reg(agi::util::make_unique<time_length_increase>());
reg(agi::util::make_unique<time_length_increase_shift>());
reg(agi::util::make_unique<time_next>());
reg(agi::util::make_unique<time_prev>());
reg(agi::util::make_unique<time_shift>());
reg(agi::util::make_unique<time_snap_end_video>());
reg(agi::util::make_unique<time_snap_scene>());
reg(agi::util::make_unique<time_snap_start_video>());
reg(agi::util::make_unique<time_start_decrease>());
reg(agi::util::make_unique<time_start_increase>());
reg(agi::make_unique<time_add_lead_both>());
reg(agi::make_unique<time_add_lead_in>());
reg(agi::make_unique<time_add_lead_out>());
reg(agi::make_unique<time_continuous_end>());
reg(agi::make_unique<time_continuous_start>());
reg(agi::make_unique<time_frame_current>());
reg(agi::make_unique<time_length_decrease>());
reg(agi::make_unique<time_length_decrease_shift>());
reg(agi::make_unique<time_length_increase>());
reg(agi::make_unique<time_length_increase_shift>());
reg(agi::make_unique<time_next>());
reg(agi::make_unique<time_prev>());
reg(agi::make_unique<time_shift>());
reg(agi::make_unique<time_snap_end_video>());
reg(agi::make_unique<time_snap_scene>());
reg(agi::make_unique<time_snap_start_video>());
reg(agi::make_unique<time_start_decrease>());
reg(agi::make_unique<time_start_increase>());
}
}

View file

@ -37,7 +37,7 @@
#include "../utils.h"
#include "../video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
namespace {
using cmd::Command;
@ -97,8 +97,8 @@ struct timecode_save final : public Command {
namespace cmd {
void init_timecode() {
reg(agi::util::make_unique<timecode_close>());
reg(agi::util::make_unique<timecode_open>());
reg(agi::util::make_unique<timecode_save>());
reg(agi::make_unique<timecode_close>());
reg(agi::make_unique<timecode_open>());
reg(agi::make_unique<timecode_save>());
}
}

View file

@ -50,7 +50,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/msgdlg.h>
#include <wx/utils.h>
@ -284,25 +284,25 @@ struct tool_translation_assistant_insert final : public tool_translation_assista
namespace cmd {
void init_tool() {
reg(agi::util::make_unique<tool_export>());
reg(agi::util::make_unique<tool_font_collector>());
reg(agi::util::make_unique<tool_line_select>());
reg(agi::util::make_unique<tool_resampleres>());
reg(agi::util::make_unique<tool_style_assistant>());
reg(agi::util::make_unique<tool_styling_assistant_commit>());
reg(agi::util::make_unique<tool_styling_assistant_preview>());
reg(agi::util::make_unique<tool_style_manager>());
reg(agi::util::make_unique<tool_time_kanji>());
reg(agi::util::make_unique<tool_time_postprocess>());
reg(agi::util::make_unique<tool_translation_assistant>());
reg(agi::make_unique<tool_export>());
reg(agi::make_unique<tool_font_collector>());
reg(agi::make_unique<tool_line_select>());
reg(agi::make_unique<tool_resampleres>());
reg(agi::make_unique<tool_style_assistant>());
reg(agi::make_unique<tool_styling_assistant_commit>());
reg(agi::make_unique<tool_styling_assistant_preview>());
reg(agi::make_unique<tool_style_manager>());
reg(agi::make_unique<tool_time_kanji>());
reg(agi::make_unique<tool_time_postprocess>());
reg(agi::make_unique<tool_translation_assistant>());
#ifdef _WIN32
if (agi::fs::FileExists(config::path->Decode("?data/ASSDraw3.exe")))
reg(agi::util::make_unique<tool_assdraw>());
reg(agi::make_unique<tool_assdraw>());
#endif
reg(agi::util::make_unique<tool_translation_assistant_commit>());
reg(agi::util::make_unique<tool_translation_assistant_preview>());
reg(agi::util::make_unique<tool_translation_assistant_next>());
reg(agi::util::make_unique<tool_translation_assistant_prev>());
reg(agi::util::make_unique<tool_translation_assistant_insert>());
reg(agi::make_unique<tool_translation_assistant_commit>());
reg(agi::make_unique<tool_translation_assistant_preview>());
reg(agi::make_unique<tool_translation_assistant_next>());
reg(agi::make_unique<tool_translation_assistant_prev>());
reg(agi::make_unique<tool_translation_assistant_insert>());
}
}

View file

@ -54,6 +54,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/util.h>
#include <boost/algorithm/string/classification.hpp>
@ -739,43 +740,43 @@ struct video_zoom_out final : public validator_video_attached {
namespace cmd {
void init_video() {
reg(agi::util::make_unique<video_aspect_cinematic>());
reg(agi::util::make_unique<video_aspect_custom>());
reg(agi::util::make_unique<video_aspect_default>());
reg(agi::util::make_unique<video_aspect_full>());
reg(agi::util::make_unique<video_aspect_wide>());
reg(agi::util::make_unique<video_close>());
reg(agi::util::make_unique<video_copy_coordinates>());
reg(agi::util::make_unique<video_cycle_subtitles_provider>());
reg(agi::util::make_unique<video_detach>());
reg(agi::util::make_unique<video_details>());
reg(agi::util::make_unique<video_focus_seek>());
reg(agi::util::make_unique<video_frame_copy>());
reg(agi::util::make_unique<video_frame_copy_raw>());
reg(agi::util::make_unique<video_frame_next>());
reg(agi::util::make_unique<video_frame_next_boundary>());
reg(agi::util::make_unique<video_frame_next_keyframe>());
reg(agi::util::make_unique<video_frame_next_large>());
reg(agi::util::make_unique<video_frame_prev>());
reg(agi::util::make_unique<video_frame_prev_boundary>());
reg(agi::util::make_unique<video_frame_prev_keyframe>());
reg(agi::util::make_unique<video_frame_prev_large>());
reg(agi::util::make_unique<video_frame_save>());
reg(agi::util::make_unique<video_frame_save_raw>());
reg(agi::util::make_unique<video_jump>());
reg(agi::util::make_unique<video_jump_end>());
reg(agi::util::make_unique<video_jump_start>());
reg(agi::util::make_unique<video_open>());
reg(agi::util::make_unique<video_open_dummy>());
reg(agi::util::make_unique<video_opt_autoscroll>());
reg(agi::util::make_unique<video_play>());
reg(agi::util::make_unique<video_play_line>());
reg(agi::util::make_unique<video_show_overscan>());
reg(agi::util::make_unique<video_stop>());
reg(agi::util::make_unique<video_zoom_100>());
reg(agi::util::make_unique<video_zoom_200>());
reg(agi::util::make_unique<video_zoom_50>());
reg(agi::util::make_unique<video_zoom_in>());
reg(agi::util::make_unique<video_zoom_out>());
reg(agi::make_unique<video_aspect_cinematic>());
reg(agi::make_unique<video_aspect_custom>());
reg(agi::make_unique<video_aspect_default>());
reg(agi::make_unique<video_aspect_full>());
reg(agi::make_unique<video_aspect_wide>());
reg(agi::make_unique<video_close>());
reg(agi::make_unique<video_copy_coordinates>());
reg(agi::make_unique<video_cycle_subtitles_provider>());
reg(agi::make_unique<video_detach>());
reg(agi::make_unique<video_details>());
reg(agi::make_unique<video_focus_seek>());
reg(agi::make_unique<video_frame_copy>());
reg(agi::make_unique<video_frame_copy_raw>());
reg(agi::make_unique<video_frame_next>());
reg(agi::make_unique<video_frame_next_boundary>());
reg(agi::make_unique<video_frame_next_keyframe>());
reg(agi::make_unique<video_frame_next_large>());
reg(agi::make_unique<video_frame_prev>());
reg(agi::make_unique<video_frame_prev_boundary>());
reg(agi::make_unique<video_frame_prev_keyframe>());
reg(agi::make_unique<video_frame_prev_large>());
reg(agi::make_unique<video_frame_save>());
reg(agi::make_unique<video_frame_save_raw>());
reg(agi::make_unique<video_jump>());
reg(agi::make_unique<video_jump_end>());
reg(agi::make_unique<video_jump_start>());
reg(agi::make_unique<video_open>());
reg(agi::make_unique<video_open_dummy>());
reg(agi::make_unique<video_opt_autoscroll>());
reg(agi::make_unique<video_play>());
reg(agi::make_unique<video_play_line>());
reg(agi::make_unique<video_show_overscan>());
reg(agi::make_unique<video_stop>());
reg(agi::make_unique<video_zoom_100>());
reg(agi::make_unique<video_zoom_200>());
reg(agi::make_unique<video_zoom_50>());
reg(agi::make_unique<video_zoom_in>());
reg(agi::make_unique<video_zoom_out>());
}
}

View file

@ -29,7 +29,7 @@
#include "../visual_tool_scale.h"
#include "../visual_tool_vector_clip.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
namespace {
using cmd::Command;
@ -47,7 +47,7 @@ namespace {
}
void operator()(agi::Context *c) override {
c->videoDisplay->SetTool(agi::util::make_unique<T>(c->videoDisplay, c));
c->videoDisplay->SetTool(agi::make_unique<T>(c->videoDisplay, c));
}
};
@ -110,12 +110,12 @@ namespace {
namespace cmd {
void init_visual_tools() {
reg(agi::util::make_unique<visual_mode_cross>());
reg(agi::util::make_unique<visual_mode_drag>());
reg(agi::util::make_unique<visual_mode_rotate_z>());
reg(agi::util::make_unique<visual_mode_rotate_xy>());
reg(agi::util::make_unique<visual_mode_scale>());
reg(agi::util::make_unique<visual_mode_clip>());
reg(agi::util::make_unique<visual_mode_vector_clip>());
reg(agi::make_unique<visual_mode_cross>());
reg(agi::make_unique<visual_mode_drag>());
reg(agi::make_unique<visual_mode_rotate_z>());
reg(agi::make_unique<visual_mode_rotate_xy>());
reg(agi::make_unique<visual_mode_scale>());
reg(agi::make_unique<visual_mode_clip>());
reg(agi::make_unique<visual_mode_vector_clip>());
}
}

View file

@ -27,20 +27,20 @@
#include "text_selection_controller.h"
#include "video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
namespace agi {
Context::Context()
: ass(util::make_unique<AssFile>())
, textSelectionController(util::make_unique<TextSelectionController>())
, subsController(util::make_unique<SubsController>(this))
, local_scripts(util::make_unique<Automation4::LocalScriptManager>(this))
, videoController(util::make_unique<VideoContext>(this))
, audioController(util::make_unique<AudioController>(this))
, selectionController(util::make_unique<SelectionController>(this))
, initialLineState(util::make_unique<InitialLineState>(this))
, search(util::make_unique<SearchReplaceEngine>(this))
, dialog(util::make_unique<DialogManager>())
: ass(make_unique<AssFile>())
, textSelectionController(make_unique<TextSelectionController>())
, subsController(make_unique<SubsController>(this))
, local_scripts(make_unique<Automation4::LocalScriptManager>(this))
, videoController(make_unique<VideoContext>(this))
, audioController(make_unique<AudioController>(this))
, selectionController(make_unique<SelectionController>(this))
, initialLineState(make_unique<InitialLineState>(this))
, search(make_unique<SearchReplaceEngine>(this))
, dialog(make_unique<DialogManager>())
{
subsController->SetSelectionController(selectionController.get());
}

View file

@ -19,6 +19,7 @@
#include "version.h"
#include <libaegisub/fs.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/util.h>
#include <atomic>
@ -120,7 +121,7 @@ void Initialize(agi::fs::path const& path) {
wcscpy_s(crash_dump_path + len, MAX_PATH - len, L".dmp");
if (!dump_thread)
dump_thread = agi::util::make_unique<dump_thread_state>();
dump_thread = agi::make_unique<dump_thread_state>();
}
void Cleanup() {

View file

@ -44,7 +44,7 @@
#include "utils.h"
#include <libaegisub/scoped_ptr.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <memory>
#include <vector>
@ -663,7 +663,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color,
SetSizerAndFit(main_sizer);
persist = agi::util::make_unique<PersistLocation>(this, "Tool/Colour Picker");
persist = agi::make_unique<PersistLocation>(this, "Tool/Colour Picker");
// Fill the controls
int mode = OPT_GET("Tool/Colour Picker/Mode")->GetInt();

View file

@ -43,7 +43,7 @@
#include "video_context.h"
#include "video_display.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/filesystem/path.hpp>
@ -79,7 +79,7 @@ DialogDetachedVideo::DialogDetachedVideo(agi::Context *context)
videoBox->SetMinSize(wxSize(1,1));
SetMinSize(wxSize(1,1));
persist = agi::util::make_unique<PersistLocation>(this, "Video/Detached");
persist = agi::make_unique<PersistLocation>(this, "Video/Detached");
int display_index = wxDisplay::GetFromWindow(this);
// Ensure that the dialog is no larger than the screen

View file

@ -44,7 +44,7 @@
#include "utils.h"
#include <libaegisub/charset_conv.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/filesystem/path.hpp>
@ -76,7 +76,7 @@ static void swap(wxCheckListBox *list, int idx, int sel_dir) {
DialogExport::DialogExport(agi::Context *c)
: wxDialog(c->parent, -1, _("Export"), wxDefaultPosition, wxSize(200, 100), wxCAPTION | wxCLOSE_BOX)
, c(c)
, exporter(agi::util::make_unique<AssExporter>(c))
, exporter(agi::make_unique<AssExporter>(c))
{
SetIcon(GETICON(export_menu_16));
SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);

View file

@ -26,7 +26,7 @@
#include "text_file_writer.h"
#include <libaegisub/charset_conv.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/lexical_cast.hpp>
#include <boost/regex.hpp>
@ -214,13 +214,13 @@ agi::vfr::Framerate EbuExportSettings::GetFramerate() const {
std::unique_ptr<agi::charset::IconvWrapper> EbuExportSettings::GetTextEncoder() const {
using namespace agi;
switch (text_encoding) {
case iso6937_2: return util::make_unique<charset::IconvWrapper>("utf-8", "ISO-6937-2");
case iso8859_5: return util::make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-5");
case iso8859_6: return util::make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-6");
case iso8859_7: return util::make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-7");
case iso8859_8: return util::make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-8");
case utf8: return util::make_unique<charset::IconvWrapper>("utf-8", "utf-8");
default: return util::make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-1");
case iso6937_2: return make_unique<charset::IconvWrapper>("utf-8", "ISO-6937-2");
case iso8859_5: return make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-5");
case iso8859_6: return make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-6");
case iso8859_7: return make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-7");
case iso8859_8: return make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-8");
case utf8: return make_unique<charset::IconvWrapper>("utf-8", "utf-8");
default: return make_unique<charset::IconvWrapper>("utf-8", "ISO-8859-1");
}
}

View file

@ -38,7 +38,7 @@
#include <libaegisub/dispatch.h>
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/button.h>
#include <wx/dirdlg.h>
@ -111,9 +111,9 @@ void FontsCollectorThread(AssFile *subs, agi::fs::path const& destination, FcMod
return;
}
out = agi::util::make_unique<wxFFileOutputStream>(destination.wstring());
out = agi::make_unique<wxFFileOutputStream>(destination.wstring());
if (out->IsOk())
zip = agi::util::make_unique<wxZipOutputStream>(*out);
zip = agi::make_unique<wxZipOutputStream>(*out);
if (!out->IsOk() || !zip || !zip->IsOk()) {
AppendText(wxString::Format(_("* Failed to open %s.\n"), destination.wstring()), 2);

View file

@ -28,7 +28,7 @@
#include "utils.h"
#include "validators.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <functional>
@ -45,7 +45,7 @@
DialogSearchReplace::DialogSearchReplace(agi::Context* c, bool replace)
: wxDialog(c->parent, -1, replace ? _("Replace") : _("Find"))
, c(c)
, settings(agi::util::make_unique<SearchReplaceSettings>())
, settings(agi::make_unique<SearchReplaceSettings>())
, has_replace(replace)
{
auto recent_find(lagi_MRU_wxAS("Find"));

View file

@ -38,7 +38,7 @@
#include <libaegisub/io.h>
#include <libaegisub/log.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/cajun/elements.h>
#include <libaegisub/cajun/reader.h>
@ -99,7 +99,7 @@ DialogShiftTimes::DialogShiftTimes(agi::Context *context)
: wxDialog(context->parent, -1, _("Shift Times"))
, context(context)
, history_filename(config::path->Decode("?user/shift_history.json"))
, history(agi::util::make_unique<json::Array>())
, history(agi::make_unique<json::Array>())
, timecodes_loaded_slot(context->videoController->AddTimecodesListener(&DialogShiftTimes::OnTimecodesLoaded, this))
, selected_set_changed_slot(context->selectionController->AddSelectionListener(&DialogShiftTimes::OnSelectedSetChanged, this))
{

View file

@ -51,7 +51,7 @@
#include "validators.h"
#include <libaegisub/of_type_adaptor.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
@ -153,7 +153,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
style = this->style = new AssStyle;
}
work = agi::util::make_unique<AssStyle>(*style);
work = agi::make_unique<AssStyle>(*style);
SetIcon(GETICON(style_toolbutton_16));
@ -359,7 +359,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
StyleName->SetInsertionPoint(0);
StyleName->SetInsertionPoint(-1);
persist = agi::util::make_unique<PersistLocation>(this, "Tool/Style Editor", true);
persist = agi::make_unique<PersistLocation>(this, "Tool/Style Editor", true);
Bind(wxEVT_CHILD_FOCUS, &DialogStyleEditor::OnChildFocus, this);

View file

@ -53,7 +53,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/split.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string/trim.hpp>
@ -224,7 +224,7 @@ DialogStyleManager::DialogStyleManager(agi::Context *context)
SetSizerAndFit(MainSizer);
// Position window
persist = agi::util::make_unique<PersistLocation>(this, "Tool/Style Manager");
persist = agi::make_unique<PersistLocation>(this, "Tool/Style Manager");
// Populate lists
LoadCatalog();
@ -334,7 +334,7 @@ void DialogStyleManager::LoadCatalog() {
// Create a default storage if there are none
if (CatalogList->IsListEmpty()) {
Store.Load(config::path->Decode("?user/catalog/Default.sty"));
Store.push_back(agi::util::make_unique<AssStyle>());
Store.push_back(agi::make_unique<AssStyle>());
Store.Save();
CatalogList->Append("Default");
}
@ -415,7 +415,7 @@ void DialogStyleManager::OnCopyToStorage() {
}
}
else {
Store.push_back(agi::util::make_unique<AssStyle>(*styleMap.at(selections[i])));
Store.push_back(agi::make_unique<AssStyle>(*styleMap.at(selections[i])));
copied.push_back(styleName);
}
}

View file

@ -36,7 +36,7 @@
#include "selection_controller.h"
#include "video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/checkbox.h>
#include <wx/colour.h>
@ -135,7 +135,7 @@ DialogStyling::DialogStyling(agi::Context *context)
SetSizerAndFit(main_sizer);
persist = agi::util::make_unique<PersistLocation>(this, "Tool/Styling Assistant");
persist = agi::make_unique<PersistLocation>(this, "Tool/Styling Assistant");
Bind(wxEVT_ACTIVATE, &DialogStyling::OnActivate, this);
Bind(wxEVT_CHAR_HOOK, &DialogStyling::OnCharHook, this);

View file

@ -37,7 +37,7 @@
#include "utils.h"
#include "video_context.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
@ -150,7 +150,7 @@ DialogTranslation::DialogTranslation(agi::Context *c)
SetSizerAndFit(main_sizer);
persist = agi::util::make_unique<PersistLocation>(this, "Tool/Translation Assistant");
persist = agi::make_unique<PersistLocation>(this, "Tool/Translation Assistant");
Bind(wxEVT_KEY_DOWN, &DialogTranslation::OnKeyDown, this);

View file

@ -22,7 +22,7 @@
#include "font_file_lister_fontconfig.h"
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#ifdef __APPLE__
#include <libaegisub/util_osx.h>

View file

@ -63,6 +63,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/log.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
@ -176,7 +177,7 @@ public:
FrameMain::FrameMain()
: wxFrame(nullptr, -1, "", wxDefaultPosition, wxSize(920,700), wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN)
, context(agi::util::make_unique<agi::Context>())
, context(agi::make_unique<agi::Context>())
{
StartupLog("Entering FrameMain constructor");

View file

@ -21,7 +21,7 @@
#include <unordered_map>
class AssDialogue;
class wxClientDC;
class wxDC;
class wxString;
namespace agi { struct Context; }
@ -70,4 +70,4 @@ public:
void SetVisible(bool new_value) { visible = new_value; }
};
std::vector<std::unique_ptr<GridColumn>> GetGridColumns();
std::vector<std::unique_ptr<GridColumn>> GetGridColumns();

View file

@ -23,7 +23,7 @@
#include <libaegisub/exception.h>
#include <libaegisub/hotkey.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include "command/command.h"
#include "compat.h"
@ -259,7 +259,7 @@ public:
};
HotkeyDataViewModel::HotkeyDataViewModel(Preferences *parent)
: root(agi::util::make_unique<HotkeyModelRoot>(this))
: root(agi::make_unique<HotkeyModelRoot>(this))
, parent(parent)
{
}

View file

@ -61,6 +61,7 @@
#include <libaegisub/hotkey.h>
#include <libaegisub/io.h>
#include <libaegisub/log.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
@ -145,7 +146,7 @@ bool AegisubApp::OnInit() {
agi::log::log = new agi::log::LogSink;
#ifdef _DEBUG
agi::log::log->Subscribe(agi::util::make_unique<agi::log::EmitSTDOUT>());
agi::log::log->Subscribe(agi::make_unique<agi::log::EmitSTDOUT>());
#endif
// Set config file
@ -170,7 +171,7 @@ bool AegisubApp::OnInit() {
StartupLog("Create log writer");
auto path_log = config::path->Decode("?user/log/");
agi::fs::CreateDirectory(path_log);
agi::log::log->Subscribe(agi::util::make_unique<agi::log::JsonEmitter>(path_log));
agi::log::log->Subscribe(agi::make_unique<agi::log::JsonEmitter>(path_log));
CleanCache(path_log, "*.json", 10, 100);
StartupLog("Load user configuration");
@ -242,7 +243,7 @@ bool AegisubApp::OnInit() {
exception_message = _("Oops, Aegisub has crashed!\n\nAn attempt has been made to save a copy of your file to:\n\n%s\n\nAegisub will now close.");
// Load plugins
Automation4::ScriptFactory::Register(agi::util::make_unique<Automation4::LuaScriptFactory>());
Automation4::ScriptFactory::Register(agi::make_unique<Automation4::LuaScriptFactory>());
libass::CacheFonts();
// Load Automation scripts
@ -251,8 +252,8 @@ bool AegisubApp::OnInit() {
// Load export filters
StartupLog("Register export filters");
AssExportFilterChain::Register(agi::util::make_unique<AssFixStylesFilter>());
AssExportFilterChain::Register(agi::util::make_unique<AssTransformFramerateFilter>());
AssExportFilterChain::Register(agi::make_unique<AssFixStylesFilter>());
AssExportFilterChain::Register(agi::make_unique<AssTransformFramerateFilter>());
StartupLog("Install PNG handler");
wxImage::AddHandler(new wxPNGHandler);

View file

@ -32,7 +32,7 @@
#include <libaegisub/json.h>
#include <libaegisub/log.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <deque>
@ -415,7 +415,7 @@ public:
namespace menu {
void GetMenuBar(std::string const& name, wxFrame *window, agi::Context *c) {
auto menu = agi::util::make_unique<CommandMenuBar>(c);
auto menu = agi::make_unique<CommandMenuBar>(c);
for (auto const& item : get_menu(name)) {
std::string submenu, disp;
read_entry(item, "submenu", &submenu);
@ -438,7 +438,7 @@ namespace menu {
}
std::unique_ptr<wxMenu> GetMenu(std::string const& name, agi::Context *c) {
auto menu = agi::util::make_unique<CommandMenu>(c);
auto menu = agi::make_unique<CommandMenu>(c);
build_menu(name, c, &menu->cm, menu.get());
menu->Bind(wxEVT_MENU_OPEN, &CommandManager::OnMenuOpen, &menu->cm);
menu->Bind(wxEVT_MENU, &CommandManager::OnMenuClick, &menu->cm);

View file

@ -28,7 +28,7 @@
#include "video_provider_manager.h"
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/checkbox.h>
#include <wx/combobox.h>
@ -52,7 +52,7 @@
type(std::string const& n, Preferences *p) : name(n), parent(p) { } \
void operator()(evttype& evt) { \
evt.Skip(); \
parent->SetOption(agi::util::make_unique<agi::opt>(name, body));\
parent->SetOption(agi::make_unique<agi::opt>(name, body));\
} \
}

View file

@ -17,11 +17,11 @@
#include "include/aegisub/spellchecker.h"
#include "spellchecker_hunspell.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
std::unique_ptr<agi::SpellChecker> SpellCheckerFactory::GetSpellChecker() {
#ifdef WITH_HUNSPELL
return agi::util::make_unique<HunspellSpellChecker>();
return agi::make_unique<HunspellSpellChecker>();
#else
return {};
#endif

View file

@ -29,7 +29,7 @@
#include <libaegisub/line_iterator.h>
#include <libaegisub/log.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/format.hpp>
#include <boost/range/algorithm.hpp>
@ -198,11 +198,11 @@ void HunspellSpellChecker::OnLanguageChanged() {
LOG_I("dictionary/file") << dic;
hunspell = agi::util::make_unique<Hunspell>(agi::fs::ShortName(aff).c_str(), agi::fs::ShortName(dic).c_str());
hunspell = agi::make_unique<Hunspell>(agi::fs::ShortName(aff).c_str(), agi::fs::ShortName(dic).c_str());
if (!hunspell) return;
conv = agi::util::make_unique<agi::charset::IconvWrapper>("utf-8", hunspell->get_dic_encoding());
rconv = agi::util::make_unique<agi::charset::IconvWrapper>(hunspell->get_dic_encoding(), "utf-8");
conv = agi::make_unique<agi::charset::IconvWrapper>("utf-8", hunspell->get_dic_encoding());
rconv = agi::make_unique<agi::charset::IconvWrapper>(hunspell->get_dic_encoding(), "utf-8");
userDicPath = config::path->Decode("?user/dictionaries")/str(boost::format("user_%s.dic") % language);
ReadUserDictionary();

View file

@ -48,7 +48,7 @@
#include <libaegisub/ass/dialogue_parser.h>
#include <libaegisub/calltip_provider.h>
#include <libaegisub/spellchecker.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
@ -83,7 +83,7 @@ enum {
SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, agi::Context *context)
: ScintillaTextCtrl(parent, -1, "", wxDefaultPosition, wsize, style)
, spellchecker(SpellCheckerFactory::GetSpellChecker())
, thesaurus(agi::util::make_unique<Thesaurus>())
, thesaurus(agi::make_unique<Thesaurus>())
, context(context)
{
// Set properties
@ -259,7 +259,7 @@ void SubsTextEditCtrl::UpdateCallTip() {
cursor_pos = pos;
if (!calltip_provider)
calltip_provider = agi::util::make_unique<agi::CalltipProvider>();
calltip_provider = agi::make_unique<agi::CalltipProvider>();
agi::Calltip new_calltip = calltip_provider->GetCalltip(tokenized_line, line_text, pos);

View file

@ -41,7 +41,7 @@
#include "video_frame.h"
#include "video_provider_dummy.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/dcclient.h>
#include <wx/msgdlg.h>
@ -50,7 +50,7 @@ SubtitlesPreview::SubtitlesPreview(wxWindow *parent, wxSize size, int winStyle,
: wxWindow(parent, -1, wxDefaultPosition, size, winStyle)
, style(new AssStyle)
, back_color(col)
, sub_file(agi::util::make_unique<AssFile>())
, sub_file(agi::make_unique<AssFile>())
, line(new AssDialogue)
{
line->Text = "{\\q2}preview";
@ -93,7 +93,7 @@ void SubtitlesPreview::SetText(std::string const& text) {
void SubtitlesPreview::SetColour(agi::Color col) {
if (col != back_color) {
back_color = col;
vid = agi::util::make_unique<DummyVideoProvider>(0.0, 10, bmp->GetWidth(), bmp->GetHeight(), back_color, true);
vid = agi::make_unique<DummyVideoProvider>(0.0, 10, bmp->GetWidth(), bmp->GetHeight(), back_color, true);
UpdateBitmap();
}
}
@ -126,11 +126,11 @@ void SubtitlesPreview::OnSize(wxSizeEvent &evt) {
int w = evt.GetSize().GetWidth();
int h = evt.GetSize().GetHeight();
bmp = agi::util::make_unique<wxBitmap>(w, h, -1);
vid = agi::util::make_unique<DummyVideoProvider>(0.0, 10, w, h, back_color, true);
bmp = agi::make_unique<wxBitmap>(w, h, -1);
vid = agi::make_unique<DummyVideoProvider>(0.0, 10, w, h, back_color, true);
try {
if (!progress)
progress = agi::util::make_unique<DialogProgress>(this);
progress = agi::make_unique<DialogProgress>(this);
if (!provider)
provider = SubtitlesProviderFactory::GetProvider(progress.get());
}

View file

@ -54,7 +54,7 @@
#include "video_context.h"
#include <libaegisub/fs.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string/join.hpp>
@ -272,15 +272,15 @@ void SubtitleFormat::MergeIdentical(AssFile &file) {
void SubtitleFormat::LoadFormats() {
if (formats.empty()) {
formats.emplace_back(agi::util::make_unique<AssSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<Ebu3264SubtitleFormat>());
formats.emplace_back(agi::util::make_unique<EncoreSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<MKVSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<MicroDVDSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<SRTSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<TTXTSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<TXTSubtitleFormat>());
formats.emplace_back(agi::util::make_unique<TranStationSubtitleFormat>());
formats.emplace_back(agi::make_unique<AssSubtitleFormat>());
formats.emplace_back(agi::make_unique<Ebu3264SubtitleFormat>());
formats.emplace_back(agi::make_unique<EncoreSubtitleFormat>());
formats.emplace_back(agi::make_unique<MKVSubtitleFormat>());
formats.emplace_back(agi::make_unique<MicroDVDSubtitleFormat>());
formats.emplace_back(agi::make_unique<SRTSubtitleFormat>());
formats.emplace_back(agi::make_unique<TTXTSubtitleFormat>());
formats.emplace_back(agi::make_unique<TXTSubtitleFormat>());
formats.emplace_back(agi::make_unique<TranStationSubtitleFormat>());
}
}

View file

@ -43,7 +43,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/path.h>
#include <libaegisub/scoped_ptr.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/vfr.h>
#include <boost/filesystem.hpp>
@ -139,7 +139,7 @@ std::vector<std::string> List() {
}
std::unique_ptr<SubtitlesProvider> Create(std::string const& name, agi::BackgroundRunner *) {
return agi::util::make_unique<CSRISubtitlesProvider>(name);
return agi::make_unique<CSRISubtitlesProvider>(name);
}
}
#endif // WITH_CSRI

View file

@ -45,6 +45,7 @@
#include <libaegisub/background_runner.h>
#include <libaegisub/dispatch.h>
#include <libaegisub/log.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/util.h>
#include <atomic>
@ -227,7 +228,7 @@ void LibassSubtitlesProvider::DrawSubtitles(VideoFrame &frame,double time) {
namespace libass {
std::unique_ptr<SubtitlesProvider> Create(std::string const&, agi::BackgroundRunner *br) {
return agi::util::make_unique<LibassSubtitlesProvider>(br);
return agi::make_unique<LibassSubtitlesProvider>(br);
}
void CacheFonts() {

View file

@ -17,7 +17,7 @@
#include "text_file_reader.h"
#include <libaegisub/file_mapping.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>
@ -25,8 +25,8 @@
#include <boost/interprocess/streams/bufferstream.hpp>
TextFileReader::TextFileReader(agi::fs::path const& filename, std::string encoding, bool trim)
: file(agi::util::make_unique<agi::read_file_mapping>(filename))
, stream(agi::util::make_unique<boost::interprocess::ibufferstream>(file->read(), file->size()))
: file(agi::make_unique<agi::read_file_mapping>(filename))
, stream(agi::make_unique<boost::interprocess::ibufferstream>(file->read(), file->size()))
, trim(trim)
, iter(agi::line_iterator<std::string>(*stream, encoding))
{

View file

@ -25,7 +25,7 @@
#include <libaegisub/io.h>
#include <libaegisub/charset_conv.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
@ -37,7 +37,7 @@ TextFileWriter::TextFileWriter(agi::fs::path const& filename, std::string encodi
if (encoding.empty())
encoding = OPT_GET("App/Save Charset")->GetString();
if (boost::iequals(encoding, "utf-8"))
conv = agi::util::make_unique<agi::charset::IconvWrapper>("utf-8", encoding.c_str(), true);
conv = agi::make_unique<agi::charset::IconvWrapper>("utf-8", encoding.c_str(), true);
try {
// Write the BOM

View file

@ -32,7 +32,7 @@
#include <libaegisub/log.h>
#include <libaegisub/path.h>
#include <libaegisub/thesaurus.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
Thesaurus::Thesaurus()
: lang_listener(OPT_SUB("Tool/Thesaurus/Language", &Thesaurus::OnLanguageChanged, this))
@ -100,7 +100,7 @@ void Thesaurus::OnLanguageChanged() {
agi::dispatch::Background().Async([=]{
try {
auto thes = agi::util::make_unique<agi::Thesaurus>(dat, idx);
auto thes = agi::make_unique<agi::Thesaurus>(dat, idx);
agi::dispatch::Main().Sync([&thes, this]{
impl = std::move(thes);
});

View file

@ -31,7 +31,7 @@
#include <libaegisub/json.h>
#include <libaegisub/log.h>
#include <libaegisub/signal.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/join.hpp>
#include <boost/interprocess/streams/bufferstream.hpp>

View file

@ -54,7 +54,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/keyframe.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/msgdlg.h>
@ -117,7 +117,7 @@ void VideoContext::SetVideo(const agi::fs::path &filename) {
if (!progress)
progress = new DialogProgress(context->parent);
auto old_matrix = context->ass->GetScriptInfo("YCbCr Matrix");
provider = agi::util::make_unique<ThreadedFrameSource>(filename, old_matrix, this, progress);
provider = agi::make_unique<ThreadedFrameSource>(filename, old_matrix, this, progress);
video_provider = provider->GetVideoProvider();
video_filename = filename;

View file

@ -51,7 +51,7 @@
#include "video_frame.h"
#include "visual_tool.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
@ -98,7 +98,7 @@ VideoDisplay::VideoDisplay(
, toolBar(visualSubToolBar)
, zoomBox(zoomBox)
, freeSize(freeSize)
, retina_helper(agi::util::make_unique<RetinaHelper>(this))
, retina_helper(agi::make_unique<RetinaHelper>(this))
, scale_factor(retina_helper->GetScaleFactor())
, scale_factor_connection(retina_helper->AddScaleFactorListener([=](int new_scale_factor) {
double new_zoom = zoomValue * new_scale_factor / scale_factor;
@ -150,7 +150,7 @@ bool VideoDisplay::InitContext() {
return false;
if (!glContext)
glContext = agi::util::make_unique<wxGLContext>(this);
glContext = agi::make_unique<wxGLContext>(this);
SetCurrent(*glContext);
return true;
@ -166,7 +166,7 @@ void VideoDisplay::Render() try {
return;
if (!videoOut)
videoOut = agi::util::make_unique<VideoOutGL>();
videoOut = agi::make_unique<VideoOutGL>();
if (!tool)
cmd::call("video/tool/cross", con);

View file

@ -43,7 +43,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/log.h>
#include <libaegisub/path.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/algorithm/string/predicate.hpp>
#include <mutex>
@ -310,6 +310,6 @@ std::shared_ptr<VideoFrame> AvisynthVideoProvider::GetFrame(int n) {
namespace agi { class BackgroundRunner; }
std::unique_ptr<VideoProvider> CreateAvisynthVideoProvider(agi::fs::path const& path, std::string const& colormatrix, agi::BackgroundRunner *) {
return agi::util::make_unique<AvisynthVideoProvider>(path, colormatrix);
return agi::make_unique<AvisynthVideoProvider>(path, colormatrix);
}
#endif // HAVE_AVISYNTH

View file

@ -19,7 +19,7 @@
#include "options.h"
#include "video_frame.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <list>
@ -93,5 +93,5 @@ std::shared_ptr<VideoFrame> VideoProviderCache::GetFrame(int n) {
}
std::unique_ptr<VideoProvider> CreateCacheVideoProvider(std::unique_ptr<VideoProvider> parent) {
return agi::util::make_unique<VideoProviderCache>(std::move(parent));
return agi::make_unique<VideoProviderCache>(std::move(parent));
}

View file

@ -39,6 +39,7 @@
#include <libaegisub/color.h>
#include <libaegisub/fs.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/util.h>
#include <boost/algorithm/string/classification.hpp>
@ -121,5 +122,5 @@ std::unique_ptr<VideoProvider> CreateDummyVideoProvider(agi::fs::path const& fil
bool pattern = toks[i] == "c";
return agi::util::make_unique<DummyVideoProvider>(fps, frames, width, height, agi::Color(red, green, blue), pattern);
return agi::make_unique<DummyVideoProvider>(fps, frames, width, height, agi::Color(red, green, blue), pattern);
}

View file

@ -43,7 +43,7 @@
#include "video_frame.h"
#include <libaegisub/fs.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <wx/choicdlg.h>
#include <wx/msgdlg.h>
@ -285,7 +285,7 @@ std::shared_ptr<VideoFrame> FFmpegSourceVideoProvider::GetFrame(int n) {
}
std::unique_ptr<VideoProvider> CreateFFmpegSourceVideoProvider(agi::fs::path const& path, std::string const& colormatrix, agi::BackgroundRunner *br) {
return agi::util::make_unique<FFmpegSourceVideoProvider>(path, colormatrix, br);
return agi::make_unique<FFmpegSourceVideoProvider>(path, colormatrix, br);
}
#endif /* WITH_FFMS2 */

View file

@ -22,7 +22,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/log.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/range/iterator_range.hpp>

View file

@ -41,6 +41,7 @@
#include <libaegisub/file_mapping.h>
#include <libaegisub/fs.h>
#include <libaegisub/log.h>
#include <libaegisub/make_unique.h>
#include <libaegisub/util.h>
#include <boost/algorithm/string/case_conv.hpp>
@ -446,5 +447,5 @@ std::shared_ptr<VideoFrame> YUV4MPEGVideoProvider::GetFrame(int n) {
namespace agi { class BackgroundRunner; }
std::unique_ptr<VideoProvider> CreateYUV4MPEGVideoProvider(agi::fs::path const& path, std::string const&, agi::BackgroundRunner *) {
return agi::util::make_unique<YUV4MPEGVideoProvider>(path);
return agi::make_unique<YUV4MPEGVideoProvider>(path);
}

View file

@ -26,13 +26,13 @@
#include "video_display.h"
#include <libaegisub/color.h>
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <boost/format.hpp>
VisualToolCross::VisualToolCross(VideoDisplay *parent, agi::Context *context)
: VisualTool<VisualDraggableFeature>(parent, context)
, gl_text(agi::util::make_unique<OpenGLText>())
, gl_text(agi::make_unique<OpenGLText>())
{
parent->SetCursor(wxCursor(wxCURSOR_BLANK));
}

View file

@ -30,7 +30,7 @@
#include "video_context.h"
#include "video_display.h"
#include <libaegisub/util.h>
#include <libaegisub/make_unique.h>
#include <algorithm>
#include <boost/format.hpp>
@ -230,7 +230,7 @@ void VisualToolDrag::MakeFeatures(AssDialogue *diag, feature_list::iterator pos)
Vector2D p1 = FromScriptCoords(GetLinePosition(diag));
// Create \pos feature
auto feat = agi::util::make_unique<Feature>();
auto feat = agi::make_unique<Feature>();
auto parent = feat.get();
feat->pos = p1;
feat->type = DRAG_START;
@ -245,7 +245,7 @@ void VisualToolDrag::MakeFeatures(AssDialogue *diag, feature_list::iterator pos)
// Create move destination feature
if (GetLineMove(diag, p1, p2, t1, t2)) {
feat = agi::util::make_unique<Feature>();
feat = agi::make_unique<Feature>();
feat->pos = FromScriptCoords(p2);
feat->layer = 1;
feat->type = DRAG_END;
@ -261,7 +261,7 @@ void VisualToolDrag::MakeFeatures(AssDialogue *diag, feature_list::iterator pos)
// Create org feature
if (Vector2D org = GetLineOrigin(diag)) {
feat = agi::util::make_unique<Feature>();
feat = agi::make_unique<Feature>();
feat->pos = FromScriptCoords(org);
feat->layer = -1;
feat->type = DRAG_ORIGIN;

Some files were not shown because too many files have changed in this diff Show more