summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-11 12:49:23 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-12 09:14:06 +0100
commit94056bf7f8fdef32da3cd78eff68d58560b4e6be (patch)
tree937fad363dc94d65ec20fa2ff7aa3b303310d80f /src/wx
parent73654117144c6de0ec4efe39ddc88485df546cc9 (diff)
Replace incorrect uses of raw_convert with a new locale_convert.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_mapping_view.cc11
-rw-r--r--src/wx/colour_conversion_editor.cc23
-rw-r--r--src/wx/config_dialog.cc9
-rw-r--r--src/wx/content_properties_dialog.cc2
-rw-r--r--src/wx/dcp_panel.cc6
-rw-r--r--src/wx/dolby_doremi_certificate_panel.cc9
-rw-r--r--src/wx/image_sequence_dialog.cc6
-rw-r--r--src/wx/playhead_to_frame_dialog.cc6
-rw-r--r--src/wx/time_picker.cc7
-rw-r--r--src/wx/timing_panel.cc7
-rw-r--r--src/wx/video_waveform_plot.cc5
-rw-r--r--src/wx/wx_util.cc14
12 files changed, 48 insertions, 57 deletions
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc
index 1ec9dd5b2..866156336 100644
--- a/src/wx/audio_mapping_view.cc
+++ b/src/wx/audio_mapping_view.cc
@@ -22,12 +22,12 @@
* @brief AudioMappingView class and helpers.
*/
-#include "lib/audio_mapping.h"
-#include "lib/util.h"
#include "audio_mapping_view.h"
#include "wx_util.h"
#include "audio_gain_dialog.h"
-#include <dcp/raw_convert.h>
+#include "lib/audio_mapping.h"
+#include "lib/util.h"
+#include "lib/locale_convert.h"
#include <dcp/types.h>
#include <wx/wx.h>
#include <wx/renderer.h>
@@ -45,7 +45,6 @@ using std::vector;
using std::pair;
using std::make_pair;
using boost::shared_ptr;
-using dcp::raw_convert;
#define INDICATOR_SIZE 16
#define LEFT_WIDTH 48
@@ -86,7 +85,7 @@ public:
dc.SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (255, 255, 255), wxBRUSHSTYLE_SOLID));
dc.DrawRectangle (wxRect (rect.GetLeft() + xo, rect.GetTop() + yo, INDICATOR_SIZE, INDICATOR_SIZE));
- float const value = raw_convert<float> (wx_to_std (grid.GetCellValue (row, col)));
+ float const value = locale_convert<float> (wx_to_std (grid.GetCellValue (row, col)));
float const value_dB = 20 * log10 (value);
int const range = 18;
int height = 0;
@@ -301,7 +300,7 @@ AudioMappingView::update_cells ()
_grid->SetCellValue (i, 0, std_to_wx (row_names[i]));
}
for (int j = 1; j < _grid->GetNumberCols(); ++j) {
- _grid->SetCellValue (i, j, std_to_wx (raw_convert<string> (_map.get (i, j - 1))));
+ _grid->SetCellValue (i, j, std_to_wx (locale_convert<string> (_map.get (i, j - 1))));
}
}
diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc
index 0a775b489..e56f30baf 100644
--- a/src/wx/colour_conversion_editor.cc
+++ b/src/wx/colour_conversion_editor.cc
@@ -18,10 +18,10 @@
*/
-#include "lib/colour_conversion.h"
#include "wx_util.h"
#include "colour_conversion_editor.h"
-#include <dcp/raw_convert.h>
+#include "lib/colour_conversion.h"
+#include "lib/locale_convert.h"
#include <dcp/gamma_transfer_function.h>
#include <dcp/modified_gamma_transfer_function.h>
#include <wx/spinctrl.h>
@@ -32,7 +32,6 @@ using std::string;
using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
-using dcp::raw_convert;
ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
: wxPanel (parent, wxID_ANY)
@@ -292,9 +291,9 @@ ColourConversionEditor::get () const
shared_ptr<dcp::ModifiedGammaTransferFunction> (
new dcp::ModifiedGammaTransferFunction (
_input_power->GetValue (),
- raw_convert<double> (wx_to_std (_input_threshold->GetValue ())),
- raw_convert<double> (wx_to_std (_input_A->GetValue ())),
- raw_convert<double> (wx_to_std (_input_B->GetValue ()))
+ locale_convert<double> (wx_to_std (_input_threshold->GetValue ())),
+ locale_convert<double> (wx_to_std (_input_A->GetValue ())),
+ locale_convert<double> (wx_to_std (_input_B->GetValue ()))
)
)
);
@@ -307,23 +306,23 @@ ColourConversionEditor::get () const
conversion.set_yuv_to_rgb (static_cast<dcp::YUVToRGB> (_yuv_to_rgb->GetSelection ()));
conversion.set_red (
- dcp::Chromaticity (raw_convert<double> (wx_to_std (_red_x->GetValue ())), raw_convert<double> (wx_to_std (_red_y->GetValue ())))
+ dcp::Chromaticity (locale_convert<double> (wx_to_std (_red_x->GetValue ())), locale_convert<double> (wx_to_std (_red_y->GetValue ())))
);
conversion.set_green (
- dcp::Chromaticity (raw_convert<double> (wx_to_std (_green_x->GetValue ())), raw_convert<double> (wx_to_std (_green_y->GetValue ())))
+ dcp::Chromaticity (locale_convert<double> (wx_to_std (_green_x->GetValue ())), locale_convert<double> (wx_to_std (_green_y->GetValue ())))
);
conversion.set_blue (
- dcp::Chromaticity (raw_convert<double> (wx_to_std (_blue_x->GetValue ())), raw_convert<double> (wx_to_std (_blue_y->GetValue ())))
+ dcp::Chromaticity (locale_convert<double> (wx_to_std (_blue_x->GetValue ())), locale_convert<double> (wx_to_std (_blue_y->GetValue ())))
);
conversion.set_white (
- dcp::Chromaticity (raw_convert<double> (wx_to_std (_white_x->GetValue ())), raw_convert<double> (wx_to_std (_white_y->GetValue ())))
+ dcp::Chromaticity (locale_convert<double> (wx_to_std (_white_x->GetValue ())), locale_convert<double> (wx_to_std (_white_y->GetValue ())))
);
if (_adjust_white->GetValue ()) {
conversion.set_adjusted_white (
dcp::Chromaticity (
- raw_convert<double> (wx_to_std (_adjusted_white_x->GetValue ())),
- raw_convert<double> (wx_to_std (_adjusted_white_y->GetValue ()))
+ locale_convert<double> (wx_to_std (_adjusted_white_x->GetValue ())),
+ locale_convert<double> (wx_to_std (_adjusted_white_y->GetValue ()))
)
);
} else {
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 0098ecb2b..6006ba782 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -41,7 +41,7 @@
#include "lib/util.h"
#include "lib/cross.h"
#include "lib/exceptions.h"
-#include <dcp/raw_convert.h>
+#include "lib/locale_convert.h"
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
#include <wx/stdpaths.h>
@@ -63,7 +63,6 @@ using boost::bind;
using boost::shared_ptr;
using boost::function;
using boost::optional;
-using dcp::raw_convert;
class Page
{
@@ -517,7 +516,7 @@ private:
_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ()));
checked_set (_j2k_bandwidth, config->default_j2k_bandwidth() / 1000000);
_j2k_bandwidth->SetRange (50, config->maximum_j2k_bandwidth() / 1000000);
- checked_set (_dcp_audio_channels, raw_convert<string> (config->default_dcp_audio_channels()));
+ checked_set (_dcp_audio_channels, locale_convert<string> (config->default_dcp_audio_channels()));
checked_set (_audio_delay, config->default_audio_delay ());
checked_set (_standard, config->default_interop() ? 1 : 0);
}
@@ -536,7 +535,9 @@ private:
{
int const s = _dcp_audio_channels->GetSelection ();
if (s != wxNOT_FOUND) {
- Config::instance()->set_default_dcp_audio_channels (dcp::raw_convert<int> (string_client_data (_dcp_audio_channels->GetClientObject (s))));
+ Config::instance()->set_default_dcp_audio_channels (
+ locale_convert<int> (string_client_data (_dcp_audio_channels->GetClientObject (s)))
+ );
}
}
diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc
index acc232df4..2f4e1a48b 100644
--- a/src/wx/content_properties_dialog.cc
+++ b/src/wx/content_properties_dialog.cc
@@ -23,7 +23,6 @@
#include "lib/content.h"
#include "lib/video_content.h"
#include "lib/audio_content.h"
-#include <dcp/raw_convert.h>
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
@@ -33,7 +32,6 @@ using std::pair;
using std::map;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
-using dcp::raw_convert;
ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<Content> content)
: TableDialog (parent, _("Content Properties"), 2, 1, false)
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index f41f97769..8cbd1dbb6 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -34,8 +34,8 @@
#include "lib/subtitle_content.h"
#include "lib/dcp_content.h"
#include "lib/audio_content.h"
+#include "lib/locale_convert.h"
#include <dcp/key.h>
-#include <dcp/raw_convert.h>
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/gbsizer.h>
@@ -275,7 +275,7 @@ DCPPanel::audio_channels_changed ()
return;
}
- _film->set_audio_channels (dcp::raw_convert<int> (string_client_data (_audio_channels->GetClientObject (_audio_channels->GetSelection ()))));
+ _film->set_audio_channels (locale_convert<int> (string_client_data (_audio_channels->GetClientObject (_audio_channels->GetSelection ()))));
}
void
@@ -386,7 +386,7 @@ DCPPanel::film_changed (int p)
if (_film->audio_channels () < minimum_allowed_audio_channels ()) {
_film->set_audio_channels (minimum_allowed_audio_channels ());
} else {
- checked_set (_audio_channels, dcp::raw_convert<string> (max (minimum_allowed_audio_channels(), _film->audio_channels ())));
+ checked_set (_audio_channels, locale_convert<string> (max (minimum_allowed_audio_channels(), _film->audio_channels ())));
setup_dcp_name ();
}
break;
diff --git a/src/wx/dolby_doremi_certificate_panel.cc b/src/wx/dolby_doremi_certificate_panel.cc
index 18a0ed66e..cb1de387f 100644
--- a/src/wx/dolby_doremi_certificate_panel.cc
+++ b/src/wx/dolby_doremi_certificate_panel.cc
@@ -36,6 +36,7 @@ using std::cout;
using std::list;
using boost::function;
using boost::optional;
+using dcp::raw_convert;
DolbyDoremiCertificatePanel::DolbyDoremiCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog)
: DownloadCertificatePanel (parent, dialog)
@@ -90,7 +91,7 @@ try_ims (list<string>& urls, list<string>& files, string prefix, string serial)
static void
try_cat862 (list<string>& urls, list<string>& files, string prefix, string serial)
{
- int const serial_int = dcp::raw_convert<int> (serial);
+ int const serial_int = raw_convert<int> (serial);
string cat862;
if (serial_int <= 510999) {
@@ -109,7 +110,7 @@ try_cat862 (list<string>& urls, list<string>& files, string prefix, string seria
static void
try_dsp100 (list<string>& urls, list<string>& files, string prefix, string serial)
{
- int const serial_int = dcp::raw_convert<int> (serial);
+ int const serial_int = raw_convert<int> (serial);
string dsp100;
if (serial_int <= 999) {
@@ -128,7 +129,7 @@ try_dsp100 (list<string>& urls, list<string>& files, string prefix, string seria
static void
try_cat745 (list<string>& urls, list<string>& files, string prefix, string serial)
{
- int const serial_int = dcp::raw_convert<int> (serial.substr (1));
+ int const serial_int = raw_convert<int> (serial.substr (1));
string cat745;
if (serial_int <= 999) {
@@ -147,7 +148,7 @@ try_cat745 (list<string>& urls, list<string>& files, string prefix, string seria
static void
try_cp850 (list<string>& urls, list<string>& files, string prefix, string serial)
{
- int const serial_int = dcp::raw_convert<int> (serial.substr (1));
+ int const serial_int = raw_convert<int> (serial.substr (1));
int const lower = serial_int - (serial_int % 1000);
urls.push_back (String::compose ("%1CP850_CAT1600_F%2-F%3/cert_RMB_SPB_MDE_FMA.Dolby-CP850-F%4.zip", prefix, lower, lower + 999, serial_int));
diff --git a/src/wx/image_sequence_dialog.cc b/src/wx/image_sequence_dialog.cc
index 6200018d1..a207338a1 100644
--- a/src/wx/image_sequence_dialog.cc
+++ b/src/wx/image_sequence_dialog.cc
@@ -20,9 +20,7 @@
#include "wx_util.h"
#include "image_sequence_dialog.h"
-#include <dcp/raw_convert.h>
-
-using dcp::raw_convert;
+#include "lib/locale_convert.h"
ImageSequenceDialog::ImageSequenceDialog (wxWindow* parent)
: TableDialog (parent, _("Add image sequence"), 2, 1, true)
@@ -36,7 +34,7 @@ double
ImageSequenceDialog::frame_rate () const
{
try {
- return raw_convert<double> (wx_to_std (_frame_rate->GetValue ()));
+ return locale_convert<double> (wx_to_std (_frame_rate->GetValue ()));
} catch (...) {
}
diff --git a/src/wx/playhead_to_frame_dialog.cc b/src/wx/playhead_to_frame_dialog.cc
index af20c1592..3f1d06d2a 100644
--- a/src/wx/playhead_to_frame_dialog.cc
+++ b/src/wx/playhead_to_frame_dialog.cc
@@ -19,9 +19,7 @@
*/
#include "playhead_to_frame_dialog.h"
-#include <dcp/raw_convert.h>
-
-using dcp::raw_convert;
+#include "lib/locale_convert.h"
PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps)
: TableDialog (parent, _("Go to frame"), 2, 1, true)
@@ -36,5 +34,5 @@ PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps)
DCPTime
PlayheadToFrameDialog::get () const
{
- return DCPTime::from_frames (raw_convert<Frame> (wx_to_std (_frame->GetValue ())) - 1, _fps);
+ return DCPTime::from_frames (locale_convert<Frame> (wx_to_std (_frame->GetValue ())) - 1, _fps);
}
diff --git a/src/wx/time_picker.cc b/src/wx/time_picker.cc
index 1378af967..bddf615d0 100644
--- a/src/wx/time_picker.cc
+++ b/src/wx/time_picker.cc
@@ -20,7 +20,7 @@
#include "time_picker.h"
#include "wx_util.h"
-#include <dcp/raw_convert.h>
+#include "lib/locale_convert.h"
#include <wx/spinctrl.h>
#include <boost/bind.hpp>
#include <iomanip>
@@ -32,7 +32,6 @@ using std::max;
using std::string;
using std::cout;
using boost::bind;
-using dcp::raw_convert;
TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
: wxPanel (parent)
@@ -97,8 +96,8 @@ TimePicker::update_spin ()
}
_block_update = true;
- _hours_spin->SetValue (raw_convert<int> (wx_to_std (_hours->GetValue())));
- _minutes_spin->SetValue (raw_convert<int> (wx_to_std (_minutes->GetValue())));
+ _hours_spin->SetValue (locale_convert<int> (wx_to_std (_hours->GetValue())));
+ _minutes_spin->SetValue (locale_convert<int> (wx_to_std (_minutes->GetValue())));
_block_update = false;
Changed ();
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index f4de55028..25cf2b524 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -30,8 +30,8 @@
#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/raw_convert.h>
#include <boost/foreach.hpp>
#include <set>
#include <iostream>
@@ -42,7 +42,6 @@ using std::set;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
-using dcp::raw_convert;
TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer)
/* horrid hack for apparent lack of context support with wxWidgets i18n code */
@@ -288,7 +287,7 @@ TimingPanel::film_content_changed (int property)
bool const single_frame_image_content = content && dynamic_pointer_cast<const ImageContent> (content) && content->number_of_paths() == 1;
if ((check_vc.size() == 1 || count_ac == 1 || count_sc == 1) && !single_frame_image_content) {
- checked_set (_video_frame_rate, raw_convert<string> (content->video_frame_rate().get(), 5));
+ checked_set (_video_frame_rate, locale_convert<string> (content->video_frame_rate().get(), 5));
_video_frame_rate->Enable (true);
} else {
checked_set (_video_frame_rate, wxT (""));
@@ -399,7 +398,7 @@ TimingPanel::video_frame_rate_changed ()
void
TimingPanel::set_video_frame_rate ()
{
- double const fr = raw_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
+ double const fr = locale_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
i->set_video_frame_rate (fr);
}
diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc
index efaf76e28..096d340e8 100644
--- a/src/wx/video_waveform_plot.cc
+++ b/src/wx/video_waveform_plot.cc
@@ -23,8 +23,8 @@
#include "wx_util.h"
#include "lib/image.h"
#include "lib/dcp_video.h"
+#include "lib/locale_convert.h"
#include <dcp/openjpeg_image.h>
-#include <dcp/raw_convert.h>
#include <wx/rawbmp.h>
#include <wx/graphics.h>
#include <boost/bind.hpp>
@@ -35,7 +35,6 @@ using std::min;
using std::string;
using boost::weak_ptr;
using boost::shared_ptr;
-using dcp::raw_convert;
int const VideoWaveformPlot::_vertical_margin = 8;
@@ -119,7 +118,7 @@ VideoWaveformPlot::paint ()
} else if (n < 1000) {
x += extra[2];
}
- gc->DrawText (std_to_wx (raw_convert<string> (n)), x, y - (label_height / 2));
+ gc->DrawText (std_to_wx (locale_convert<string> (n)), x, y - (label_height / 2));
}
wxImage waveform (_waveform->size().width, height, _waveform->data()[0], true);
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index e12443dd3..cb9f72a42 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -26,7 +26,7 @@
#include "file_picker_ctrl.h"
#include "lib/config.h"
#include "lib/util.h"
-#include <dcp/raw_convert.h>
+#include "lib/locale_convert.h"
#include <wx/spinctrl.h>
#include <boost/thread.hpp>
@@ -365,17 +365,17 @@ 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")), dcp::raw_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")), dcp::raw_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")), dcp::raw_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")), dcp::raw_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")), dcp::raw_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 (dcp::raw_convert<string> (i), dcp::raw_convert<string> (i)));
+ items.push_back (make_pair (locale_convert<string> (i), locale_convert<string> (i)));
}
}