#include "config.h"
#include "frame_rate_change.h"
#include "compose.hpp"
-#include "locale_convert.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
in_node->add_child("B")->add_child_text (raw_convert<string> (tf->B ()));
}
- node->add_child("YUVToRGB")->add_child_text (raw_convert<string> (_yuv_to_rgb));
+ node->add_child("YUVToRGB")->add_child_text (raw_convert<string> (static_cast<int> (_yuv_to_rgb)));
node->add_child("RedX")->add_child_text (raw_convert<string> (_red.x));
node->add_child("RedY")->add_child_text (raw_convert<string> (_red.y));
node->add_child("GreenX")->add_child_text (raw_convert<string> (_green.x));
}
root->add_child("OnlyServersEncode")->add_child_text (_only_servers_encode ? "1" : "0");
- root->add_child("TMSProtocol")->add_child_text (raw_convert<string> (_tms_protocol));
+ root->add_child("TMSProtocol")->add_child_text (raw_convert<string> (static_cast<int> (_tms_protocol)));
root->add_child("TMSIP")->add_child_text (_tms_ip);
root->add_child("TMSPath")->add_child_text (_tms_path);
root->add_child("TMSUser")->add_child_text (_tms_user);
#include "content_factory.h"
#include "exceptions.h"
#include "film.h"
-#include "locale_convert.h"
#include "job.h"
#include "compose.hpp"
+#include <dcp/locale_convert.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
using std::pair;
using boost::shared_ptr;
using dcp::raw_convert;
+using dcp::locale_convert;
int const ContentProperty::PATH = 400;
int const ContentProperty::POSITION = 401;
#include "exceptions.h"
#include "frame_rate_change.h"
#include "subtitle_content.h"
-#include "locale_convert.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
node->add_child("FirstVideo")->add_child_text (raw_convert<string> (_first_video.get().get()));
}
- node->add_child("ColorRange")->add_child_text (raw_convert<string> (_color_range));
- node->add_child("ColorPrimaries")->add_child_text (raw_convert<string> (_color_primaries));
- node->add_child("ColorTransferCharacteristic")->add_child_text (raw_convert<string> (_color_trc));
- node->add_child("Colorspace")->add_child_text (raw_convert<string> (_colorspace));
+ node->add_child("ColorRange")->add_child_text (raw_convert<string> (static_cast<int> (_color_range)));
+ node->add_child("ColorPrimaries")->add_child_text (raw_convert<string> (static_cast<int> (_color_primaries)));
+ node->add_child("ColorTransferCharacteristic")->add_child_text (raw_convert<string> (static_cast<int> (_color_trc)));
+ node->add_child("Colorspace")->add_child_text (raw_convert<string> (static_cast<int> (_colorspace)));
if (_bits_per_pixel) {
node->add_child("BitsPerPixel")->add_child_text (raw_convert<string> (_bits_per_pixel.get ()));
}
if (_audio_processor) {
root->add_child("AudioProcessor")->add_child_text (_audio_processor->id ());
}
- root->add_child("ReelType")->add_child_text (raw_convert<string> (_reel_type));
+ root->add_child("ReelType")->add_child_text (raw_convert<string> (static_cast<int> (_reel_type)));
root->add_child("ReelLength")->add_child_text (raw_convert<string> (_reel_length));
root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0");
_playlist->as_xml (root->add_child ("Playlist"));
node->add_child("Width")->add_child_text (raw_convert<string> (_size.width));
node->add_child("Height")->add_child_text (raw_convert<string> (_size.height));
if (_eye) {
- node->add_child("Eye")->add_child_text (raw_convert<string> (_eye.get ()));
+ node->add_child("Eye")->add_child_text (raw_convert<string> (static_cast<int> (_eye.get ())));
}
node->add_child("Size")->add_child_text (raw_convert<string> (_data.size ()));
}
+++ /dev/null
-/*
- Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "locale_convert.h"
-#include <string>
-#include <inttypes.h>
-
-using std::string;
-
-template<>
-string
-locale_convert (int x, int)
-{
- char buffer[64];
- snprintf (buffer, sizeof(buffer), "%d", x);
- return buffer;
-}
-
-template<>
-string
-locale_convert (int64_t x, int)
-{
- char buffer[64];
- snprintf (buffer, sizeof(buffer), "%" PRId64, x);
- return buffer;
-}
-
-template<>
-string
-locale_convert (float x, int precision)
-{
- char format[64];
- snprintf (format, sizeof(format), "%%.%df", precision);
- char buffer[64];
- snprintf (buffer, sizeof(buffer), format, x);
- return buffer;
-}
-
-template<>
-string
-locale_convert (double x, int precision)
-{
- char format[64];
- snprintf (format, sizeof(format), "%%.%df", precision);
- char buffer[64];
- snprintf (buffer, sizeof(buffer), format, x);
- return buffer;
-}
-
-template<>
-string
-locale_convert (string x, int)
-{
- return x;
-}
-
-template<>
-string
-locale_convert (char* x, int)
-{
- return x;
-}
-
-template<>
-string
-locale_convert (char const * x, int)
-{
- return x;
-}
-
-template<>
-int
-locale_convert (string x, int)
-{
- int y = 0;
- sscanf (x.c_str(), "%d", &y);
- return y;
-}
-
-template<>
-int64_t
-locale_convert (string x, int)
-{
- int64_t y = 0;
- sscanf (x.c_str(), "%" PRId64, &y);
- return y;
-}
-
-template<>
-float
-locale_convert (string x, int)
-{
- float y = 0;
- sscanf (x.c_str(), "%f", &y);
- return y;
-}
-
-template<>
-double
-locale_convert (string x, int)
-{
- double y = 0;
- sscanf (x.c_str(), "%lf", &y);
- return y;
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_LOCALE_CONVERT_H
-#define DCPOMATIC_LOCALE_CONVERT_H
-
-#include <boost/static_assert.hpp>
-#include <string>
-
-template <typename P, typename Q>
-P
-locale_convert (Q x, int precision = 16)
-{
- /* We can't write a generic version of locale_convert; all required
- versions must be specialised.
- */
- BOOST_STATIC_ASSERT (sizeof (Q) == 0);
-}
-
-template <>
-std::string
-locale_convert (int x, int);
-
-template <>
-std::string
-locale_convert (int64_t x, int);
-
-template <>
-std::string
-locale_convert (float x, int precision);
-
-template <>
-std::string
-locale_convert (double x, int precision);
-
-template <>
-std::string
-locale_convert (std::string x, int);
-
-template <>
-std::string
-locale_convert (char* x, int);
-
-template <>
-std::string
-locale_convert (char const * x, int);
-
-template <>
-int
-locale_convert (std::string x, int);
-
-template <>
-int64_t
-locale_convert (std::string x, int);
-
-template <>
-float
-locale_convert (std::string x, int);
-
-template <>
-double
-locale_convert (std::string x, int);
-
-#endif
node->add_child("InterHeight")->add_child_text (raw_convert<string> (_inter_size.height));
node->add_child("OutWidth")->add_child_text (raw_convert<string> (_out_size.width));
node->add_child("OutHeight")->add_child_text (raw_convert<string> (_out_size.height));
- node->add_child("Eyes")->add_child_text (raw_convert<string> (_eyes));
- node->add_child("Part")->add_child_text (raw_convert<string> (_part));
+ node->add_child("Eyes")->add_child_text (raw_convert<string> (static_cast<int> (_eyes)));
+ node->add_child("Part")->add_child_text (raw_convert<string> (static_cast<int> (_part)));
if (_colour_conversion) {
_colour_conversion.get().as_xml (node);
}
node->add_child("Type")->add_child_text (N_("Raw"));
node->add_child("Width")->add_child_text (raw_convert<string> (_image->size().width));
node->add_child("Height")->add_child_text (raw_convert<string> (_image->size().height));
- node->add_child("PixelFormat")->add_child_text (raw_convert<string> (_image->pixel_format ()));
+ node->add_child("PixelFormat")->add_child_text (raw_convert<string> (static_cast<int> (_image->pixel_format ())));
}
void
{
boost::mutex::scoped_lock lm (_mutex);
- root->add_child("UseSubtitles")->add_child_text (raw_convert<string> (_use));
- root->add_child("BurnSubtitles")->add_child_text (raw_convert<string> (_burn));
+ root->add_child("UseSubtitles")->add_child_text (_use ? "1" : "0");
+ root->add_child("BurnSubtitles")->add_child_text (_burn ? "1" : "0");
root->add_child("SubtitleXOffset")->add_child_text (raw_convert<string> (_x_offset));
root->add_child("SubtitleYOffset")->add_child_text (raw_convert<string> (_y_offset));
root->add_child("SubtitleXScale")->add_child_text (raw_convert<string> (_x_scale));
root->add_child("Red")->add_child_text (raw_convert<string> (_colour.r));
root->add_child("Green")->add_child_text (raw_convert<string> (_colour.g));
root->add_child("Blue")->add_child_text (raw_convert<string> (_colour.b));
- root->add_child("Outline")->add_child_text (raw_convert<string> (_outline));
- root->add_child("Shadow")->add_child_text (raw_convert<string> (_shadow));
+ root->add_child("Outline")->add_child_text (_outline ? "1" : "0");
+ root->add_child("Shadow")->add_child_text (_shadow ? "1" : "0");
root->add_child("EffectRed")->add_child_text (raw_convert<string> (_effect_colour.r));
root->add_child("EffectGreen")->add_child_text (raw_convert<string> (_effect_colour.g));
root->add_child("EffectBlue")->add_child_text (raw_convert<string> (_effect_colour.b));
#ifndef DCPOMATIC_USER_PROPERTY_H
#define DCPOMATIC_USER_PROPERTY_H
-#include "locale_convert.h"
+#include <dcp/locale_convert.h>
class UserProperty
{
UserProperty (Category category_, std::string key_, T value_, std::string unit_ = "")
: category (category_)
, key (key_)
- , value (locale_convert<std::string> (value_))
+ , value (dcp::locale_convert<std::string> (value_))
, unit (unit_)
{}
#include "digester.h"
#include "audio_processor.h"
#include "compose.hpp"
-#include "locale_convert.h"
+#include <dcp/locale_convert.h>
#include <dcp/util.h>
#include <dcp/raw_convert.h>
#include <dcp/picture_asset.h>
using boost::bad_lexical_cast;
using dcp::Size;
using dcp::raw_convert;
+using dcp::locale_convert;
/** Path to our executable, required by the stacktrace stuff and filled
* in during App::onInit().
#include "exceptions.h"
#include "frame_rate_change.h"
#include "log.h"
-#include "locale_convert.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <dcp/colour_matrix.h>
job.cc
job_manager.cc
json_server.cc
- locale_convert.cc
log.cc
log_entry.cc
magick_image_proxy.cc
#include "audio_gain_dialog.h"
#include "lib/audio_mapping.h"
#include "lib/util.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <dcp/types.h>
#include <wx/wx.h>
#include <wx/renderer.h>
using std::pair;
using std::make_pair;
using boost::shared_ptr;
+using dcp::locale_convert;
#define INDICATOR_SIZE 16
#define LEFT_WIDTH 48
#include "wx_util.h"
#include "colour_conversion_editor.h"
#include "lib/colour_conversion.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <dcp/gamma_transfer_function.h>
#include <dcp/modified_gamma_transfer_function.h>
#include <wx/spinctrl.h>
using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::locale_convert;
ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
: wxPanel (parent, wxID_ANY)
#include "lib/util.h"
#include "lib/cross.h"
#include "lib/exceptions.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
#include <wx/stdpaths.h>
using boost::shared_ptr;
using boost::function;
using boost::optional;
+using dcp::locale_convert;
class Page
{
#include "lib/subtitle_content.h"
#include "lib/dcp_content.h"
#include "lib/audio_content.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <dcp/key.h>
#include <wx/wx.h>
#include <wx/notebook.h>
using std::make_pair;
using boost::lexical_cast;
using boost::shared_ptr;
+using dcp::locale_convert;
DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
: _audio_dialog (0)
#include "wx_util.h"
#include "image_sequence_dialog.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
+
+using dcp::locale_convert;
ImageSequenceDialog::ImageSequenceDialog (wxWindow* parent)
: TableDialog (parent, _("Add image sequence"), 2, 1, true)
*/
#include "playhead_to_frame_dialog.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
+
+using dcp::locale_convert;
PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps)
: TableDialog (parent, _("Go to frame"), 2, 1, true)
#include "time_picker.h"
#include "wx_util.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <wx/spinctrl.h>
#include <boost/bind.hpp>
#include <iomanip>
using std::string;
using std::cout;
using boost::bind;
+using dcp::locale_convert;
TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
: wxPanel (parent)
#include "lib/dcp_subtitle_content.h"
#include "lib/audio_content.h"
#include "lib/text_subtitle_content.h"
-#include "lib/locale_convert.h"
#include "lib/video_content.h"
+#include <dcp/locale_convert.h>
#include <boost/foreach.hpp>
#include <set>
#include <iostream>
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::locale_convert;
TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer)
/* horrid hack for apparent lack of context support with wxWidgets i18n code */
#include "wx_util.h"
#include "lib/image.h"
#include "lib/dcp_video.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <dcp/openjpeg_image.h>
#include <wx/rawbmp.h>
#include <wx/graphics.h>
using std::string;
using boost::weak_ptr;
using boost::shared_ptr;
+using dcp::locale_convert;
int const VideoWaveformPlot::_vertical_margin = 8;
#include "file_picker_ctrl.h"
#include "lib/config.h"
#include "lib/util.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
#include <wx/spinctrl.h>
#include <boost/thread.hpp>
using namespace std;
using namespace boost;
+using dcp::locale_convert;
/** Add a wxStaticText to a wxSizer, aligning it at vertical centre.
* @param s Sizer to add to.