summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/create_cli.cc32
-rw-r--r--src/lib/create_cli.h1
-rw-r--r--src/lib/dcp_subtitle_content.cc13
-rw-r--r--src/lib/dcp_video.cc34
-rw-r--r--src/lib/dcpomatic_socket.cc8
-rw-r--r--src/lib/hints.cc49
-rw-r--r--src/lib/util.cc22
-rw-r--r--src/lib/util.h1
-rw-r--r--src/tools/dcpomatic_verifier.cc82
-rw-r--r--src/wx/controls.cc2
-rw-r--r--src/wx/editable_list.h142
-rw-r--r--src/wx/full_language_tag_dialog.cc155
-rw-r--r--src/wx/full_language_tag_dialog.h26
-rw-r--r--src/wx/standard_controls.cc1
-rw-r--r--src/wx/supporters.cc2
-rw-r--r--src/wx/verify_dcp_result_panel.cc8
-rw-r--r--src/wx/wx_util.cc212
-rw-r--r--src/wx/wx_util.h76
18 files changed, 494 insertions, 372 deletions
diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc
index 32834be23..3ef61fe11 100644
--- a/src/lib/create_cli.cc
+++ b/src/lib/create_cli.cc
@@ -85,6 +85,8 @@ help()
" --left-eye next piece of content is for the left eye\n"
" --right-eye next piece of content is for the right eye\n"
" --auto-crop next piece of content should be auto-cropped\n"
+ " --fill-crop next piece of content should be cropped to fit the container\n"
+ " (e.g. to crop the letterboxing from a scope-in-flat image)\n"
" --colourspace next piece of content is in the given colourspace: " + colour_conversions + "\n"
" --colorspace same as --colourspace\n"
" --channel <channel> next piece of content should be mapped to audio channel L, R, C, Lfe, Ls, Rs, BsL, BsR, HI, VI\n"
@@ -184,6 +186,7 @@ CreateCLI::CreateCLI(int argc, char* argv[])
optional<string> next_colour_conversion;
auto next_frame_type = VideoFrameType::TWO_D;
auto next_auto_crop = false;
+ auto next_fill_crop = false;
optional<dcp::Channel> channel;
optional<float> gain;
optional<float> fade_in;
@@ -225,6 +228,9 @@ CreateCLI::CreateCLI(int argc, char* argv[])
} else if (a == "--auto-crop") {
next_auto_crop = true;
claimed = true;
+ } else if (a == "--fill-crop") {
+ next_fill_crop = true;
+ claimed = true;
} else if (a == "--twok") {
_twok = true;
claimed = true;
@@ -331,6 +337,7 @@ CreateCLI::CreateCLI(int argc, char* argv[])
c.path = a;
c.frame_type = next_frame_type;
c.auto_crop = next_auto_crop;
+ c.fill_crop = next_fill_crop;
c.colour_conversion = next_colour_conversion;
c.channel = channel;
c.gain = gain;
@@ -341,6 +348,7 @@ CreateCLI::CreateCLI(int argc, char* argv[])
content.push_back(c);
next_frame_type = VideoFrameType::TWO_D;
next_auto_crop = false;
+ next_fill_crop = false;
next_colour_conversion = {};
channel = {};
gain = {};
@@ -555,6 +563,30 @@ CreateCLI::make_film(function<void (string)> error) const
video->set_crop(crop);
}
+ if (cli_content.fill_crop && video->size()) {
+ auto const source_ratio = video->size()->ratio();
+ Crop crop;
+ if (source_ratio < film->container().ratio()) {
+ /* Part to extract is wider than the source */
+ auto const height = video->size()->width / film->container().ratio();
+ crop.top = crop.bottom = (video->size()->height - height) / 2;
+ } else {
+ /* Container is wider than the source */
+ auto const width = video->size()->height * film->container().ratio();
+ crop.left = crop.right = (video->size()->width - width) / 2;
+ }
+
+ error(fmt::format(
+ "Cropped {} to {} left, {} right, {} top and {} bottom",
+ film_content->path(0).string(),
+ crop.left,
+ crop.right,
+ crop.top,
+ crop.bottom
+ ));
+
+ video->set_crop(crop);
+ }
if (cli_content.colour_conversion) {
video->set_colour_conversion(PresetColourConversion::from_id(*cli_content.colour_conversion).conversion);
}
diff --git a/src/lib/create_cli.h b/src/lib/create_cli.h
index 00abf85e5..cde8598cd 100644
--- a/src/lib/create_cli.h
+++ b/src/lib/create_cli.h
@@ -42,6 +42,7 @@ public:
boost::filesystem::path path;
VideoFrameType frame_type = VideoFrameType::TWO_D;
bool auto_crop = false;
+ bool fill_crop = false;
boost::optional<std::string> colour_conversion;
boost::optional<dcp::Channel> channel;
boost::optional<float> gain;
diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc
index b285a78fe..ac8c4245b 100644
--- a/src/lib/dcp_subtitle_content.cc
+++ b/src/lib/dcp_subtitle_content.cc
@@ -38,6 +38,7 @@ using std::list;
using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
using boost::optional;
using namespace dcpomatic;
@@ -45,7 +46,9 @@ using namespace dcpomatic;
DCPSubtitleContent::DCPSubtitleContent(boost::filesystem::path path)
: Content(path)
{
- text.push_back(make_shared<TextContent>(this, TextType::OPEN_SUBTITLE, TextType::OPEN_SUBTITLE));
+ text = vector<shared_ptr<TextContent>>{make_shared<TextContent>(this, TextType::OPEN_SUBTITLE, TextType::OPEN_SUBTITLE)};
+ /* Default to turning these subtitles on */
+ only_text()->set_use(true);
}
DCPSubtitleContent::DCPSubtitleContent(cxml::ConstNodePtr node, boost::optional<boost::filesystem::path> film_directory, int version)
@@ -63,20 +66,16 @@ DCPSubtitleContent::examine(shared_ptr<const Film> film, shared_ptr<Job> job, bo
auto subtitle_asset = load(path(0));
- auto iop = dynamic_pointer_cast<dcp::InteropTextAsset>(subtitle_asset);
- auto smpte = dynamic_pointer_cast<dcp::SMPTETextAsset>(subtitle_asset);
- if (smpte) {
+ if (auto smpte = dynamic_pointer_cast<dcp::SMPTETextAsset>(subtitle_asset)) {
set_video_frame_rate(film, smpte->edit_rate().numerator);
}
boost::mutex::scoped_lock lm(_mutex);
- /* Default to turning these subtitles on */
- only_text()->set_use(true);
-
_length = ContentTime::from_seconds(subtitle_asset->latest_text_out().as_seconds());
subtitle_asset->fix_empty_font_ids();
+ only_text()->clear_fonts();
add_fonts(only_text(), subtitle_asset);
}
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc
index 775298091..66f4a3c4c 100644
--- a/src/lib/dcp_video.cc
+++ b/src/lib/dcp_video.cc
@@ -135,16 +135,32 @@ DCPVideo::get_size() const
void
DCPVideo::convert_to_xyz(uint16_t* dst) const
{
- DCPOMATIC_ASSERT(_frame->colour_conversion());
+ auto conversion = [](AVPixelFormat fmt) {
+ return fmt == AV_PIX_FMT_XYZ12LE ? AV_PIX_FMT_XYZ12LE : AV_PIX_FMT_RGB48LE;
+ };
- auto image = _frame->image(force(AV_PIX_FMT_RGB48LE), VideoRange::FULL, false);
- dcp::rgb_to_xyz(
- image->data()[0],
- dst,
- image->size(),
- image->stride()[0],
- _frame->colour_conversion().get()
- );
+ auto image = _frame->image(conversion, VideoRange::FULL, false);
+
+ if (_frame->colour_conversion()) {
+ dcp::rgb_to_xyz(
+ image->data()[0],
+ dst,
+ image->size(),
+ image->stride()[0],
+ _frame->colour_conversion().get()
+ );
+ } else {
+ auto const size = image->size();
+ auto const row_bytes = static_cast<size_t>(size.width) * 3 * sizeof(uint16_t);
+ auto src = image->data()[0];
+ auto const src_stride = image->stride()[0];
+ auto out = reinterpret_cast<uint8_t*>(dst);
+ for (int y = 0; y < size.height; ++y) {
+ memcpy(out, src, row_bytes);
+ src += src_stride;
+ out += row_bytes;
+ }
+ }
}
diff --git a/src/lib/dcpomatic_socket.cc b/src/lib/dcpomatic_socket.cc
index d3bfbc309..876fa47d3 100644
--- a/src/lib/dcpomatic_socket.cc
+++ b/src/lib/dcpomatic_socket.cc
@@ -50,7 +50,11 @@ Socket::Socket (int timeout)
void
Socket::check ()
{
+#if BOOST_VERSION >= 108700
if (_deadline.expiry() <= std::chrono::system_clock::now()) {
+#else
+ if (_deadline.expires_at() <= std::chrono::system_clock::now()) {
+#endif
_socket.close();
_deadline.expires_at(std::chrono::time_point<std::chrono::system_clock>::max());
}
@@ -321,7 +325,11 @@ Socket::set_send_buffer_size (int size)
void
Socket::set_deadline_from_now(int seconds)
{
+#if BOOST_VERSION >= 108700
_deadline.expires_after(std::chrono::seconds(seconds));
+#else
+ _deadline.expires_from_now(std::chrono::seconds(seconds));
+#endif
}
void
diff --git a/src/lib/hints.cc b/src/lib/hints.cc
index 35eb640d4..90b88a6ef 100644
--- a/src/lib/hints.cc
+++ b/src/lib/hints.cc
@@ -44,16 +44,19 @@
#include <fmt/format.h>
#include <boost/algorithm/string.hpp>
#include <iostream>
+#include <numeric>
#include "i18n.h"
using std::cout;
using std::make_shared;
+using std::map;
using std::max;
using std::shared_ptr;
using std::string;
using std::weak_ptr;
+using std::vector;
using boost::optional;
using namespace dcpomatic;
#if BOOST_VERSION >= 106100
@@ -584,24 +587,42 @@ Hints::text(PlayerText text, TextType type, optional<DCPTextTrack> track, DCPTim
void
Hints::closed_caption(PlayerText text, DCPTimePeriod period)
{
- int lines = text.string.size();
- for (auto i: text.string) {
- if (utf8_strlen(i.text()) > MAX_CLOSED_CAPTION_LENGTH) {
- ++lines;
- if (!_long_ccap) {
- _long_ccap = true;
- hint(
- fmt::format(
- "At least one of your closed caption lines has more than {} characters. "
- "It is advisable to make each line {} characters at most in length.",
- MAX_CLOSED_CAPTION_LENGTH,
- MAX_CLOSED_CAPTION_LENGTH)
- );
+ map<float, vector<StringText>> lines;
+ for (auto const& line: text.string) {
+ bool added = false;
+ for (auto& existing: lines) {
+ if (std::abs(existing.first - line.v_position()) < dcp::ALIGN_EPSILON) {
+ existing.second.push_back(line);
+ added = true;
}
}
+ if (!added) {
+ lines[line.v_position()] = { line };
+ }
+ }
+
+ for (auto const& line: lines) {
+ int const length = std::accumulate(
+ line.second.begin(),
+ line.second.end(),
+ 0,
+ [](int acc, StringText const& text) {
+ return acc + dcp::utf8_strlen(text.text());
+ });
+
+ if (length > MAX_CLOSED_CAPTION_LENGTH && !_long_ccap) {
+ _long_ccap = true;
+ hint(
+ fmt::format(
+ "At least one of your closed caption lines has more than {} characters. "
+ "It is advisable to make each line {} characters at most in length.",
+ MAX_CLOSED_CAPTION_LENGTH,
+ MAX_CLOSED_CAPTION_LENGTH)
+ );
+ }
}
- if (!_too_many_ccap_lines && lines > MAX_CLOSED_CAPTION_LINES) {
+ if (!_too_many_ccap_lines && lines.size() > MAX_CLOSED_CAPTION_LINES) {
hint(fmt::format(_("Some of your closed captions span more than {} lines, so they will be truncated."), MAX_CLOSED_CAPTION_LINES));
_too_many_ccap_lines = true;
}
diff --git a/src/lib/util.cc b/src/lib/util.cc
index adc347ab1..60b93a0c4 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -171,7 +171,7 @@ time_to_hmsf(DCPTime time, Frame rate)
m -= h * 60;
char buffer[64];
- snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d.%02d", h, m, s, static_cast<int>(f));
+ snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d:%02d", h, m, s, static_cast<int>(f));
return buffer;
}
@@ -842,26 +842,6 @@ remap(shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping ma
}
-size_t
-utf8_strlen(string s)
-{
- size_t const len = s.length();
- int N = 0;
- for (size_t i = 0; i < len; ++i) {
- unsigned char c = s[i];
- if ((c & 0xe0) == 0xc0) {
- ++i;
- } else if ((c & 0xf0) == 0xe0) {
- i += 2;
- } else if ((c & 0xf8) == 0xf0) {
- i += 3;
- }
- ++N;
- }
- return N;
-}
-
-
/** @param size Size of picture that the subtitle will be overlaid onto */
void
emit_subtitle_image(ContentTimePeriod period, dcp::TextImage sub, dcp::Size size, shared_ptr<TextDecoder> decoder)
diff --git a/src/lib/util.h b/src/lib/util.h
index aa003ff00..9863e5d94 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -84,7 +84,6 @@ extern std::string atmos_asset_filename(std::shared_ptr<dcp::AtmosAsset> asset,
extern std::string careful_string_filter(std::string s, std::wstring allowed = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.+");
extern std::pair<int, int> audio_channel_types(std::list<int> mapped, int channels);
extern std::shared_ptr<AudioBuffers> remap(std::shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping map);
-extern size_t utf8_strlen(std::string s);
extern void emit_subtitle_image(dcpomatic::ContentTimePeriod period, dcp::TextImage sub, dcp::Size size, std::shared_ptr<TextDecoder> decoder);
extern void copy_in_bits(boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)>);
extern dcp::Size scale_for_display(dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta);
diff --git a/src/tools/dcpomatic_verifier.cc b/src/tools/dcpomatic_verifier.cc
index d24100ff3..c881019d8 100644
--- a/src/tools/dcpomatic_verifier.cc
+++ b/src/tools/dcpomatic_verifier.cc
@@ -33,6 +33,7 @@
#include "wx/file_dialog.h"
#include "wx/i18n_setup.h"
#include "wx/id.h"
+#include "wx/wx_signal_manager.h"
#include "wx/verify_dcp_progress_panel.h"
#include "wx/verify_dcp_result_panel.h"
#include "wx/wx_util.h"
@@ -44,11 +45,13 @@
#include "lib/verify_dcp_job.h"
#include "lib/util.h"
#include "lib/variant.h"
+#include "lib/version.h"
#include <dcp/dcp.h>
#include <dcp/search.h>
#include <dcp/text_formatter.h>
#include <dcp/verify_report.h>
LIBDCP_DISABLE_WARNINGS
+#include <wx/cmdline.h>
#include <wx/evtloop.h>
#include <wx/progdlg.h>
#include <wx/wx.h>
@@ -123,7 +126,7 @@ private:
class DOMFrame : public wxFrame
{
public:
- explicit DOMFrame(wxString const& title)
+ explicit DOMFrame(wxString const& title, bool start, vector<boost::filesystem::path> const& dcps_to_load)
: wxFrame(nullptr, -1, title)
/* Use a panel as the only child of the Frame so that we avoid
the dark-grey background on Windows.
@@ -145,7 +148,19 @@ public:
auto dcp_sizer = new wxBoxSizer(wxHORIZONTAL);
add_label_to_sizer(dcp_sizer, _overall_panel, _("DCPs"), true, 0, wxALIGN_CENTER_VERTICAL);
- auto add = [this](wxWindow* parent) {
+ auto load_dcps = [this](vector<boost::filesystem::path> const& dcps) {
+ wxProgressDialog progress(variant::wx::dcpomatic(), _("Examining DCPs"));
+ vector<DCPPath> dcp_paths;
+ for (auto path: dcps) {
+ for (auto const& dcp: dcp::find_potential_dcps(path)) {
+ progress.Pulse();
+ dcp_paths.push_back(DCPPath(dcp, _kdms));
+ }
+ }
+ return dcp_paths;
+ };
+
+ auto add = [&load_dcps](wxWindow* parent) {
#if wxCHECK_VERSION(3, 1, 4)
DirDialog dialog(parent, _("Select DCP(s)"), wxDD_MULTIPLE, "AddVerifierInputPath");
#else
@@ -153,15 +168,7 @@ public:
#endif
if (dialog.show()) {
- wxProgressDialog progress(variant::wx::dcpomatic(), _("Examining DCPs"));
- vector<DCPPath> paths;
- for (auto path: dialog.paths()) {
- for (auto const& dcp: dcp::find_potential_dcps(path)) {
- progress.Pulse();
- paths.push_back(DCPPath(dcp, _kdms));
- }
- }
- return paths;
+ return load_dcps(dialog.paths());
} else {
return std::vector<DCPPath>{};
}
@@ -223,6 +230,12 @@ public:
} catch (...) {}
}
}
+
+ set_dcp_paths(load_dcps(dcps_to_load));
+ _dcps->refresh();
+ if (start) {
+ signal_manager->when_idle(boost::bind(&DOMFrame::verify_clicked, this));
+ }
}
private:
@@ -381,6 +394,14 @@ private:
};
+static const wxCmdLineEntryDesc command_line_description[] = {
+ { wxCMD_LINE_SWITCH, "s", "start", "start verifying specified DCP(s)", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, "v", "version", "show version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_PARAM, 0, 0, "DCP to verify", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
+};
+
+
/** @class App
* @brief The magic App class for wxWidgets.
*/
@@ -433,7 +454,10 @@ private:
*/
Config::drop();
- _frame = new DOMFrame(variant::wx::dcpomatic_verifier());
+ signal_manager = new wxSignalManager(this);
+ Bind(wxEVT_IDLE, boost::bind(&App::idle, this, _1));
+
+ _frame = new DOMFrame(variant::wx::dcpomatic_verifier(), _start, _dcps_to_load);
SetTopWindow(_frame);
_frame->Maximize();
_frame->Show();
@@ -497,7 +521,41 @@ private:
report_exception();
}
+ void OnInitCmdLine(wxCmdLineParser& parser) override
+ {
+ parser.SetDesc(command_line_description);
+ parser.SetSwitchChars(char_to_wx("-"));
+ }
+
+ bool OnCmdLineParsed(wxCmdLineParser& parser) override
+ {
+ if (parser.Found(char_to_wx("version"))) {
+ std::cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n";
+ exit(EXIT_SUCCESS);
+ }
+
+ _start = parser.Found(char_to_wx("start"));
+ for (auto i = 0UL; i < parser.GetParamCount(); ++i) {
+ auto const path = boost::filesystem::path(wx_to_std(parser.GetParam(0)));
+ if (path.filename_is_dot()) {
+ _dcps_to_load.push_back(path.parent_path());
+ } else {
+ _dcps_to_load.push_back(path);
+ }
+ }
+
+ return true;
+ }
+
+ void idle(wxIdleEvent& ev)
+ {
+ signal_manager->ui_idle();
+ ev.Skip();
+ }
+
DOMFrame* _frame = nullptr;
+ bool _start = false;
+ std::vector<boost::filesystem::path> _dcps_to_load;
};
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index fce3fd7eb..708cc9a5d 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -279,7 +279,7 @@ Controls::update_position_label()
{
if (!_film) {
checked_set(_frame_number, char_to_wx("0"));
- checked_set(_timecode, char_to_wx("0:0:0.0"));
+ checked_set(_timecode, char_to_wx("0:0:0:0"));
return;
}
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index 4b0a48f44..ede66da1c 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -36,15 +36,15 @@ LIBDCP_ENABLE_WARNINGS
class EditableListColumn
{
public:
- EditableListColumn (wxString name_)
- : name (name_)
- , growable (false)
+ EditableListColumn(wxString name_)
+ : name(name_)
+ , growable(false)
{}
- EditableListColumn (wxString name_, boost::optional<int> width_, bool growable_)
- : name (name_)
- , width (width_)
- , growable (growable_)
+ EditableListColumn(wxString name_, boost::optional<int> width_, bool growable_)
+ : name(name_)
+ , width(width_)
+ , growable(growable_)
{}
wxString name;
@@ -77,7 +77,7 @@ template<class T>
class EditableList : public wxPanel
{
public:
- EditableList (
+ EditableList(
wxWindow* parent,
std::vector<EditableListColumn> columns,
std::function<std::vector<T> ()> get,
@@ -89,17 +89,17 @@ public:
int buttons,
boost::optional<wxString> custom_button = {}
)
- : wxPanel (parent)
- , _get (get)
- , _set (set)
+ : wxPanel(parent)
+ , _get(get)
+ , _set(set)
, _add(add)
, _edit(edit)
- , _columns (columns)
- , _column (column)
- , _default_width (200)
+ , _columns(columns)
+ , _column(column)
+ , _default_width(200)
{
- _sizer = new wxBoxSizer (wxHORIZONTAL);
- SetSizer (_sizer);
+ _sizer = new wxBoxSizer(wxHORIZONTAL);
+ SetSizer(_sizer);
long style = wxLC_REPORT | wxLC_SINGLE_SEL;
if (title == EditableListTitle::INVISIBLE) {
@@ -108,18 +108,18 @@ public:
int total_width = 0;
for (auto i: _columns) {
- total_width += i.width.get_value_or (_default_width);
+ total_width += i.width.get_value_or(_default_width);
}
#ifdef __WXGTK3__
/* With the GTK3 backend wxListCtrls are hard to pick out from the background of the
* window, so put a border in to help.
*/
- auto border = new wxPanel (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_THEME);
+ auto border = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_THEME);
_list = new wxListCtrl(border, wxID_ANY, wxDefaultPosition, wxSize(total_width, -1), style);
- auto border_sizer = new wxBoxSizer (wxHORIZONTAL);
- border_sizer->Add (_list, 1, wxALL | wxEXPAND, 2);
- border->SetSizer (border_sizer);
+ auto border_sizer = new wxBoxSizer(wxHORIZONTAL);
+ border_sizer->Add(_list, 1, wxALL | wxEXPAND, 2);
+ border->SetSizer(border_sizer);
#else
_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(total_width, -1), style);
#endif
@@ -127,20 +127,20 @@ public:
int j = 0;
for (auto i: _columns) {
wxListItem ip;
- ip.SetId (j);
- ip.SetText (i.name);
- _list->InsertColumn (j, ip);
+ ip.SetId(j);
+ ip.SetText(i.name);
+ _list->InsertColumn(j, ip);
++j;
}
#ifdef __WXGTK3__
- _sizer->Add (border, 1, wxEXPAND);
+ _sizer->Add(border, 1, wxEXPAND);
#else
- _sizer->Add (_list, 1, wxEXPAND);
+ _sizer->Add(_list, 1, wxEXPAND);
#endif
{
- auto s = new wxBoxSizer (wxVERTICAL);
+ auto s = new wxBoxSizer(wxVERTICAL);
if (buttons & EditableListButton::NEW) {
_add_button = new Button(this, _("Add..."));
s->Add(_add_button, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
@@ -157,7 +157,7 @@ public:
_remove_button = new Button(this, _("Remove"));
s->Add(_remove_button, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
}
- _sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
+ _sizer->Add(s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
}
if (_add_button) {
@@ -170,43 +170,43 @@ public:
_remove_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind(&EditableList::remove_clicked, this));
}
- _list->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&EditableList::selection_changed, this));
- _list->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&EditableList::selection_changed, this));
+ _list->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind(&EditableList::selection_changed, this));
+ _list->Bind(wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind(&EditableList::selection_changed, this));
#if BOOST_VERSION >= 106100
- _list->Bind (wxEVT_SIZE, boost::bind (&EditableList::resized, this, boost::placeholders::_1));
+ _list->Bind(wxEVT_SIZE, boost::bind(&EditableList::resized, this, boost::placeholders::_1));
#else
- _list->Bind (wxEVT_SIZE, boost::bind (&EditableList::resized, this, _1));
+ _list->Bind(wxEVT_SIZE, boost::bind(&EditableList::resized, this, _1));
#endif
- refresh ();
- selection_changed ();
+ refresh();
+ selection_changed();
}
- void refresh ()
+ void refresh()
{
- _list->DeleteAllItems ();
+ _list->DeleteAllItems();
- auto current = _get ();
+ auto current = _get();
for (auto const& i: current) {
- add_to_control (i);
+ add_to_control(i);
}
}
- boost::optional<T> selection () const
+ boost::optional<T> selection() const
{
- int item = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ int item = _list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (item == -1) {
return {};
}
- auto all = _get ();
- DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
+ auto all = _get();
+ DCPOMATIC_ASSERT(item >= 0 && item < int(all.size()));
return all[item];
}
- void layout ()
+ void layout()
{
- _sizer->Layout ();
+ _sizer->Layout();
}
Button* custom_button()
@@ -244,21 +244,21 @@ public:
private:
- void add_to_control (T item)
+ void add_to_control(T item)
{
wxListItem list_item;
- int const n = _list->GetItemCount ();
- list_item.SetId (n);
- _list->InsertItem (list_item);
+ int const n = _list->GetItemCount();
+ list_item.SetId(n);
+ _list->InsertItem(list_item);
for (size_t i = 0; i < _columns.size(); ++i) {
- _list->SetItem (n, i, std_to_wx (_column (item, i)));
+ _list->SetItem(n, i, std_to_wx(_column(item, i)));
}
}
- void selection_changed ()
+ void selection_changed()
{
- int const i = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ int const i = _list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (_edit_button) {
_edit_button->Enable(i >= 0);
}
@@ -266,10 +266,10 @@ private:
_remove_button->Enable(i >= 0);
}
- SelectionChanged ();
+ SelectionChanged();
}
- void add_clicked ()
+ void add_clicked()
{
auto all = _get();
for (auto item: _add(this)) {
@@ -279,41 +279,41 @@ private:
_set(all);
}
- void edit_clicked ()
+ void edit_clicked()
{
- int item = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ int item = _list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (item == -1) {
return;
}
- std::vector<T> all = _get ();
- DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
+ std::vector<T> all = _get();
+ DCPOMATIC_ASSERT(item >= 0 && item < int(all.size()));
_edit(this, all[item]);
for (size_t i = 0; i < _columns.size(); ++i) {
- _list->SetItem (item, i, std_to_wx (_column (all[item], i)));
+ _list->SetItem(item, i, std_to_wx(_column(all[item], i)));
}
- _set (all);
+ _set(all);
}
- void remove_clicked ()
+ void remove_clicked()
{
- int i = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ int i = _list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (i == -1) {
return;
}
- _list->DeleteItem (i);
- auto all = _get ();
- all.erase (all.begin() + i);
- _set (all);
+ _list->DeleteItem(i);
+ auto all = _get();
+ all.erase(all.begin() + i);
+ _set(all);
- selection_changed ();
+ selection_changed();
}
- void resized (wxSizeEvent& ev)
+ void resized(wxSizeEvent& ev)
{
int const w = _list->GetSize().GetWidth() - 2;
@@ -321,9 +321,9 @@ private:
int growable = 0;
int j = 0;
for (auto i: _columns) {
- fixed_width += i.width.get_value_or (_default_width);
+ fixed_width += i.width.get_value_or(_default_width);
if (!i.growable) {
- _list->SetColumnWidth (j, i.width.get_value_or(_default_width));
+ _list->SetColumnWidth(j, i.width.get_value_or(_default_width));
} else {
++growable;
}
@@ -333,12 +333,12 @@ private:
j = 0;
for (auto i: _columns) {
if (i.growable) {
- _list->SetColumnWidth (j, i.width.get_value_or(_default_width) + (w - fixed_width) / growable);
+ _list->SetColumnWidth(j, i.width.get_value_or(_default_width) + (w - fixed_width) / growable);
}
++j;
}
- ev.Skip ();
+ ev.Skip();
}
std::function <std::vector<T> ()> _get;
diff --git a/src/wx/full_language_tag_dialog.cc b/src/wx/full_language_tag_dialog.cc
index 89987715a..0d0936696 100644
--- a/src/wx/full_language_tag_dialog.cc
+++ b/src/wx/full_language_tag_dialog.cc
@@ -52,76 +52,75 @@ using namespace boost::placeholders;
#endif
-FullLanguageTagDialog::FullLanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag)
- : wxDialog (parent, wxID_ANY, _("Language Tag"), wxDefaultPosition, wxSize(-1, 500))
+FullLanguageTagDialog::FullLanguageTagDialog(wxWindow* parent, dcp::LanguageTag tag)
+ : wxDialog(parent, wxID_ANY, _("Language Tag"), wxDefaultPosition, wxSize(-1, 500))
{
- _current_tag_list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER);
+ _current_tag_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER);
_current_tag_list->AppendColumn({}, wxLIST_FORMAT_LEFT, 200);
_current_tag_list->AppendColumn({}, wxLIST_FORMAT_LEFT, 400);
- auto button_sizer = new wxBoxSizer (wxVERTICAL);
+ auto button_sizer = new wxBoxSizer(wxVERTICAL);
_add_script = new wxButton(this, wxID_ANY, _("Add script"));
- button_sizer->Add (_add_script, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
+ button_sizer->Add(_add_script, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
_add_region = new wxButton(this, wxID_ANY, _("Add region"));
- button_sizer->Add (_add_region, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
+ button_sizer->Add(_add_region, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
_add_variant = new wxButton(this, wxID_ANY, _("Add variant"));
- button_sizer->Add (_add_variant, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
+ button_sizer->Add(_add_variant, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
_add_extended = new wxButton(this, wxID_ANY, _("Add extended"));
button_sizer->Add(_add_extended, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
_remove = new wxButton(this, wxID_ANY, _("Remove"));
- button_sizer->Add (_remove, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
+ button_sizer->Add(_remove, 0, wxTOP | wxBOTTOM | wxEXPAND, 2);
- _choose_subtag_panel = new LanguageSubtagPanel (this);
- _choose_subtag_panel->set (dcp::LanguageTag::SubtagType::LANGUAGE, "");
+ _choose_subtag_panel = new LanguageSubtagPanel(this);
+ _choose_subtag_panel->set(dcp::LanguageTag::SubtagType::LANGUAGE, "");
- auto ltor_sizer = new wxBoxSizer (wxHORIZONTAL);
- ltor_sizer->Add (_current_tag_list, 1, wxALL, 8);
- ltor_sizer->Add (button_sizer, 0, wxALL, 8);
- ltor_sizer->Add (_choose_subtag_panel, 1, wxALL, 8);
+ auto ltor_sizer = new wxBoxSizer(wxHORIZONTAL);
+ ltor_sizer->Add(_current_tag_list, 1, wxALL, 8);
+ ltor_sizer->Add(button_sizer, 0, wxALL, 8);
+ ltor_sizer->Add(_choose_subtag_panel, 1, wxALL, 8);
- auto overall_sizer = new wxBoxSizer (wxVERTICAL);
- overall_sizer->Add (ltor_sizer, 0);
+ auto overall_sizer = new wxBoxSizer(wxVERTICAL);
+ overall_sizer->Add(ltor_sizer, 0);
- auto buttons = CreateSeparatedButtonSizer (wxOK);
- if (buttons) {
- overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
+ if (auto buttons = CreateSeparatedButtonSizer(wxOK)) {
+ overall_sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
}
- SetSizerAndFit (overall_sizer);
+ SetSizerAndFit(overall_sizer);
- set (tag);
+ set(tag);
- _add_script->Bind (wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::SCRIPT, boost::optional<dcp::LanguageTag::SubtagData>()));
- _add_region->Bind (wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::REGION, boost::optional<dcp::LanguageTag::SubtagData>()));
- _add_variant->Bind (wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::VARIANT, boost::optional<dcp::LanguageTag::SubtagData>()));
+ _add_script->Bind(wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::SCRIPT, boost::optional<dcp::LanguageTag::SubtagData>()));
+ _add_region->Bind(wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::REGION, boost::optional<dcp::LanguageTag::SubtagData>()));
+ _add_variant->Bind(wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::VARIANT, boost::optional<dcp::LanguageTag::SubtagData>()));
_add_extended->Bind(wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::EXTLANG, boost::optional<dcp::LanguageTag::SubtagData>()));
- _remove->Bind (wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::remove_from_current_tag, this));
+ _remove->Bind(wxEVT_BUTTON, boost::bind(&FullLanguageTagDialog::remove_from_current_tag, this));
_choose_subtag_panel->SelectionChanged.connect(bind(&FullLanguageTagDialog::chosen_subtag_changed, this, _1));
_choose_subtag_panel->SearchChanged.connect(bind(&FullLanguageTagDialog::search_changed, this, _1));
- _current_tag_list->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind(&FullLanguageTagDialog::current_tag_selection_changed, this));
- _current_tag_list->Bind (wxEVT_LIST_ITEM_DESELECTED, boost::bind(&FullLanguageTagDialog::current_tag_selection_changed, this));
+ _current_tag_list->Bind(wxEVT_LIST_ITEM_SELECTED, boost::bind(&FullLanguageTagDialog::current_tag_selection_changed, this));
+ _current_tag_list->Bind(wxEVT_LIST_ITEM_DESELECTED, boost::bind(&FullLanguageTagDialog::current_tag_selection_changed, this));
}
void
-FullLanguageTagDialog::remove_from_current_tag ()
+FullLanguageTagDialog::remove_from_current_tag()
{
- auto selected = _current_tag_list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ auto selected = _current_tag_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected <= 0) {
return;
}
- _current_tag_subtags.erase (_current_tag_subtags.begin() + selected);
- _current_tag_list->DeleteItem (selected);
+ _current_tag_subtags.erase(_current_tag_subtags.begin() + selected);
+ _current_tag_list->DeleteItem(selected);
- _current_tag_list->SetItemState (min(selected, _current_tag_list->GetItemCount() - 1L), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+ _current_tag_list->SetItemState(min(selected, _current_tag_list->GetItemCount() - 1L), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
- setup_sensitivity ();
- current_tag_selection_changed ();
+ setup_sensitivity();
+ current_tag_selection_changed();
}
-dcp::LanguageTag FullLanguageTagDialog::get () const
+dcp::LanguageTag FullLanguageTagDialog::get() const
{
dcp::LanguageTag tag;
@@ -134,50 +133,50 @@ dcp::LanguageTag FullLanguageTagDialog::get () const
}
switch (i.type) {
case dcp::LanguageTag::SubtagType::LANGUAGE:
- tag.set_language (i.subtag->subtag);
+ tag.set_language(i.subtag->subtag);
break;
case dcp::LanguageTag::SubtagType::SCRIPT:
- tag.set_script (i.subtag->subtag);
+ tag.set_script(i.subtag->subtag);
break;
case dcp::LanguageTag::SubtagType::REGION:
- tag.set_region (i.subtag->subtag);
+ tag.set_region(i.subtag->subtag);
break;
case dcp::LanguageTag::SubtagType::VARIANT:
- variants.push_back (i.subtag->subtag);
+ variants.push_back(i.subtag->subtag);
break;
case dcp::LanguageTag::SubtagType::EXTLANG:
- extlangs.push_back (i.subtag->subtag);
+ extlangs.push_back(i.subtag->subtag);
break;
}
}
- tag.set_variants (variants);
- tag.set_extlangs (extlangs);
+ tag.set_variants(variants);
+ tag.set_extlangs(extlangs);
return tag;
}
void
-FullLanguageTagDialog::set (dcp::LanguageTag tag)
+FullLanguageTagDialog::set(dcp::LanguageTag tag)
{
- _current_tag_subtags.clear ();
- _current_tag_list->DeleteAllItems ();
+ _current_tag_subtags.clear();
+ _current_tag_list->DeleteAllItems();
bool have_language = false;
for (auto const& i: tag.subtags()) {
- add_to_current_tag (i.first, i.second);
+ add_to_current_tag(i.first, i.second);
if (i.first == dcp::LanguageTag::SubtagType::LANGUAGE) {
have_language = true;
}
}
if (!have_language) {
- add_to_current_tag (dcp::LanguageTag::SubtagType::LANGUAGE, dcp::LanguageTag::SubtagData("en", "English"));
+ add_to_current_tag(dcp::LanguageTag::SubtagType::LANGUAGE, dcp::LanguageTag::SubtagData("en", "English"));
}
}
-string FullLanguageTagDialog::subtag_type_name (dcp::LanguageTag::SubtagType type)
+string FullLanguageTagDialog::subtag_type_name(dcp::LanguageTag::SubtagType type)
{
switch (type) {
case dcp::LanguageTag::SubtagType::LANGUAGE:
@@ -197,9 +196,9 @@ string FullLanguageTagDialog::subtag_type_name (dcp::LanguageTag::SubtagType typ
void
-FullLanguageTagDialog::search_changed (string search)
+FullLanguageTagDialog::search_changed(string search)
{
- long int selected = _current_tag_list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ long int selected = _current_tag_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected >= 0) {
_current_tag_subtags[selected].last_search = search;
}
@@ -207,75 +206,75 @@ FullLanguageTagDialog::search_changed (string search)
void
-FullLanguageTagDialog::add_to_current_tag (dcp::LanguageTag::SubtagType type, optional<dcp::LanguageTag::SubtagData> subtag)
+FullLanguageTagDialog::add_to_current_tag(dcp::LanguageTag::SubtagType type, optional<dcp::LanguageTag::SubtagData> subtag)
{
- _current_tag_subtags.push_back (Subtag(type, subtag));
+ _current_tag_subtags.push_back(Subtag(type, subtag));
wxListItem it;
- it.SetId (_current_tag_list->GetItemCount());
- it.SetColumn (0);
+ it.SetId(_current_tag_list->GetItemCount());
+ it.SetColumn(0);
it.SetText(std_to_wx(subtag_type_name(type)));
- _current_tag_list->InsertItem (it);
- it.SetColumn (1);
+ _current_tag_list->InsertItem(it);
+ it.SetColumn(1);
if (subtag) {
it.SetText(std_to_wx(subtag->description));
} else {
it.SetText(_("Select..."));
}
- _current_tag_list->SetItem (it);
- _current_tag_list->SetItemState (_current_tag_list->GetItemCount() - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
- _choose_subtag_panel->set (type, "");
- setup_sensitivity ();
- current_tag_selection_changed ();
+ _current_tag_list->SetItem(it);
+ _current_tag_list->SetItemState(_current_tag_list->GetItemCount() - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+ _choose_subtag_panel->set(type, "");
+ setup_sensitivity();
+ current_tag_selection_changed();
}
void
-FullLanguageTagDialog::current_tag_selection_changed ()
+FullLanguageTagDialog::current_tag_selection_changed()
{
- auto selected = _current_tag_list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ auto selected = _current_tag_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected >= 0) {
- _choose_subtag_panel->Enable (true);
- _choose_subtag_panel->set (_current_tag_subtags[selected].type, _current_tag_subtags[selected].last_search, _current_tag_subtags[selected].subtag);
+ _choose_subtag_panel->Enable(true);
+ _choose_subtag_panel->set(_current_tag_subtags[selected].type, _current_tag_subtags[selected].last_search, _current_tag_subtags[selected].subtag);
} else {
- _choose_subtag_panel->Enable (false);
+ _choose_subtag_panel->Enable(false);
}
}
void
-FullLanguageTagDialog::chosen_subtag_changed (optional<dcp::LanguageTag::SubtagData> selection)
+FullLanguageTagDialog::chosen_subtag_changed(optional<dcp::LanguageTag::SubtagData> selection)
{
if (!selection) {
return;
}
- auto selected = _current_tag_list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ auto selected = _current_tag_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected >= 0) {
_current_tag_subtags[selected].subtag = *selection;
_current_tag_list->SetItem(selected, 0, std_to_wx(subtag_type_name(_current_tag_subtags[selected].type)));
_current_tag_list->SetItem(selected, 1, std_to_wx(selection->description));
}
- setup_sensitivity ();
+ setup_sensitivity();
}
void
-FullLanguageTagDialog::setup_sensitivity ()
+FullLanguageTagDialog::setup_sensitivity()
{
- _add_script->Enable ();
- _add_region->Enable ();
- _add_variant->Enable ();
+ _add_script->Enable();
+ _add_region->Enable();
+ _add_variant->Enable();
_add_extended->Enable();
for (auto const& i: _current_tag_subtags) {
switch (i.type) {
case dcp::LanguageTag::SubtagType::SCRIPT:
- _add_script->Enable (false);
+ _add_script->Enable(false);
break;
case dcp::LanguageTag::SubtagType::REGION:
- _add_region->Enable (false);
+ _add_region->Enable(false);
break;
case dcp::LanguageTag::SubtagType::VARIANT:
- _add_variant->Enable (false);
+ _add_variant->Enable(false);
break;
case dcp::LanguageTag::SubtagType::EXTLANG:
_add_extended->Enable(false);
@@ -284,7 +283,7 @@ FullLanguageTagDialog::setup_sensitivity ()
break;
}
}
- auto selected = _current_tag_list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- _remove->Enable (selected > 0);
+ auto selected = _current_tag_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ _remove->Enable(selected > 0);
}
diff --git a/src/wx/full_language_tag_dialog.h b/src/wx/full_language_tag_dialog.h
index 883b50dfb..0a256f016 100644
--- a/src/wx/full_language_tag_dialog.h
+++ b/src/wx/full_language_tag_dialog.h
@@ -43,9 +43,9 @@ public:
class Subtag
{
public:
- Subtag (dcp::LanguageTag::SubtagType type_, boost::optional<dcp::LanguageTag::SubtagData> subtag_)
- : type (type_)
- , subtag (subtag_)
+ Subtag(dcp::LanguageTag::SubtagType type_, boost::optional<dcp::LanguageTag::SubtagData> subtag_)
+ : type(type_)
+ , subtag(subtag_)
{}
dcp::LanguageTag::SubtagType type;
@@ -53,20 +53,20 @@ public:
std::string last_search;
};
- FullLanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag = dcp::LanguageTag("en"));
+ FullLanguageTagDialog(wxWindow* parent, dcp::LanguageTag tag = dcp::LanguageTag("en"));
- dcp::LanguageTag get () const;
- void set (dcp::LanguageTag tag);
+ dcp::LanguageTag get() const;
+ void set(dcp::LanguageTag tag);
private:
- std::string subtag_type_name (dcp::LanguageTag::SubtagType type);
- void search_changed (std::string search);
- void add_to_current_tag (dcp::LanguageTag::SubtagType type, boost::optional<dcp::LanguageTag::SubtagData> subtag);
- void remove_from_current_tag ();
- void current_tag_selection_changed ();
- void chosen_subtag_changed (boost::optional<dcp::LanguageTag::SubtagData> selection);
- void setup_sensitivity ();
+ std::string subtag_type_name(dcp::LanguageTag::SubtagType type);
+ void search_changed(std::string search);
+ void add_to_current_tag(dcp::LanguageTag::SubtagType type, boost::optional<dcp::LanguageTag::SubtagData> subtag);
+ void remove_from_current_tag();
+ void current_tag_selection_changed();
+ void chosen_subtag_changed(boost::optional<dcp::LanguageTag::SubtagData> selection);
+ void setup_sensitivity();
std::vector<Subtag> _current_tag_subtags;
wxListCtrl* _current_tag_list;
diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc
index 942c49fc4..d9b8c998b 100644
--- a/src/wx/standard_controls.cc
+++ b/src/wx/standard_controls.cc
@@ -38,6 +38,7 @@ StandardControls::StandardControls(wxWindow* parent, FilmViewer& viewer, bool ed
{
_button_sizer->Add (_play_button, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
_play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this));
+ setup_sensitivity();
}
diff --git a/src/wx/supporters.cc b/src/wx/supporters.cc
index 77ac85f8d..dff4f9a7c 100644
--- a/src/wx/supporters.cc
+++ b/src/wx/supporters.cc
@@ -526,6 +526,7 @@ supported_by.Add (wxT ("Reeju George"));
supported_by.Add (wxT ("Rob George"));
supported_by.Add (wxT ("Ian Gibbins"));
supported_by.Add (wxT ("John Gigrich"));
+supported_by.Add (wxT ("Weldon Gillian"));
supported_by.Add (wxT ("Barry J. Gillis"));
supported_by.Add (wxT ("Victor Gimenez"));
supported_by.Add (wxT ("Sebastian Hernandis Giner"));
@@ -1490,6 +1491,7 @@ supported_by.Add (wxT ("Tilman Vatteroth"));
supported_by.Add (wxT ("Jos Vecht"));
supported_by.Add (wxT ("Christian Vennefrohne"));
supported_by.Add (wxT ("Jaap Verseput"));
+supported_by.Add (wxT ("Dan Viafore"));
supported_by.Add (wxT ("Videoworld"));
supported_by.Add (wxT ("Robert Vidić"));
supported_by.Add (wxT ("Burg Kino Vienna"));
diff --git a/src/wx/verify_dcp_result_panel.cc b/src/wx/verify_dcp_result_panel.cc
index 425a3eb00..aa5da95c6 100644
--- a/src/wx/verify_dcp_result_panel.cc
+++ b/src/wx/verify_dcp_result_panel.cc
@@ -230,6 +230,12 @@ VerifyDCPResultPanel::add(shared_ptr<const VerifyDCPJob> job, bool many)
if (auto const error = note.error()) {
message.Replace(char_to_wx("%error"), std_to_wx(*error));
}
+ if (auto const bit_depth = note.bit_depth()) {
+ message.Replace(char_to_wx("%bit_depth"), std_to_wx(fmt::to_string(*bit_depth)));
+ }
+ if (auto const issue_date = note.issue_date()) {
+ message.Replace(char_to_wx("%issue_date"), std_to_wx(*issue_date));
+ }
if (auto const size_in_pixels = note.size_in_pixels()) {
message.Replace(char_to_wx("%size_in_pixels"), wxString::Format(char_to_wx("%dx%d"), size_in_pixels->width, size_in_pixels->height));
}
@@ -339,7 +345,7 @@ VerifyDCPResultPanel::add(shared_ptr<const VerifyDCPJob> job, bool many)
);
break;
case dcp::VerificationNote::Code::EXTERNAL_ASSET:
- add(i.second, _("This DCP refers to at the asset %asset_id in another DCP (and perhaps others), so it is a \"version file\" (VF)"));
+ add(i.second, _("This DCP refers to the asset %asset_id in another DCP (and perhaps others), so it is a \"version file\" (VF)"));
break;
case dcp::VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD:
add(i.second, _("The asset %f is 3D but its MXF is marked as 2D."));
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 8d21a3e63..8e86a5408 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -65,9 +65,9 @@ using namespace dcpomatic;
wxStaticText *
#ifdef __WXOSX__
-create_label (wxWindow* p, wxString t, bool left)
+create_label(wxWindow* p, wxString t, bool left)
#else
-create_label (wxWindow* p, wxString t, bool)
+create_label(wxWindow* p, wxString t, bool)
#endif
{
#ifdef __WXOSX__
@@ -75,14 +75,14 @@ create_label (wxWindow* p, wxString t, bool)
t += char_to_wx(":");
}
#endif
- return new StaticText (p, t);
+ return new StaticText(p, t);
}
#ifdef __WXOSX__
static
void
-setup_osx_flags (wxSizer* s, bool left, int& flags)
+setup_osx_flags(wxSizer* s, bool left, int& flags)
{
if (left) {
auto box = dynamic_cast<wxBoxSizer*>(s);
@@ -103,28 +103,28 @@ setup_osx_flags (wxSizer* s, bool left, int& flags)
* @param prop Proportion to pass when calling Add() on the wxSizer.
*/
wxStaticText *
-add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, bool left, int prop, int flags)
+add_label_to_sizer(wxSizer* s, wxWindow* p, wxString t, bool left, int prop, int flags)
{
#ifdef __WXOSX__
- setup_osx_flags (s, left, flags);
+ setup_osx_flags(s, left, flags);
#endif
- auto m = create_label (p, t, left);
- s->Add (m, prop, flags, DCPOMATIC_SIZER_GAP);
+ auto m = create_label(p, t, left);
+ s->Add(m, prop, flags, DCPOMATIC_SIZER_GAP);
return m;
}
wxStaticText *
#ifdef __WXOSX__
-add_label_to_sizer (wxSizer* s, wxStaticText* t, bool left, int prop, int flags)
+add_label_to_sizer(wxSizer* s, wxStaticText* t, bool left, int prop, int flags)
#else
-add_label_to_sizer (wxSizer* s, wxStaticText* t, bool, int prop, int flags)
+add_label_to_sizer(wxSizer* s, wxStaticText* t, bool, int prop, int flags)
#endif
{
#ifdef __WXOSX__
- setup_osx_flags (s, left, flags);
+ setup_osx_flags(s, left, flags);
#endif
- s->Add (t, prop, flags, DCPOMATIC_SIZER_GAP);
+ s->Add(t, prop, flags, DCPOMATIC_SIZER_GAP);
return t;
}
@@ -134,9 +134,9 @@ add_label_to_sizer(wxGridBagSizer* s, wxWindow* p, wxString t, bool left, wxGBPo
{
int flags = wxALIGN_CENTER_VERTICAL | wxLEFT;
#ifdef __WXOSX__
- setup_osx_flags (s, left, flags);
+ setup_osx_flags(s, left, flags);
#endif
- auto m = create_label (p, t, left);
+ auto m = create_label(p, t, left);
s->Add(m, pos, span, flags, indent ? DCPOMATIC_SIZER_X_GAP : 0);
return m;
}
@@ -144,16 +144,16 @@ add_label_to_sizer(wxGridBagSizer* s, wxWindow* p, wxString t, bool left, wxGBPo
wxStaticText *
#ifdef __WXOSX__
-add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool left, wxGBPosition pos, wxGBSpan span)
+add_label_to_sizer(wxGridBagSizer* s, wxStaticText* t, bool left, wxGBPosition pos, wxGBSpan span)
#else
-add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool, wxGBPosition pos, wxGBSpan span)
+add_label_to_sizer(wxGridBagSizer* s, wxStaticText* t, bool, wxGBPosition pos, wxGBSpan span)
#endif
{
int flags = wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT;
#ifdef __WXOSX__
- setup_osx_flags (s, left, flags);
+ setup_osx_flags(s, left, flags);
#endif
- s->Add (t, pos, span, flags);
+ s->Add(t, pos, span, flags);
return t;
}
@@ -164,12 +164,12 @@ add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool, wxGBPosition pos,
* @param e Extended message.
*/
void
-error_dialog (wxWindow* parent, wxString m, optional<wxString> e)
+error_dialog(wxWindow* parent, wxString m, optional<wxString> e)
{
wxMessageDialog dialog(parent, m, variant::wx::dcpomatic(), wxOK | wxICON_ERROR);
if (e) {
wxString em = *e;
- em[0] = wxToupper (em[0]);
+ em[0] = wxToupper(em[0]);
dialog.SetExtendedMessage(em);
}
dialog.ShowModal();
@@ -181,7 +181,7 @@ error_dialog (wxWindow* parent, wxString m, optional<wxString> e)
* @param m Message.
*/
void
-message_dialog (wxWindow* parent, wxString m)
+message_dialog(wxWindow* parent, wxString m)
{
wxMessageDialog dialog(parent, m, variant::wx::dcpomatic(), wxOK | wxICON_INFORMATION);
dialog.ShowModal();
@@ -190,7 +190,7 @@ message_dialog (wxWindow* parent, wxString m)
/** @return true if the user answered "yes" */
bool
-confirm_dialog (wxWindow* parent, wxString m)
+confirm_dialog(wxWindow* parent, wxString m)
{
wxMessageDialog dialog(parent, m, variant::wx::dcpomatic(), wxYES_NO | wxICON_QUESTION);
return dialog.ShowModal() == wxID_YES;
@@ -201,9 +201,9 @@ confirm_dialog (wxWindow* parent, wxString m)
* @return Corresponding STL string.
*/
string
-wx_to_std (wxString s)
+wx_to_std(wxString s)
{
- return string (s.ToUTF8());
+ return string(s.ToUTF8());
}
@@ -211,9 +211,9 @@ wx_to_std (wxString s)
* @return Corresponding wxWidgets string.
*/
wxString
-std_to_wx (string s)
+std_to_wx(string s)
{
- return wxString (s.c_str(), wxConvUTF8);
+ return wxString(s.c_str(), wxConvUTF8);
}
@@ -225,14 +225,14 @@ char_to_wx(char const* s)
string
-string_client_data (wxClientData* o)
+string_client_data(wxClientData* o)
{
- return wx_to_std (dynamic_cast<wxStringClientData*>(o)->GetData());
+ return wx_to_std(dynamic_cast<wxStringClientData*>(o)->GetData());
}
void
-checked_set (FilePickerCtrl* widget, boost::filesystem::path value)
+checked_set(FilePickerCtrl* widget, boost::filesystem::path value)
{
if (widget->path() != value) {
if (value.empty()) {
@@ -247,60 +247,60 @@ checked_set (FilePickerCtrl* widget, boost::filesystem::path value)
void
-checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value)
+checked_set(wxDirPickerCtrl* widget, boost::filesystem::path value)
{
- if (widget->GetPath() != std_to_wx (value.string())) {
+ if (widget->GetPath() != std_to_wx(value.string())) {
if (value.empty()) {
/* Hack to make wxWidgets clear the control when we are passed
an empty value.
*/
value = " ";
}
- widget->SetPath (std_to_wx (value.string()));
+ widget->SetPath(std_to_wx(value.string()));
}
}
void
-checked_set (wxSpinCtrl* widget, int value)
+checked_set(wxSpinCtrl* widget, int value)
{
if (widget->GetValue() != value) {
- widget->SetValue (value);
+ widget->SetValue(value);
}
}
void
-checked_set (wxSpinCtrlDouble* widget, double value)
+checked_set(wxSpinCtrlDouble* widget, double value)
{
/* XXX: completely arbitrary epsilon */
- if (fabs (widget->GetValue() - value) > 1e-16) {
- widget->SetValue (value);
+ if (fabs(widget->GetValue() - value) > 1e-16) {
+ widget->SetValue(value);
}
}
void
-checked_set (wxChoice* widget, int value)
+checked_set(wxChoice* widget, int value)
{
if (widget->GetSelection() != value) {
- widget->SetSelection (value);
+ widget->SetSelection(value);
}
}
void
-checked_set (wxChoice* widget, string value)
+checked_set(wxChoice* widget, string value)
{
wxClientData* o = nullptr;
if (widget->GetSelection() != -1) {
- o = widget->GetClientObject (widget->GetSelection ());
+ o = widget->GetClientObject(widget->GetSelection());
}
if (!o || string_client_data(o) != value) {
for (unsigned int i = 0; i < widget->GetCount(); ++i) {
- if (string_client_data (widget->GetClientObject (i)) == value) {
- widget->SetSelection (i);
+ if (string_client_data(widget->GetClientObject(i)) == value) {
+ widget->SetSelection(i);
}
}
}
@@ -308,11 +308,11 @@ checked_set (wxChoice* widget, string value)
void
-checked_set (wxChoice* widget, vector<pair<string, string>> items)
+checked_set(wxChoice* widget, vector<pair<string, string>> items)
{
vector<pair<string, string>> current;
for (unsigned int i = 0; i < widget->GetCount(); ++i) {
- current.push_back (
+ current.push_back(
make_pair(
wx_to_std(widget->GetString(i)),
widget->GetClientData() ? string_client_data(widget->GetClientObject(i)) : ""
@@ -324,24 +324,24 @@ checked_set (wxChoice* widget, vector<pair<string, string>> items)
return;
}
- widget->Clear ();
+ widget->Clear();
for (auto i: items) {
- widget->Append (std_to_wx(i.first), new wxStringClientData(std_to_wx(i.second)));
+ widget->Append(std_to_wx(i.first), new wxStringClientData(std_to_wx(i.second)));
}
}
void
-checked_set (wxTextCtrl* widget, string value)
+checked_set(wxTextCtrl* widget, string value)
{
- if (widget->GetValue() != std_to_wx (value)) {
- widget->ChangeValue (std_to_wx (value));
+ if (widget->GetValue() != std_to_wx(value)) {
+ widget->ChangeValue(std_to_wx(value));
}
}
void
-checked_set (PasswordEntry* entry, string value)
+checked_set(PasswordEntry* entry, string value)
{
if (entry->get() != value) {
entry->set(value);
@@ -350,46 +350,46 @@ checked_set (PasswordEntry* entry, string value)
void
-checked_set (wxTextCtrl* widget, wxString value)
+checked_set(wxTextCtrl* widget, wxString value)
{
if (widget->GetValue() != value) {
- widget->ChangeValue (value);
+ widget->ChangeValue(value);
}
}
void
-checked_set (wxStaticText* widget, string value)
+checked_set(wxStaticText* widget, string value)
{
- if (widget->GetLabel() != std_to_wx (value)) {
- widget->SetLabel (std_to_wx (value));
+ if (widget->GetLabel() != std_to_wx(value)) {
+ widget->SetLabel(std_to_wx(value));
}
}
void
-checked_set (wxStaticText* widget, wxString value)
+checked_set(wxStaticText* widget, wxString value)
{
if (widget->GetLabel() != value) {
- widget->SetLabel (value);
+ widget->SetLabel(value);
}
}
void
-checked_set (wxCheckBox* widget, bool value)
+checked_set(wxCheckBox* widget, bool value)
{
if (widget->GetValue() != value) {
- widget->SetValue (value);
+ widget->SetValue(value);
}
}
void
-checked_set (wxRadioButton* widget, bool value)
+checked_set(wxRadioButton* widget, bool value)
{
if (widget->GetValue() != value) {
- widget->SetValue (value);
+ widget->SetValue(value);
}
}
@@ -422,23 +422,23 @@ checked_set(RegionSubtagWidget* widget, optional<dcp::LanguageTag::RegionSubtag>
int
-wx_get (wxSpinCtrl* w)
+wx_get(wxSpinCtrl* w)
{
- return w->GetValue ();
+ return w->GetValue();
}
int
-wx_get (wxChoice* w)
+wx_get(wxChoice* w)
{
- return w->GetSelection ();
+ return w->GetSelection();
}
double
-wx_get (wxSpinCtrlDouble* w)
+wx_get(wxSpinCtrlDouble* w)
{
- return w->GetValue ();
+ return w->GetValue();
}
@@ -454,7 +454,7 @@ context_translation(char const* s)
/* No translation; strip the context */
int c = t.Find(char_to_wx("|"));
if (c != wxNOT_FOUND) {
- t = t.Mid (c + 1);
+ t = t.Mid(c + 1);
}
}
@@ -463,46 +463,46 @@ context_translation(char const* s)
wxString
-time_to_timecode (DCPTime t, double fps)
+time_to_timecode(DCPTime t, double fps)
{
- auto w = t.seconds ();
+ auto w = t.seconds();
int const h = (w / 3600);
w -= h * 3600;
int const m = (w / 60);
w -= m * 60;
- int const s = floor (w);
+ int const s = floor(w);
w -= s;
- int const f = lrint (w * fps);
- return wxString::Format(char_to_wx("%02d:%02d:%02d.%02d"), h, m, s, f);
+ int const f = lrint(w * fps);
+ return wxString::Format(char_to_wx("%02d:%02d:%02d:%02d"), h, m, s, f);
}
void
-setup_audio_channels_choice (wxChoice* choice, int minimum)
+setup_audio_channels_choice(wxChoice* choice, int minimum)
{
vector<pair<string, string>> items;
for (int i = minimum; i <= 16; i += 2) {
if (i == 2) {
- items.push_back (make_pair(wx_to_std(_("2 - stereo")), locale_convert<string>(i)));
+ items.push_back(make_pair(wx_to_std(_("2 - stereo")), locale_convert<string>(i)));
} else if (i == 4) {
- items.push_back (make_pair(wx_to_std(_("4 - L/C/R/Lfe")), locale_convert<string>(i)));
+ items.push_back(make_pair(wx_to_std(_("4 - L/C/R/Lfe")), locale_convert<string>(i)));
} else if (i == 6) {
- items.push_back (make_pair(wx_to_std(_("6 - 5.1")), locale_convert<string>(i)));
+ items.push_back(make_pair(wx_to_std(_("6 - 5.1")), locale_convert<string>(i)));
} else if (i == 8) {
- items.push_back (make_pair(wx_to_std(_("8 - 5.1/HI/VI")), locale_convert<string>(i)));
+ items.push_back(make_pair(wx_to_std(_("8 - 5.1/HI/VI")), locale_convert<string>(i)));
} else if (i == 12) {
- items.push_back (make_pair(wx_to_std(_("12 - 7.1/HI/VI")), locale_convert<string>(i)));
+ items.push_back(make_pair(wx_to_std(_("12 - 7.1/HI/VI")), locale_convert<string>(i)));
} else {
- items.push_back (make_pair(locale_convert<string> (i), locale_convert<string>(i)));
+ items.push_back(make_pair(locale_convert<string>(i), locale_convert<string>(i)));
}
}
- checked_set (choice, items);
+ checked_set(choice, items);
}
wxSplashScreen*
-maybe_show_splash ()
+maybe_show_splash()
{
wxSplashScreen* splash = nullptr;
@@ -523,7 +523,7 @@ maybe_show_splash ()
#else
splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1);
#endif
- wxYield ();
+ wxYield();
}
} catch (boost::filesystem::filesystem_error& e) {
/* Maybe we couldn't find the splash image; never mind */
@@ -534,19 +534,19 @@ maybe_show_splash ()
double
-calculate_mark_interval (double mark_interval)
+calculate_mark_interval(double mark_interval)
{
if (mark_interval > 5) {
- mark_interval -= lrint (mark_interval) % 5;
+ mark_interval -= lrint(mark_interval) % 5;
}
if (mark_interval > 10) {
- mark_interval -= lrint (mark_interval) % 10;
+ mark_interval -= lrint(mark_interval) % 10;
}
if (mark_interval > 60) {
- mark_interval -= lrint (mark_interval) % 60;
+ mark_interval -= lrint(mark_interval) % 60;
}
if (mark_interval > 3600) {
- mark_interval -= lrint (mark_interval) % 3600;
+ mark_interval -= lrint(mark_interval) % 3600;
}
if (mark_interval < 1) {
@@ -559,16 +559,16 @@ calculate_mark_interval (double mark_interval)
/** @return false if the task was cancelled */
bool
-display_progress (wxString title, wxString task)
+display_progress(wxString title, wxString task)
{
- auto jm = JobManager::instance ();
+ auto jm = JobManager::instance();
- wxProgressDialog progress (title, task, 100, 0, wxPD_CAN_ABORT);
+ wxProgressDialog progress(title, task, 100, 0, wxPD_CAN_ABORT);
bool ok = true;
while (jm->work_to_do()) {
- dcpomatic_sleep_seconds (1);
+ dcpomatic_sleep_seconds(1);
if (!progress.Pulse()) {
/* user pressed cancel */
for (auto i: jm->get()) {
@@ -584,7 +584,7 @@ display_progress (wxString title, wxString task)
int
-get_offsets (vector<Offset>& offsets)
+get_offsets(vector<Offset>& offsets)
{
offsets.push_back({_("UTC-11"), dcp::UTCOffset(-11, 0)});
offsets.push_back({_("UTC-10"), dcp::UTCOffset(-10, 0)});
@@ -623,13 +623,13 @@ get_offsets (vector<Offset>& offsets)
wxString
-bitmap_path (string name)
+bitmap_path(string name)
{
boost::filesystem::path base;
#ifdef DCPOMATIC_DEBUG
/* Hack to allow Linux and OS X to find icons when running from the source tree */
- char* path = getenv ("DCPOMATIC_GRAPHICS");
+ char* path = getenv("DCPOMATIC_GRAPHICS");
if (path) {
base = path;
} else {
@@ -644,7 +644,7 @@ bitmap_path (string name)
#endif
auto p = base / name;
- return std_to_wx (p.string());
+ return std_to_wx(p.string());
}
@@ -656,18 +656,18 @@ icon_path(string name)
wxSize
-small_button_size (wxWindow* parent, wxString text)
+small_button_size(wxWindow* parent, wxString text)
{
- wxClientDC dc (parent);
- auto size = dc.GetTextExtent (text);
- size.SetHeight (-1);
- size.IncBy (32, 0);
+ wxClientDC dc(parent);
+ auto size = dc.GetTextExtent(text);
+ size.SetHeight(-1);
+ size.IncBy(32, 0);
return size;
}
bool
-gui_is_dark ()
+gui_is_dark()
{
#ifdef DCPOMATIC_WINDOWS
/* Dark mode doesn't really work at all on Windows at the moment, so just don't use it */
@@ -684,13 +684,13 @@ gui_is_dark ()
#if wxCHECK_VERSION(3,1,0)
double
-dpi_scale_factor (wxWindow* window)
+dpi_scale_factor(wxWindow* window)
{
return window->GetDPIScaleFactor();
}
#else
double
-dpi_scale_factor (wxWindow*)
+dpi_scale_factor(wxWindow*)
{
return 1;
}
@@ -699,7 +699,7 @@ dpi_scale_factor (wxWindow*)
int
-search_ctrl_height ()
+search_ctrl_height()
{
#ifdef __WXGTK3__
return 30;
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index 6f84705fb..957957589 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -94,34 +94,34 @@ class PasswordEntry;
#define S_(x) context_translation(x)
-extern void error_dialog (wxWindow *, wxString, boost::optional<wxString> e = boost::optional<wxString>());
-extern void message_dialog (wxWindow *, wxString);
-extern bool confirm_dialog (wxWindow *, wxString);
-extern wxStaticText* create_label (wxWindow* p, wxString t, bool left);
-extern wxStaticText* add_label_to_sizer (wxSizer *, wxWindow *, wxString, bool left, int prop = 0, int flags = wxLEFT | wxRIGHT);
-extern wxStaticText* add_label_to_sizer (wxSizer *, wxStaticText *, bool left, int prop = 0, int flags = wxLEFT | wxRIGHT);
+extern void error_dialog(wxWindow *, wxString, boost::optional<wxString> e = boost::optional<wxString>());
+extern void message_dialog(wxWindow *, wxString);
+extern bool confirm_dialog(wxWindow *, wxString);
+extern wxStaticText* create_label(wxWindow* p, wxString t, bool left);
+extern wxStaticText* add_label_to_sizer(wxSizer *, wxWindow *, wxString, bool left, int prop = 0, int flags = wxLEFT | wxRIGHT);
+extern wxStaticText* add_label_to_sizer(wxSizer *, wxStaticText *, bool left, int prop = 0, int flags = wxLEFT | wxRIGHT);
extern wxStaticText* add_label_to_sizer(wxGridBagSizer *, wxWindow *, wxString, bool, wxGBPosition, wxGBSpan span = wxDefaultSpan, bool indent = false);
-extern wxStaticText* add_label_to_sizer (wxGridBagSizer *, wxStaticText *, bool, wxGBPosition, wxGBSpan span = wxDefaultSpan);
-extern std::string wx_to_std (wxString);
-extern wxString std_to_wx (std::string);
+extern wxStaticText* add_label_to_sizer(wxGridBagSizer *, wxStaticText *, bool, wxGBPosition, wxGBSpan span = wxDefaultSpan);
+extern std::string wx_to_std(wxString);
+extern wxString std_to_wx(std::string);
/** Convert UTF8-encoded char array to wxString */
extern wxString char_to_wx(char const* s);
extern wxString context_translation(char const* s);
-extern std::string string_client_data (wxClientData* o);
-extern wxString time_to_timecode (dcpomatic::DCPTime t, double fps);
-extern void setup_audio_channels_choice (wxChoice* choice, int minimum);
+extern std::string string_client_data(wxClientData* o);
+extern wxString time_to_timecode(dcpomatic::DCPTime t, double fps);
+extern void setup_audio_channels_choice(wxChoice* choice, int minimum);
extern wxSplashScreen* maybe_show_splash();
-extern double calculate_mark_interval (double start);
-extern bool display_progress (wxString title, wxString task);
-extern bool report_errors_from_last_job (wxWindow* parent);
-extern wxString bitmap_path (std::string name);
+extern double calculate_mark_interval(double start);
+extern bool display_progress(wxString title, wxString task);
+extern bool report_errors_from_last_job(wxWindow* parent);
+extern wxString bitmap_path(std::string name);
extern wxString icon_path(std::string name);
-extern wxSize small_button_size (wxWindow* parent, wxString text);
-extern bool gui_is_dark ();
-extern double dpi_scale_factor (wxWindow* window);
-extern int search_ctrl_height ();
+extern wxSize small_button_size(wxWindow* parent, wxString text);
+extern bool gui_is_dark();
+extern double dpi_scale_factor(wxWindow* window);
+extern int search_ctrl_height();
extern void report_config_load_failure(wxWindow* parent, Config::LoadFailure what);
extern bool layout_for_short_screen(wxWindow* reference);
@@ -137,7 +137,7 @@ struct Offset
dcp::UTCOffset offset;
};
-extern int get_offsets (std::vector<Offset>& offsets);
+extern int get_offsets(std::vector<Offset>& offsets);
namespace dcpomatic {
namespace wx {
@@ -149,27 +149,27 @@ namespace wx {
}
-extern void checked_set (FilePickerCtrl* widget, boost::filesystem::path value);
-extern void checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value);
-extern void checked_set (wxSpinCtrl* widget, int value);
-extern void checked_set (wxSpinCtrlDouble* widget, double value);
-extern void checked_set (wxChoice* widget, int value);
-extern void checked_set (wxChoice* widget, std::string value);
-extern void checked_set (wxChoice* widget, std::vector<std::pair<std::string, std::string> > items);
-extern void checked_set (wxTextCtrl* widget, std::string value);
-extern void checked_set (wxTextCtrl* widget, wxString value);
-extern void checked_set (PasswordEntry* widget, std::string value);
-extern void checked_set (wxCheckBox* widget, bool value);
-extern void checked_set (wxRadioButton* widget, bool value);
-extern void checked_set (wxStaticText* widget, std::string value);
-extern void checked_set (wxStaticText* widget, wxString value);
+extern void checked_set(FilePickerCtrl* widget, boost::filesystem::path value);
+extern void checked_set(wxDirPickerCtrl* widget, boost::filesystem::path value);
+extern void checked_set(wxSpinCtrl* widget, int value);
+extern void checked_set(wxSpinCtrlDouble* widget, double value);
+extern void checked_set(wxChoice* widget, int value);
+extern void checked_set(wxChoice* widget, std::string value);
+extern void checked_set(wxChoice* widget, std::vector<std::pair<std::string, std::string> > items);
+extern void checked_set(wxTextCtrl* widget, std::string value);
+extern void checked_set(wxTextCtrl* widget, wxString value);
+extern void checked_set(PasswordEntry* widget, std::string value);
+extern void checked_set(wxCheckBox* widget, bool value);
+extern void checked_set(wxRadioButton* widget, bool value);
+extern void checked_set(wxStaticText* widget, std::string value);
+extern void checked_set(wxStaticText* widget, wxString value);
extern void checked_set(LanguageTagWidget* widget, dcp::LanguageTag value);
extern void checked_set(LanguageTagWidget* widget, boost::optional<dcp::LanguageTag> value);
extern void checked_set(RegionSubtagWidget* widget, boost::optional<dcp::LanguageTag::RegionSubtag> value);
-extern int wx_get (wxChoice* widget);
-extern int wx_get (wxSpinCtrl* widget);
-extern double wx_get (wxSpinCtrlDouble* widget);
+extern int wx_get(wxChoice* widget);
+extern int wx_get(wxSpinCtrl* widget);
+extern double wx_get(wxSpinCtrlDouble* widget);
#ifdef DCPOMATIC_WINDOWS
#define DCPOMATIC_USE_OWN_PICKER