diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-21 01:15:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-21 01:15:32 +0100 |
| commit | e60bb3e51bd1508b149e6b8f6608f09b5196ae26 (patch) | |
| tree | a7a5b937c9ae138d4eebca8d5130d308bf9ae420 /src/wx | |
| parent | f07d5125a7b609320682689abe40781f096ca25e (diff) | |
No-op: remove all trailing whitespace.
Diffstat (limited to 'src/wx')
78 files changed, 448 insertions, 448 deletions
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index 13a1ef671..142705a55 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -35,7 +35,7 @@ AboutDialog::AboutDialog (wxWindow* parent) { wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); - + wxFont title_font (*wxNORMAL_FONT); title_font.SetPointSize (title_font.GetPointSize() + 12); title_font.SetWeight (wxFONTWEIGHT_BOLD); @@ -45,7 +45,7 @@ AboutDialog::AboutDialog (wxWindow* parent) wxFont version_font (*wxNORMAL_FONT); version_font.SetWeight (wxFONTWEIGHT_BOLD); - + wxStaticText* t = new wxStaticText (this, wxID_ANY, _("DCP-o-matic")); t->SetFont (title_font); sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16)); @@ -66,7 +66,7 @@ AboutDialog::AboutDialog (wxWindow* parent) wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER ); t->SetFont (subtitle_font); - + sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 8)); wxHyperlinkCtrl* h = new wxHyperlinkCtrl ( @@ -82,7 +82,7 @@ AboutDialog::AboutDialog (wxWindow* parent) _("(C) 2012-2015 Carl Hetherington, Terrence Meiczinger\n Ole Laursen, Brecht Sanders"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER ); - + sizer->Add (t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16)); _notebook = new wxNotebook (this, wxID_ANY); @@ -236,7 +236,7 @@ AboutDialog::AboutDialog (wxWindow* parent) tested_by.Add (wxT ("Paul Willmott")); tested_by.Add (wxT ("Wolfgang Woehl")); add_section (_("Tested by"), tested_by); - + sizer->Add (_notebook, wxSizerFlags().Centre().Border(wxALL, 16).Expand()); overall_sizer->Add (sizer); @@ -245,7 +245,7 @@ AboutDialog::AboutDialog (wxWindow* parent) if (buttons) { overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, 4); } - + SetSizerAndFit (overall_sizer); } @@ -263,7 +263,7 @@ AboutDialog::add_section (wxString name, wxArrayString credits) wxSizer* overall_sizer = new wxBoxSizer (wxHORIZONTAL); vector<wxSizer*> sizers; - + for (int i = 0; i < N; ++i) { sizers.push_back (new wxBoxSizer (wxVERTICAL)); overall_sizer->Add (sizers.back (), 1, wxEXPAND | wxALL, 6); diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index e1ea70ee3..fd523aa02 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -41,7 +41,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film) wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); wxBoxSizer* lr_sizer = new wxBoxSizer (wxHORIZONTAL); - + wxBoxSizer* left = new wxBoxSizer (wxVERTICAL); _plot = new AudioPlot (this); @@ -70,7 +70,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film) m->SetFont (subheading_font); right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16); } - + wxString const types[] = { _("Peak"), _("RMS") @@ -87,7 +87,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film) m->SetFont (subheading_font); right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16); } - + _smoothing = new wxSlider (this, wxID_ANY, AudioPlot::max_smoothing / 2, 1, AudioPlot::max_smoothing); _smoothing->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind (&AudioDialog::smoothing_changed, this)); right->Add (_smoothing, 0, wxEXPAND); @@ -96,12 +96,12 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film) overall_sizer->Add (lr_sizer); -#ifdef DCPOMATIC_LINUX +#ifdef DCPOMATIC_LINUX wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE); if (buttons) { overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); } -#endif +#endif SetSizer (overall_sizer); overall_sizer->Layout (); @@ -141,12 +141,12 @@ AudioDialog::try_to_load_analysis () JobManager::instance()->add (job); return; } - + _plot->set_analysis (_analysis); setup_peak_time (); /* Set up some defaults if no check boxes are checked */ - + int i = 0; while (i < MAX_DCP_AUDIO_CHANNELS && (!_channel_checkbox[i] || !_channel_checkbox[i]->GetValue ())) { ++i; @@ -177,7 +177,7 @@ AudioDialog::analysis_finished () { shared_ptr<const Film> film = _film.lock (); DCPOMATIC_ASSERT (film); - + if (!boost::filesystem::exists (film->audio_analysis_path ())) { /* We analysed and still nothing showed up, so maybe it was cancelled or it failed. Give up. @@ -235,14 +235,14 @@ AudioDialog::setup_peak_time () if (!_analysis || !_analysis->peak ()) { return; } - + shared_ptr<Film> film = _film.lock (); if (!film) { return; } - + float peak_dB = 20 * log10 (_analysis->peak().get()); - + _peak_time->SetLabel ( wxString::Format ( _("Peak is %.2fdB at %s"), @@ -250,7 +250,7 @@ AudioDialog::setup_peak_time () time_to_timecode (_analysis->peak_time().get(), film->video_frame_rate ()).data () ) ); - + if (peak_dB > -3) { _peak_time->SetForegroundColour (wxColour (255, 0, 0)); } else { @@ -266,4 +266,4 @@ AudioDialog::Show (bool show) return r; } - + diff --git a/src/wx/audio_gain_dialog.cc b/src/wx/audio_gain_dialog.cc index b9b2c1fb7..75a993d8c 100644 --- a/src/wx/audio_gain_dialog.cc +++ b/src/wx/audio_gain_dialog.cc @@ -44,6 +44,6 @@ AudioGainDialog::value () const if (_gain->GetValue() <= -144) { return 0; } - + return pow (10, _gain->GetValue () / 20); } diff --git a/src/wx/audio_gain_dialog.h b/src/wx/audio_gain_dialog.h index 673919c24..e4f8ab16c 100644 --- a/src/wx/audio_gain_dialog.h +++ b/src/wx/audio_gain_dialog.h @@ -27,7 +27,7 @@ public: AudioGainDialog (wxWindow *, int, int, float); float value () const; - + private: wxSpinCtrlDouble* _gain; }; diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index fc2caf0f7..809b16bc8 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -88,7 +88,7 @@ public: } height = max (0, height); - + if (value > 0) { /* Make sure we get a little bit of the marker if there is any gain */ height = max (3, height); @@ -102,7 +102,7 @@ public: { return wxSize (INDICATOR_SIZE + 4, INDICATOR_SIZE + 4); } - + wxGridCellRenderer* Clone () const { return new ValueRenderer; @@ -155,7 +155,7 @@ AudioMappingView::map_values_changed () update_cells (); Changed (_map); _last_tooltip_column = -1; -} +} void AudioMappingView::left_click (wxGridEvent& ev) @@ -165,7 +165,7 @@ AudioMappingView::left_click (wxGridEvent& ev) } int const d = ev.GetCol() - 1; - + if (_map.get (ev.GetRow(), d) > 0) { _map.set (ev.GetRow(), d, 0); } else { @@ -212,13 +212,13 @@ void AudioMappingView::edit () { int const d = _menu_column - 1; - + AudioGainDialog* dialog = new AudioGainDialog (this, _menu_row, _menu_column - 1, _map.get (_menu_row, d)); if (dialog->ShowModal () == wxID_OK) { _map.set (_menu_row, d, dialog->value ()); map_values_changed (); } - + dialog->Destroy (); } @@ -263,7 +263,7 @@ AudioMappingView::update_cells () for (int i = 0; i < _grid->GetNumberRows (); ++i) { row_names.push_back (wx_to_std (_grid->GetCellValue (i, 0))); } - + if (_grid->GetNumberRows ()) { _grid->DeleteRows (0, _grid->GetNumberRows ()); } @@ -275,7 +275,7 @@ AudioMappingView::update_cells () _grid->SetCellRenderer (i, j + 1, new ValueRenderer); } } - + for (int i = 0; i < _map.input_channels(); ++i) { if (i < int (row_names.size ())) { _grid->SetCellValue (i, 0, std_to_wx (row_names[i])); @@ -316,7 +316,7 @@ AudioMappingView::mouse_moved (wxMouseEvent& ev) float const dB = 20 * log10 (gain); s = wxString::Format (_("Audio will be passed from content channel %d to DCP channel %d with gain %.1fdB."), row + 1, column, dB); } - + _grid->GetGridWindow()->SetToolTip (s + " " + _("Right click to change gain.")); _last_tooltip_row = row; _last_tooltip_column = column; diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 006b12398..c31d5b575 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -54,7 +54,7 @@ AudioPanel::AudioPanel (ContentPanel* p) boost::mem_fn (&AudioContent::audio_gain), boost::mem_fn (&AudioContent::set_audio_gain) ); - + _gain->add (grid, wxGBPosition (r, 1)); add_label_to_grid_bag_sizer (grid, this, _("dB"), false, wxGBPosition (r, 2)); _gain_calculate_button = new wxButton (this, wxID_ANY, _("Calculate...")); @@ -69,7 +69,7 @@ AudioPanel::AudioPanel (ContentPanel* p) boost::mem_fn (&AudioContent::audio_delay), boost::mem_fn (&AudioContent::set_audio_delay) ); - + _delay->add (grid, wxGBPosition (r, 1)); /// TRANSLATORS: this is an abbreviation for milliseconds, the unit of time add_label_to_grid_bag_sizer (grid, this, _("ms"), false, wxGBPosition (r, 2)); @@ -140,7 +140,7 @@ AudioPanel::gain_calculate_button_clicked () d->Destroy (); return; } - + _gain->wrapped()->SetValue ( Config::instance()->cinema_sound_processor()->db_for_fader_change ( d->wanted_fader (), @@ -152,7 +152,7 @@ AudioPanel::gain_calculate_button_clicked () I think. */ _gain->view_changed (); - + d->Destroy (); } diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h index edd3dfcd4..2856cec4d 100644 --- a/src/wx/audio_panel.h +++ b/src/wx/audio_panel.h @@ -35,7 +35,7 @@ public: void film_changed (Film::Property); void film_content_changed (int); void content_selection_changed (); - + private: void gain_calculate_button_clicked (); void mapping_changed (AudioMapping); diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 829290d4d..1c5c1f94b 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -40,9 +40,9 @@ AudioPlot::AudioPlot (wxWindow* parent) : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) , _smoothing (max_smoothing / 2) { -#ifndef __WXOSX__ +#ifndef __WXOSX__ SetDoubleBuffered (true); -#endif +#endif for (int i = 0; i < MAX_DCP_AUDIO_CHANNELS; ++i) { _channel_visible[i] = false; @@ -69,10 +69,10 @@ AudioPlot::AudioPlot (wxWindow* parent) #if MAX_DCP_AUDIO_CHANNELS != 12 #warning AudioPlot::AudioPlot is expecting the wrong MAX_DCP_AUDIO_CHANNELS -#endif - +#endif + Bind (wxEVT_PAINT, boost::bind (&AudioPlot::paint, this)); - + SetMinSize (wxSize (640, 512)); } @@ -143,7 +143,7 @@ AudioPlot::paint () gc->GetTextExtent (wxT ("-80dB"), &metrics.db_label_width, &db_label_height, &db_label_descent, &db_label_leading); metrics.db_label_width += 8; - + int const data_width = GetSize().GetWidth() - metrics.db_label_width; /* Assume all channels have the same number of points */ metrics.x_scale = data_width / float (_analysis->points (0)); @@ -162,7 +162,7 @@ AudioPlot::paint () gc->StrokePath (grid); gc->DrawText (_("Time"), data_width, metrics.height - metrics.y_origin + db_label_height / 2); - + if (_type_visible[AudioPoint::PEAK]) { for (int c = 0; c < MAX_DCP_AUDIO_CHANNELS; ++c) { wxGraphicsPath p = gc->CreatePath (); @@ -203,7 +203,7 @@ AudioPlot::y_for_linear (float p, Metrics const & metrics) const if (p < 1e-4) { p = 1e-4; } - + return metrics.height - (20 * log10(p) - _minimum) * metrics.y_scale - metrics.y_origin; } @@ -213,7 +213,7 @@ AudioPlot::plot_peak (wxGraphicsPath& path, int channel, Metrics const & metrics if (_analysis->points (channel) == 0) { return; } - + path.MoveToPoint (metrics.db_label_width, y_for_linear (_analysis->get_point(channel, 0)[AudioPoint::PEAK], metrics)); float peak = 0; @@ -237,7 +237,7 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel, Metrics const & metrics) if (_analysis->points (channel) == 0) { return; } - + path.MoveToPoint (metrics.db_label_width, y_for_linear (_analysis->get_point(channel, 0)[AudioPoint::RMS], metrics)); list<float> smoothing; @@ -249,7 +249,7 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel, Metrics const & metrics) int const before = _smoothing / 2; int const after = _smoothing - before; - + /* Pre-load the smoothing list */ for (int i = 0; i < before; ++i) { smoothing.push_back (first); diff --git a/src/wx/cinema_dialog.h b/src/wx/cinema_dialog.h index 26520a412..56beaa5bd 100644 --- a/src/wx/cinema_dialog.h +++ b/src/wx/cinema_dialog.h @@ -27,7 +27,7 @@ public: std::string name () const; std::string email () const; - + private: wxTextCtrl* _name; wxTextCtrl* _email; diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc index 549940c00..d82239b79 100644 --- a/src/wx/colour_conversion_editor.cc +++ b/src/wx/colour_conversion_editor.cc @@ -71,9 +71,9 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) _input_B = new wxTextCtrl (this, wxID_ANY, wxT ("")); s->Add (_input_B, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_GAP); table->Add (s, wxGBPosition (r, 1), wxGBSpan (1, 3)); - } + } ++r; - + wxClientDC dc (parent); wxSize size = dc.GetTextExtent (wxT ("-0.12345678901")); size.SetHeight (-1); @@ -92,7 +92,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) /* YUV to RGB conversion */ subhead (table, this, _("YUV to RGB conversion"), r); - + add_label_to_grid_bag_sizer (table, this, _("YUV to RGB matrix"), true, wxGBPosition (r, 0)); _yuv_to_rgb = new wxChoice (this, wxID_ANY); _yuv_to_rgb->Append (_("Rec. 601")); @@ -139,7 +139,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) size = dc.GetTextExtent (wxT ("0.12345678")); size.SetHeight (-1); - + wxFlexGridSizer* rgb_to_xyz_sizer = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { @@ -169,7 +169,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) size = dc.GetTextExtent (wxT ("0.12345678")); size.SetHeight (-1); - + wxFlexGridSizer* bradford_sizer = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { @@ -180,7 +180,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent) table->Add (bradford_sizer, wxGBPosition (r - 2, 3), wxGBSpan (2, 1)); subhead (table, this, _("Output gamma correction"), r); - + add_label_to_grid_bag_sizer (table, this, _("Output gamma"), true, wxGBPosition (r, 0)); wxBoxSizer* output_sizer = new wxBoxSizer (wxHORIZONTAL); /// TRANSLATORS: this means the mathematical reciprocal operation, i.e. we are dividing 1 by the control that @@ -300,7 +300,7 @@ ColourConversionEditor::set (ColourConversion conversion) update_rgb_to_xyz (); update_bradford (); - + set_spin_ctrl (_output_gamma, dynamic_pointer_cast<const dcp::GammaTransferFunction> (conversion.out ())->gamma ()); } @@ -366,7 +366,7 @@ ColourConversionEditor::changed () _input_threshold->Enable (lin); _input_A->Enable (lin); _input_B->Enable (lin); - + Changed (); } @@ -389,7 +389,7 @@ ColourConversionEditor::update_bradford () { _adjusted_white_x->Enable (_adjust_white->GetValue ()); _adjusted_white_y->Enable (_adjust_white->GetValue ()); - + boost::numeric::ublas::matrix<double> m = get().bradford (); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { @@ -427,7 +427,7 @@ ColourConversionEditor::changed (wxSpinCtrlDouble* sc) if (fabs (_last_spin_ctrl_value[sc] - sc->GetValue()) < 1e-3) { return; } - + Changed (); } diff --git a/src/wx/colour_conversion_editor.h b/src/wx/colour_conversion_editor.h index b7467a70a..ab45104e9 100644 --- a/src/wx/colour_conversion_editor.h +++ b/src/wx/colour_conversion_editor.h @@ -49,7 +49,7 @@ private: void set_spin_ctrl (wxSpinCtrlDouble *, double); std::map<wxSpinCtrlDouble*, double> _last_spin_ctrl_value; - + wxSpinCtrlDouble* _input_gamma; wxSpinCtrlDouble* _input_power; wxTextCtrl* _input_threshold; diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 447bb98ce..036172bb7 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -81,10 +81,10 @@ protected: config_changed (); _panel->Bind (wxEVT_DESTROY, boost::bind (&Page::window_destroyed, this)); - + return _panel; } - + int _border; wxPanel* _panel; @@ -143,13 +143,13 @@ public: : StockPage (Kind_General, panel_size, border) {} -private: +private: void setup () { wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); table->AddGrowableCol (1, 1); _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border); - + _set_language = new wxCheckBox (_panel, wxID_ANY, _("Set language")); table->Add (_set_language, 1); _language = new wxChoice (_panel, wxID_ANY); @@ -162,14 +162,14 @@ private: _language->Append (wxT ("Svenska")); _language->Append (wxT ("Русский")); table->Add (_language); - + wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to see language changes)"), false); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); restart->SetFont (font); table->AddSpacer (0); - + add_label_to_sizer (table, _panel, _("Threads to use for encoding on this host"), true); _num_local_encoding_threads = new wxSpinCtrl (_panel); table->Add (_num_local_encoding_threads, 1); @@ -177,14 +177,14 @@ private: _check_for_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for updates on startup")); table->Add (_check_for_updates, 1, wxEXPAND | wxALL); table->AddSpacer (0); - + _check_for_test_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for testing updates as well as stable ones")); table->Add (_check_for_test_updates, 1, wxEXPAND | wxALL); table->AddSpacer (0); _set_language->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::set_language_changed, this)); _language->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&GeneralPage::language_changed, this)); - + _num_local_encoding_threads->SetRange (1, 128); _num_local_encoding_threads->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&GeneralPage::num_local_encoding_threads_changed, this)); @@ -195,9 +195,9 @@ private: void config_changed () { Config* config = Config::instance (); - + checked_set (_set_language, config->language ()); - + if (config->language().get_value_or ("") == "fr") { _language->SetSelection (3); } else if (config->language().get_value_or ("") == "it") { @@ -217,7 +217,7 @@ private: } setup_language_sensitivity (); - + checked_set (_num_local_encoding_threads, config->num_local_encoding_threads ()); checked_set (_check_for_updates, config->check_for_updates ()); checked_set (_check_for_test_updates, config->check_for_test_updates ()); @@ -267,12 +267,12 @@ private: break; } } - + void check_for_updates_changed () { Config::instance()->set_check_for_updates (_check_for_updates->GetValue ()); } - + void check_for_test_updates_changed () { Config::instance()->set_check_for_test_updates (_check_for_test_updates->GetValue ()); @@ -296,26 +296,26 @@ public: DefaultsPage (wxSize panel_size, int border) : StandardPage (panel_size, border) {} - + wxString GetName () const { return _("Defaults"); } -#ifdef DCPOMATIC_OSX +#ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const { return wxBitmap ("defaults", wxBITMAP_TYPE_PNG_RESOURCE); } -#endif +#endif -private: +private: void setup () { wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); table->AddGrowableCol (1, 1); _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border); - + { add_label_to_sizer (table, _panel, _("Default duration of still images"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -324,15 +324,15 @@ private: add_label_to_sizer (s, _panel, _("s"), false); table->Add (s, 1); } - + add_label_to_sizer (table, _panel, _("Default directory for new films"), true); #ifdef DCPOMATIC_USE_OWN_DIR_PICKER _directory = new DirPickerCtrl (_panel); -#else +#else _directory = new wxDirPickerCtrl (_panel, wxDD_DIR_MUST_EXIST); #endif table->Add (_directory, 1, wxEXPAND); - + add_label_to_sizer (table, _panel, _("Default ISDCF name details"), true); _isdcf_metadata_button = new wxButton (_panel, wxID_ANY, _("Edit...")); table->Add (_isdcf_metadata_button); @@ -340,11 +340,11 @@ private: add_label_to_sizer (table, _panel, _("Default container"), true); _container = new wxChoice (_panel, wxID_ANY); table->Add (_container); - + add_label_to_sizer (table, _panel, _("Default content type"), true); _dcp_content_type = new wxChoice (_panel, wxID_ANY); table->Add (_dcp_content_type); - + { add_label_to_sizer (table, _panel, _("Default JPEG2000 bandwidth"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -353,7 +353,7 @@ private: add_label_to_sizer (s, _panel, _("Mbit/s"), false); table->Add (s, 1); } - + { add_label_to_sizer (table, _panel, _("Default audio delay"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -369,28 +369,28 @@ private: _still_length->SetRange (1, 3600); _still_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DefaultsPage::still_length_changed, this)); - + _directory->Bind (wxEVT_COMMAND_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this)); - + _isdcf_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this)); - + vector<Ratio const *> ratios = Ratio::all (); for (size_t i = 0; i < ratios.size(); ++i) { _container->Append (std_to_wx (ratios[i]->nickname ())); } - + _container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::container_changed, this)); - + vector<DCPContentType const *> const ct = DCPContentType::all (); for (size_t i = 0; i < ct.size(); ++i) { _dcp_content_type->Append (std_to_wx (ct[i]->pretty_name ())); } - + _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::dcp_content_type_changed, this)); - + _j2k_bandwidth->SetRange (50, 250); _j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DefaultsPage::j2k_bandwidth_changed, this)); - + _audio_delay->SetRange (-1000, 1000); _audio_delay->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DefaultsPage::audio_delay_changed, this)); @@ -414,7 +414,7 @@ private: _dcp_content_type->SetSelection (i); } } - + checked_set (_still_length, config->default_still_length ()); _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); @@ -422,12 +422,12 @@ private: checked_set (_audio_delay, config->default_audio_delay ()); checked_set (_issuer, config->dcp_issuer ()); } - + void j2k_bandwidth_changed () { Config::instance()->set_default_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000); } - + void audio_delay_changed () { Config::instance()->set_default_audio_delay (_audio_delay->GetValue()); @@ -456,7 +456,7 @@ private: vector<Ratio const *> ratio = Ratio::all (); Config::instance()->set_default_container (ratio[_container->GetSelection()]); } - + void dcp_content_type_changed () { vector<DCPContentType const *> ct = DCPContentType::all (); @@ -467,7 +467,7 @@ private: { Config::instance()->set_dcp_issuer (wx_to_std (_issuer->GetValue ())); } - + wxSpinCtrl* _j2k_bandwidth; wxSpinCtrl* _audio_delay; wxButton* _isdcf_metadata_button; @@ -488,25 +488,25 @@ public: EncodingServersPage (wxSize panel_size, int border) : StandardPage (panel_size, border) {} - + wxString GetName () const { return _("Servers"); } -#ifdef DCPOMATIC_OSX +#ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const { return wxBitmap ("servers", wxBITMAP_TYPE_PNG_RESOURCE); } -#endif +#endif -private: +private: void setup () { _use_any_servers = new wxCheckBox (_panel, wxID_ANY, _("Use all servers")); _panel->GetSizer()->Add (_use_any_servers, 0, wxALL, _border); - + vector<string> columns; columns.push_back (wx_to_std (_("IP address / host name"))); _servers_list = new EditableList<string, ServerDialog> ( @@ -516,9 +516,9 @@ private: boost::bind (&Config::set_servers, Config::instance(), _1), boost::bind (&EncodingServersPage::server_column, this, _1) ); - + _panel->GetSizer()->Add (_servers_list, 1, wxEXPAND | wxALL, _border); - + _use_any_servers->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&EncodingServersPage::use_any_servers_changed, this)); } @@ -527,7 +527,7 @@ private: checked_set (_use_any_servers, Config::instance()->use_any_servers ()); _servers_list->refresh (); } - + void use_any_servers_changed () { Config::instance()->set_use_any_servers (_use_any_servers->GetValue ()); @@ -559,17 +559,17 @@ public: { return wxBitmap ("keys", wxBITMAP_TYPE_PNG_RESOURCE); } -#endif +#endif private: void setup () { wxStaticText* m = new wxStaticText (_panel, wxID_ANY, _("Certificate chain for signing DCPs and KDMs:")); _panel->GetSizer()->Add (m, 0, wxALL, _border); - + wxBoxSizer* certificates_sizer = new wxBoxSizer (wxHORIZONTAL); _panel->GetSizer()->Add (certificates_sizer, 0, wxLEFT | wxRIGHT, _border); - + _certificates = new wxListCtrl (_panel, wxID_ANY, wxDefaultPosition, wxSize (400, 200), wxLC_REPORT | wxLC_SINGLE_SEL); { @@ -589,7 +589,7 @@ private: wxFont font = ip.GetFont (); font.SetFamily (wxFONTFAMILY_TELETYPE); ip.SetFont (font); - + _certificates->InsertColumn (1, ip); } @@ -608,7 +608,7 @@ private: _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border); int r = 0; - + _remake_certificates = new wxButton (_panel, wxID_ANY, _("Re-make certificates...")); table->Add (_remake_certificates, wxGBPosition (r, 0), wxGBSpan (1, 3)); ++r; @@ -642,7 +642,7 @@ private: _export_decryption_certificate = new wxButton (_panel, wxID_ANY, _("Export DCP decryption certificate...")); table->Add (_export_decryption_certificate, wxGBPosition (r, 0), wxGBSpan (1, 3)); ++r; - + _add_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KeysPage::add_certificate, this)); _remove_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KeysPage::remove_certificate, this)); _certificates->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&KeysPage::update_sensitivity, this)); @@ -664,11 +664,11 @@ private: update_decryption_private_key (); update_sensitivity (); } - + void add_certificate () { wxFileDialog* d = new wxFileDialog (_panel, _("Select Certificate File")); - + if (d->ShowModal() == wxID_OK) { try { dcp::Certificate c (dcp::file_to_string (wx_to_std (d->GetPath ()))); @@ -679,7 +679,7 @@ private: error_dialog (_panel, wxString::Format (_("Could not read certificate file (%s)"), e.what ())); } } - + d->Destroy (); update_sensitivity (); @@ -691,7 +691,7 @@ private: if (i == -1) { return; } - + _certificates->DeleteItem (i); _signer->certificates().remove (i); Config::instance()->set_signer (_signer); @@ -741,7 +741,7 @@ private: update_certificate_list (); update_signer_private_key (); } - + d->Destroy (); } @@ -753,7 +753,7 @@ private: void update_signer_private_key () { checked_set (_signer_private_key, dcp::private_key_fingerprint (_signer->key ())); - } + } void load_signer_private_key () { @@ -766,7 +766,7 @@ private: error_dialog (_panel, wxString::Format (_("Could not read key file (%s)"), std_to_wx (p.string ()))); return; } - + _signer->set_key (dcp::file_to_string (p)); Config::instance()->set_signer (_signer); update_signer_private_key (); @@ -774,7 +774,7 @@ private: error_dialog (_panel, wxString::Format (_("Could not read certificate file (%s)"), e.what ())); } } - + d->Destroy (); update_sensitivity (); @@ -784,7 +784,7 @@ private: void load_decryption_certificate () { wxFileDialog* d = new wxFileDialog (_panel, _("Select Certificate File")); - + if (d->ShowModal() == wxID_OK) { try { dcp::Certificate c (dcp::file_to_string (wx_to_std (d->GetPath ()))); @@ -794,7 +794,7 @@ private: error_dialog (_panel, wxString::Format (_("Could not read certificate file (%s)"), e.what ())); } } - + d->Destroy (); } @@ -816,7 +816,7 @@ private: error_dialog (_panel, wxString::Format (_("Could not read key file (%s)"), e.what ())); } } - + d->Destroy (); } @@ -831,7 +831,7 @@ private: _panel, _("Select Certificate File"), wxEmptyString, wxEmptyString, wxT ("PEM files (*.pem)|*.pem"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - + if (d->ShowModal () == wxID_OK) { FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w"); if (!f) { @@ -871,36 +871,36 @@ public: return _("TMS"); } -#ifdef DCPOMATIC_OSX +#ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const { return wxBitmap ("tms", wxBITMAP_TYPE_PNG_RESOURCE); } -#endif +#endif -private: +private: void setup () { wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); table->AddGrowableCol (1, 1); _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border); - + add_label_to_sizer (table, _panel, _("IP address"), true); _tms_ip = new wxTextCtrl (_panel, wxID_ANY); table->Add (_tms_ip, 1, wxEXPAND); - + add_label_to_sizer (table, _panel, _("Target path"), true); _tms_path = new wxTextCtrl (_panel, wxID_ANY); table->Add (_tms_path, 1, wxEXPAND); - + add_label_to_sizer (table, _panel, _("User name"), true); _tms_user = new wxTextCtrl (_panel, wxID_ANY); table->Add (_tms_user, 1, wxEXPAND); - + add_label_to_sizer (table, _panel, _("Password"), true); _tms_password = new wxTextCtrl (_panel, wxID_ANY); table->Add (_tms_password, 1, wxEXPAND); - + _tms_ip->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TMSPage::tms_ip_changed, this)); _tms_path->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TMSPage::tms_path_changed, this)); _tms_user->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TMSPage::tms_user_changed, this)); @@ -910,28 +910,28 @@ private: void config_changed () { Config* config = Config::instance (); - + checked_set (_tms_ip, config->tms_ip ()); checked_set (_tms_path, config->tms_path ()); checked_set (_tms_user, config->tms_user ()); checked_set (_tms_password, config->tms_password ()); } - + void tms_ip_changed () { Config::instance()->set_tms_ip (wx_to_std (_tms_ip->GetValue ())); } - + void tms_path_changed () { Config::instance()->set_tms_path (wx_to_std (_tms_path->GetValue ())); } - + void tms_user_changed () { Config::instance()->set_tms_user (wx_to_std (_tms_user->GetValue ())); } - + void tms_password_changed () { Config::instance()->set_tms_password (wx_to_std (_tms_password->GetValue ())); @@ -948,27 +948,27 @@ class KDMEmailPage : public StandardPage public: KDMEmailPage (wxSize panel_size, int border) -#ifdef DCPOMATIC_OSX +#ifdef DCPOMATIC_OSX /* We have to force both width and height of this one */ : StandardPage (wxSize (480, 128), border) #else : StandardPage (panel_size, border) -#endif +#endif {} - + wxString GetName () const { return _("KDM Email"); } -#ifdef DCPOMATIC_OSX +#ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const { return wxBitmap ("kdm_email", wxBITMAP_TYPE_PNG_RESOURCE); } -#endif +#endif -private: +private: void setup () { wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); @@ -978,15 +978,15 @@ private: add_label_to_sizer (table, _panel, _("Outgoing mail server"), true); _mail_server = new wxTextCtrl (_panel, wxID_ANY); table->Add (_mail_server, 1, wxEXPAND | wxALL); - + add_label_to_sizer (table, _panel, _("Mail user name"), true); _mail_user = new wxTextCtrl (_panel, wxID_ANY); table->Add (_mail_user, 1, wxEXPAND | wxALL); - + add_label_to_sizer (table, _panel, _("Mail password"), true); _mail_password = new wxTextCtrl (_panel, wxID_ANY); table->Add (_mail_password, 1, wxEXPAND | wxALL); - + wxStaticText* plain = add_label_to_sizer (table, _panel, _("(password will be stored on disk in plaintext)"), false); wxFont font = plain->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); @@ -997,7 +997,7 @@ private: add_label_to_sizer (table, _panel, _("Subject"), true); _kdm_subject = new wxTextCtrl (_panel, wxID_ANY); table->Add (_kdm_subject, 1, wxEXPAND | wxALL); - + add_label_to_sizer (table, _panel, _("From address"), true); _kdm_from = new wxTextCtrl (_panel, wxID_ANY); table->Add (_kdm_from, 1, wxEXPAND | wxALL); @@ -1009,7 +1009,7 @@ private: add_label_to_sizer (table, _panel, _("BCC address"), true); _kdm_bcc = new wxTextCtrl (_panel, wxID_ANY); table->Add (_kdm_bcc, 1, wxEXPAND | wxALL); - + _kdm_email = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (480, 128), wxTE_MULTILINE); _panel->GetSizer()->Add (_kdm_email, 1, wxEXPAND | wxALL, _border); @@ -1030,7 +1030,7 @@ private: void config_changed () { Config* config = Config::instance (); - + checked_set (_mail_server, config->mail_server ()); checked_set (_mail_user, config->mail_user ()); checked_set (_mail_password, config->mail_password ()); @@ -1040,17 +1040,17 @@ private: checked_set (_kdm_bcc, config->kdm_bcc ()); checked_set (_kdm_email, Config::instance()->kdm_email ()); } - + void mail_server_changed () { Config::instance()->set_mail_server (wx_to_std (_mail_server->GetValue ())); } - + void mail_user_changed () { Config::instance()->set_mail_user (wx_to_std (_mail_user->GetValue ())); } - + void mail_password_changed () { Config::instance()->set_mail_password (wx_to_std (_mail_password->GetValue ())); @@ -1060,7 +1060,7 @@ private: { Config::instance()->set_kdm_subject (wx_to_std (_kdm_subject->GetValue ())); } - + void kdm_from_changed () { Config::instance()->set_kdm_from (wx_to_std (_kdm_from->GetValue ())); @@ -1075,7 +1075,7 @@ private: { Config::instance()->set_kdm_bcc (wx_to_std (_kdm_bcc->GetValue ())); } - + void kdm_email_changed () { if (_kdm_email->GetValue().IsEmpty ()) { @@ -1120,7 +1120,7 @@ public: , _log_timing (0) {} -private: +private: void setup () { wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); @@ -1143,11 +1143,11 @@ private: #ifdef __WXOSX__ wxStaticText* m = new wxStaticText (_panel, wxID_ANY, _("Log:")); table->Add (m, 0, wxALIGN_TOP | wxLEFT | wxRIGHT | wxEXPAND | wxALL | wxALIGN_RIGHT, 6); -#else +#else wxStaticText* m = new wxStaticText (_panel, wxID_ANY, _("Log")); table->Add (m, 0, wxALIGN_TOP | wxLEFT | wxRIGHT | wxEXPAND | wxALL, 6); -#endif - +#endif + { wxBoxSizer* t = new wxBoxSizer (wxVERTICAL); _log_general = new wxCheckBox (_panel, wxID_ANY, _("General")); @@ -1161,12 +1161,12 @@ private: table->Add (t, 0, wxALL, 6); } -#ifdef DCPOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS _win32_console = new wxCheckBox (_panel, wxID_ANY, _("Open console window")); table->Add (_win32_console, 1, wxEXPAND | wxALL); table->AddSpacer (0); -#endif - +#endif + _maximum_j2k_bandwidth->SetRange (1, 1000); _maximum_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&AdvancedPage::maximum_j2k_bandwidth_changed, this)); _allow_any_dcp_frame_rate->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this)); @@ -1176,13 +1176,13 @@ private: _log_timing->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this)); #ifdef DCPOMATIC_WINDOWS _win32_console->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::win32_console_changed, this)); -#endif +#endif } void config_changed () { Config* config = Config::instance (); - + checked_set (_maximum_j2k_bandwidth, config->maximum_j2k_bandwidth() / 1000000); checked_set (_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate ()); checked_set (_log_general, config->log_types() & Log::TYPE_GENERAL); @@ -1222,24 +1222,24 @@ private: Config::instance()->set_log_types (types); } -#ifdef DCPOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS void win32_console_changed () { Config::instance()->set_win32_console (_win32_console->GetValue ()); } -#endif - +#endif + wxSpinCtrl* _maximum_j2k_bandwidth; wxCheckBox* _allow_any_dcp_frame_rate; wxCheckBox* _log_general; wxCheckBox* _log_warning; wxCheckBox* _log_error; wxCheckBox* _log_timing; -#ifdef DCPOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS wxCheckBox* _win32_console; -#endif +#endif }; - + wxPreferencesEditor* create_config_dialog () { @@ -1256,7 +1256,7 @@ create_config_dialog () wxSize ps = wxSize (-1, -1); int const border = 8; #endif - + e->AddPage (new GeneralPage (ps, border)); e->AddPage (new DefaultsPage (ps, border)); e->AddPage (new EncodingServersPage (ps, border)); diff --git a/src/wx/content_colour_conversion_dialog.cc b/src/wx/content_colour_conversion_dialog.cc index 20cbaa02d..45d19d78d 100644 --- a/src/wx/content_colour_conversion_dialog.cc +++ b/src/wx/content_colour_conversion_dialog.cc @@ -89,7 +89,7 @@ ContentColourConversionDialog::check_for_preset () if (_setting) { return; } - + optional<size_t> preset = _editor->get().preset (); _preset_check->SetValue (preset); @@ -123,4 +123,4 @@ ContentColourConversionDialog::preset_choice_changed () } } - + diff --git a/src/wx/content_colour_conversion_dialog.h b/src/wx/content_colour_conversion_dialog.h index 57fd5f1e5..407f3f0c8 100644 --- a/src/wx/content_colour_conversion_dialog.h +++ b/src/wx/content_colour_conversion_dialog.h @@ -33,7 +33,7 @@ private: void check_for_preset (); void preset_check_clicked (); void preset_choice_changed (); - + wxCheckBox* _preset_check; wxChoice* _preset_choice; ColourConversionEditor* _editor; diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 3cf9f23dc..0adbc775a 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -91,9 +91,9 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList ++n; } } - + _join->Enable (n > 1); - + _find_missing->Enable (_content.size() == 1 && !_content.front()->paths_valid ()); _properties->Enable (_content.size() == 1); _re_examine->Enable (!_content.empty ()); @@ -104,7 +104,7 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList } else { _kdm->Enable (false); } - + _remove->Enable (!_content.empty ()); _parent->PopupMenu (_menu, p); } @@ -115,7 +115,7 @@ ContentMenu::repeat () if (_content.empty ()) { return; } - + RepeatDialog* d = new RepeatDialog (_parent); if (d->ShowModal() != wxID_OK) { d->Destroy (); @@ -186,7 +186,7 @@ ContentMenu::remove () if (!fc) { continue; } - + shared_ptr<TimelineVideoContentView> video; shared_ptr<TimelineAudioContentView> audio; @@ -228,7 +228,7 @@ ContentMenu::find_missing () if (!film) { return; } - + shared_ptr<Content> content; /* XXX: a bit nasty */ @@ -254,7 +254,7 @@ ContentMenu::find_missing () } shared_ptr<Job> j (new ExamineContentJob (film, content)); - + _job_connection = j->Finished.connect ( bind ( &ContentMenu::maybe_found_missing, @@ -264,7 +264,7 @@ ContentMenu::find_missing () boost::weak_ptr<Content> (content) ) ); - + JobManager::instance()->add (j); } @@ -308,16 +308,16 @@ ContentMenu::kdm () DCPOMATIC_ASSERT (!_content.empty ()); shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (_content.front ()); DCPOMATIC_ASSERT (dcp); - + wxFileDialog* d = new wxFileDialog (_parent, _("Select KDM")); - + if (d->ShowModal() == wxID_OK) { dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ())))); shared_ptr<Film> film = _film.lock (); DCPOMATIC_ASSERT (film); film->examine_content (dcp); } - + d->Destroy (); } diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h index a0ac3f481..054e3de3e 100644 --- a/src/wx/content_menu.h +++ b/src/wx/content_menu.h @@ -34,7 +34,7 @@ class ContentMenu : public boost::noncopyable public: ContentMenu (wxWindow* p); ~ContentMenu (); - + void popup (boost::weak_ptr<Film>, ContentList, TimelineContentViewList, wxPoint); private: @@ -46,7 +46,7 @@ private: void kdm (); void remove (); void maybe_found_missing (boost::weak_ptr<Job>, boost::weak_ptr<Content>, boost::weak_ptr<Content>); - + wxMenu* _menu; /** Film that we are working with; set up by popup() */ boost::weak_ptr<Film> _film; diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 8bb251251..a578c1628 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -61,7 +61,7 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> film, FilmVie { wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - + _content = new wxListCtrl (_panel, wxID_ANY, wxDefaultPosition, wxSize (320, 160), wxLC_REPORT | wxLC_NO_HEADER); _content->DragAcceptFiles (true); s->Add (_content, 1, wxEXPAND | wxTOP | wxBOTTOM, 6); @@ -70,27 +70,27 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> film, FilmVie _content->SetColumnWidth (0, 512); wxBoxSizer* b = new wxBoxSizer (wxVERTICAL); - + _add_file = new wxButton (_panel, wxID_ANY, _("Add file(s)...")); _add_file->SetToolTip (_("Add video, image or sound files to the film.")); b->Add (_add_file, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); - + _add_folder = new wxButton (_panel, wxID_ANY, _("Add folder...")); _add_folder->SetToolTip (_("Add a folder of image files (which will be used as a moving image sequence) or a DCP.")); b->Add (_add_folder, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); - + _remove = new wxButton (_panel, wxID_ANY, _("Remove")); _remove->SetToolTip (_("Remove the selected piece of content from the film.")); b->Add (_remove, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); - + _earlier = new wxButton (_panel, wxID_ANY, _("Up")); _earlier->SetToolTip (_("Move the selected piece of content earlier in the film.")); b->Add (_earlier, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); - + _later = new wxButton (_panel, wxID_ANY, _("Down")); _later->SetToolTip (_("Move the selected piece of content later in the film.")); b->Add (_later, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); - + _timeline = new wxButton (_panel, wxID_ANY, _("Timeline...")); _timeline->SetToolTip (_("Open the timeline for the film.")); b->Add (_timeline, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); @@ -148,7 +148,7 @@ ContentPanel::selected_video () { ContentList c = selected (); VideoContentList vc; - + for (ContentList::iterator i = c.begin(); i != c.end(); ++i) { shared_ptr<VideoContent> t = dynamic_pointer_cast<VideoContent> (*i); if (t) { @@ -164,7 +164,7 @@ ContentPanel::selected_audio () { ContentList c = selected (); AudioContentList ac; - + for (ContentList::iterator i = c.begin(); i != c.end(); ++i) { shared_ptr<AudioContent> t = dynamic_pointer_cast<AudioContent> (*i); if (t) { @@ -180,7 +180,7 @@ ContentPanel::selected_subtitle () { ContentList c = selected (); SubtitleContentList sc; - + for (ContentList::iterator i = c.begin(); i != c.end(); ++i) { shared_ptr<SubtitleContent> t = dynamic_pointer_cast<SubtitleContent> (*i); if (t) { @@ -196,7 +196,7 @@ ContentPanel::selected_ffmpeg () { ContentList c = selected (); FFmpegContentList sc; - + for (ContentList::iterator i = c.begin(); i != c.end(); ++i) { shared_ptr<FFmpegContent> t = dynamic_pointer_cast<FFmpegContent> (*i); if (t) { @@ -221,7 +221,7 @@ ContentPanel::film_changed (Film::Property p) for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) { (*i)->film_changed (p); } -} +} void ContentPanel::selection_changed () @@ -265,7 +265,7 @@ ContentPanel::add_folder_clicked () int r = d->ShowModal (); boost::filesystem::path const path (wx_to_std (d->GetPath ())); d->Destroy (); - + if (r != wxID_OK) { return; } @@ -290,7 +290,7 @@ ContentPanel::add_folder_clicked () error_dialog (_panel, _("Could not find a DCP nor a set of images in that folder.")); } } else { - + ImageSequenceDialog* e = new ImageSequenceDialog (_panel); r = e->ShowModal (); float const frame_rate = e->frame_rate (); @@ -301,7 +301,7 @@ ContentPanel::add_folder_clicked () } shared_ptr<Content> content; - + try { shared_ptr<ImageContent> content (new ImageContent (_film, path)); content->set_video_frame_rate (frame_rate); @@ -331,7 +331,7 @@ ContentPanel::timeline_clicked () _timeline_dialog->Destroy (); _timeline_dialog = 0; } - + _timeline_dialog = new TimelineDialog (this, _film); _timeline_dialog->Show (); } @@ -432,7 +432,7 @@ ContentPanel::film_content_changed (int property) if (property == ContentProperty::PATH || property == ContentProperty::POSITION || property == DCPContentProperty::CAN_BE_PLAYED) { setup (); } - + for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) { (*i)->film_content_changed (property); } @@ -443,7 +443,7 @@ ContentPanel::setup () { ContentList content = _film->content (); sort (content.begin(), content.end(), ContentSorter ()); - + /* First, check to see if anything has changed and bail if not; this avoids flickering on OS X. */ @@ -461,22 +461,22 @@ ContentPanel::setup () if (!valid) { s = _("MISSING: ") + s; } - + proposed.push_back (s); } - + if (existing == proposed) { return; } - + /* Something has changed: set up the control */ - + string selected_summary; int const s = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (s != -1) { selected_summary = wx_to_std (_content->GetItemText (s)); } - + _content->DeleteAllItems (); for (ContentList::iterator i = content.begin(); i != content.end(); ++i) { @@ -486,7 +486,7 @@ ContentPanel::setup () bool const needs_kdm = dcp && !dcp->can_be_played (); string s = (*i)->summary (); - + if (!valid) { s = _("MISSING: ") + s; } @@ -518,7 +518,7 @@ ContentPanel::files_dropped (wxDropFilesEvent& event) if (!_film) { return; } - + wxString* paths = event.GetFiles (); list<boost::filesystem::path> path_list; for (int i = 0; i < event.GetNumberOfFiles(); i++) { @@ -534,7 +534,7 @@ ContentPanel::add_files (list<boost::filesystem::path> paths) /* It has been reported that the paths returned from e.g. wxFileDialog are not always sorted; I can't reproduce that, but sort them anyway. */ - + paths.sort (ImageFilenameSorter ()); /* XXX: check for lots of files here and do something */ diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index bb7353a9b..452d4a4f8 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -65,8 +65,8 @@ public: FFmpegContentList selected_ffmpeg (); void add_file_clicked (); - -private: + +private: void selection_changed (); void add_folder_clicked (); void remove_clicked (); diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc index feb2c6a46..7fb0cccba 100644 --- a/src/wx/content_properties_dialog.cc +++ b/src/wx/content_properties_dialog.cc @@ -54,7 +54,7 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C } /* XXX: this could be better wrt audio streams */ - + shared_ptr<SingleStreamAudioContent> single = dynamic_pointer_cast<SingleStreamAudioContent> (content); if (single) { add_property ( @@ -62,7 +62,7 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C std_to_wx (raw_convert<string> (single->audio_stream()->channels ())) ); } - + layout (); } diff --git a/src/wx/content_widget.h b/src/wx/content_widget.h index 6f406dadb..3fa1f0ddc 100644 --- a/src/wx/content_widget.h +++ b/src/wx/content_widget.h @@ -90,7 +90,7 @@ public: } _connections.clear (); - + _content = content; _wrapped->Enable (!_content.empty ()); @@ -141,9 +141,9 @@ public: } _ignore_model_changes = false; } - + private: - + void set_single () { if (_wrapped->IsShown ()) { @@ -162,7 +162,7 @@ private: if (_button->IsShown ()) { return; } - + _wrapped->Hide (); _sizer->Detach (_wrapped); _button->Show (); @@ -184,7 +184,7 @@ private: update_from_model (); } } - + T* _wrapped; wxGridBagSizer* _sizer; wxGBPosition _position; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 11db3466f..0f5ec5afc 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -61,16 +61,16 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film) _sizer->Add (grid, 0, wxEXPAND | wxALL, 8); int r = 0; - + add_label_to_grid_bag_sizer (grid, _panel, _("Name"), true, wxGBPosition (r, 0)); _name = new wxTextCtrl (_panel, wxID_ANY); grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND | wxLEFT | wxRIGHT); ++r; - + int flags = wxALIGN_CENTER_VERTICAL; #ifdef __WXOSX__ flags |= wxALIGN_RIGHT; -#endif +#endif _use_isdcf_name = new wxCheckBox (_panel, wxID_ANY, _("Use ISDCF name")); grid->Add (_use_isdcf_name, wxGBPosition (r, 0), wxDefaultSpan, flags); @@ -106,11 +106,11 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film) _notebook->AddPage (make_video_panel (), _("Video"), false); _notebook->AddPage (make_audio_panel (), _("Audio"), false); - + _signed = new wxCheckBox (_panel, wxID_ANY, _("Signed")); grid->Add (_signed, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; - + _encrypted = new wxCheckBox (_panel, wxID_ANY, _("Encrypted")); grid->Add (_encrypted, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; @@ -129,7 +129,7 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film) grid->Add (s, wxGBPosition (r, 1)); ++r; } - + add_label_to_grid_bag_sizer (grid, _panel, _("Standard"), true, wxGBPosition (r, 0)); _standard = new wxChoice (_panel, wxID_ANY); grid->Add (_standard, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); @@ -182,7 +182,7 @@ DCPPanel::j2k_bandwidth_changed () if (!_film) { return; } - + _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000); } @@ -215,7 +215,7 @@ DCPPanel::encrypted_toggled () _film->set_encrypted (_encrypted->GetValue ()); } - + /** Called when the frame rate choice widget has been changed */ void DCPPanel::frame_rate_choice_changed () @@ -400,7 +400,7 @@ DCPPanel::setup_container () ++i; ++n; } - + if (i == ratios.end()) { checked_set (_container, -1); checked_set (_container_size, wxT ("")); @@ -409,9 +409,9 @@ DCPPanel::setup_container () dcp::Size const size = fit_ratio_within (_film->container()->ratio(), _film->full_frame ()); checked_set (_container_size, wxString::Format ("%dx%d", size.width, size.height)); } - + setup_dcp_name (); -} +} /** Called when the container widget has been changed */ void @@ -447,7 +447,7 @@ void DCPPanel::set_film (shared_ptr<Film> film) { _film = film; - + film_changed (Film::NAME); film_changed (Film::USE_ISDCF_NAME); film_changed (Film::CONTENT); @@ -483,7 +483,7 @@ DCPPanel::set_general_sensitivity (bool s) } _burn_subtitles->Enable (s); _signed->Enable (si); - + _encrypted->Enable (s); _key->Enable (s && _film && _film->encrypted ()); _edit_key->Enable (s && _film && _film->encrypted ()); @@ -534,7 +534,7 @@ DCPPanel::best_frame_rate_clicked () if (!_film) { return; } - + _film->set_video_frame_rate (_film->best_video_frame_rate ()); } @@ -579,7 +579,7 @@ DCPPanel::make_video_panel () panel->SetSizer (sizer); int r = 0; - + add_label_to_grid_bag_sizer (grid, panel, _("Container"), true, wxGBPosition (r, 0)); { wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -671,7 +671,7 @@ DCPPanel::minimum_allowed_audio_channels () const } return min; -} +} void DCPPanel::setup_audio_channels_choice () @@ -694,7 +694,7 @@ DCPPanel::make_audio_panel () panel->SetSizer (sizer); int r = 0; - + add_label_to_grid_bag_sizer (grid, panel, _("Channels"), true, wxGBPosition (r, 0)); _audio_channels = new wxChoice (panel, wxID_ANY); setup_audio_channels_choice (); @@ -750,7 +750,7 @@ DCPPanel::show_audio_clicked () _audio_dialog->Destroy (); _audio_dialog = 0; } - + AudioDialog* d = new AudioDialog (_panel, _film); d->Show (); } diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index ac6792ddd..055de67a6 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -72,7 +72,7 @@ private: void edit_key_clicked (); void audio_processor_changed (); void show_audio_clicked (); - + void setup_frame_rate_widget (); void setup_container (); void setup_dcp_name (); diff --git a/src/wx/dir_picker_ctrl.cc b/src/wx/dir_picker_ctrl.cc index fad545283..fe4937edf 100644 --- a/src/wx/dir_picker_ctrl.cc +++ b/src/wx/dir_picker_ctrl.cc @@ -46,7 +46,7 @@ void DirPickerCtrl::SetPath (wxString p) { _path = p; - + if (_path == wxStandardPaths::Get().GetDocumentsDir()) { _folder->SetLabel (_("My Documents")); } else { diff --git a/src/wx/dir_picker_ctrl.h b/src/wx/dir_picker_ctrl.h index 8d596cefc..df6cbffa6 100644 --- a/src/wx/dir_picker_ctrl.h +++ b/src/wx/dir_picker_ctrl.h @@ -29,7 +29,7 @@ public: private: void browse_clicked (); - + wxStaticText* _folder; wxButton* _browse; wxString _path; diff --git a/src/wx/dolby_certificate_dialog.cc b/src/wx/dolby_certificate_dialog.cc index ad43f6479..49c2f01d7 100644 --- a/src/wx/dolby_certificate_dialog.cc +++ b/src/wx/dolby_certificate_dialog.cc @@ -39,7 +39,7 @@ DolbyCertificateDialog::DolbyCertificateDialog (wxWindow* parent, boost::functio add (_("Country"), true); _country = add (new wxChoice (this, wxID_ANY)); _country->Append (N_("Hashemite Kingdom of Jordan")); - + add (_("Cinema"), true); _cinema = add (new wxChoice (this, wxID_ANY)); _cinema->Append (N_("Motion Picture Solutions London Mobile & QC")); @@ -72,7 +72,7 @@ DolbyCertificateDialog::setup_countries () /* Already set up */ return; } - + _country->Append (_("Fetching...")); _country->SetSelection (0); @@ -102,7 +102,7 @@ DolbyCertificateDialog::country_selected () #ifdef DCPOMATIC_OSX wxMilliSleep (200); -#endif +#endif signal_manager->when_idle (boost::bind (&DolbyCertificateDialog::finish_country_selected, this)); } diff --git a/src/wx/doremi_certificate_dialog.cc b/src/wx/doremi_certificate_dialog.cc index 578a7a72d..74f19fcc9 100644 --- a/src/wx/doremi_certificate_dialog.cc +++ b/src/wx/doremi_certificate_dialog.cc @@ -54,10 +54,10 @@ DoremiCertificateDialog::download () downloaded (false); _message->SetLabel (_("Downloading certificate")); -#ifdef DCPOMATIC_OSX +#ifdef DCPOMATIC_OSX /* This is necessary on OS X, otherwise the SetLabel() above has no visible effect */ wxMilliSleep (200); -#endif +#endif signal_manager->when_idle (boost::bind (&DoremiCertificateDialog::finish_download, this, serial)); } diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index a0c41fd76..90d383298 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -45,7 +45,7 @@ DownloadCertificateDialog::add_common_widgets () font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); _message->SetFont (font); - + _download->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DownloadCertificateDialog::download, this)); _download->Enable (false); @@ -62,4 +62,4 @@ DownloadCertificateDialog::downloaded (bool done) ok->Enable (done); } - + diff --git a/src/wx/download_certificate_dialog.h b/src/wx/download_certificate_dialog.h index 40e11de45..85d8f15ab 100644 --- a/src/wx/download_certificate_dialog.h +++ b/src/wx/download_certificate_dialog.h @@ -33,7 +33,7 @@ public: protected: void add_common_widgets (); void downloaded (bool done); - + boost::function<void (boost::filesystem::path)> _load; wxStaticText* _message; wxButton* _download; diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index c6cb28a45..be79f67e6 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -85,14 +85,14 @@ public: void refresh () { _list->DeleteAllItems (); - + std::vector<T> current = _get (); for (typename std::vector<T>::iterator i = current.begin (); i != current.end(); ++i) { add_to_control (*i); } - } + } -private: +private: void add_to_control (T item) { @@ -121,11 +121,11 @@ private: dialog->ShowModal (); add_to_control (dialog->get ()); - + std::vector<T> all = _get (); all.push_back (dialog->get ()); _set (all); - + dialog->Destroy (); } @@ -141,7 +141,7 @@ private: T copy (all[item]); add_to_control (copy); - + all.push_back (copy); _set (all); } @@ -161,7 +161,7 @@ private: dialog->ShowModal (); all[item] = dialog->get (); dialog->Destroy (); - + for (int i = 0; i < _columns; ++i) { _list->SetItem (item, i, std_to_wx (_column (all[item], i))); } @@ -175,7 +175,7 @@ private: if (i == -1) { return; } - + _list->DeleteItem (i); std::vector<T> all = _get (); all.erase (all.begin() + i); diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index ce3791faa..545eaf56e 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -49,7 +49,7 @@ FilmEditor::FilmEditor (wxWindow* parent, FilmViewer* viewer) _main_notebook->AddPage (_content_panel->panel (), _("Content"), true); _dcp_panel = new DCPPanel (_main_notebook, _film); _main_notebook->AddPage (_dcp_panel->panel (), _("DCP"), false); - + JobManager::instance()->ActiveJobsChanged.connect ( bind (&FilmEditor::active_jobs_changed, this, _1) ); @@ -67,7 +67,7 @@ void FilmEditor::film_changed (Film::Property p) { ensure_ui_thread (); - + if (!_film) { return; } @@ -85,7 +85,7 @@ void FilmEditor::film_content_changed (int property) { ensure_ui_thread (); - + if (!_film) { /* We call this method ourselves (as well as using it as a signal handler) so _film can be 0. @@ -106,7 +106,7 @@ FilmEditor::set_film (shared_ptr<Film> film) if (_film == film) { return; } - + _film = film; _content_panel->set_film (_film); diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 768be9d3c..43a1214c2 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -16,7 +16,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + /** @file src/wx/film_editor.h * @brief FilmEditor class. */ @@ -48,7 +48,7 @@ public: ContentPanel* content_panel () const { return _content_panel; } - + boost::shared_ptr<Film> film () const { return _film; } diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index a9b0907a1..4e155e05d 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -71,9 +71,9 @@ FilmViewer::FilmViewer (wxWindow* p) #ifndef __WXOSX__ _panel->SetDoubleBuffered (true); #endif - + _panel->SetBackgroundStyle (wxBG_STYLE_PAINT); - + _v_sizer = new wxBoxSizer (wxVERTICAL); SetSizer (_v_sizer); @@ -111,7 +111,7 @@ FilmViewer::FilmViewer (wxWindow* p) _forward_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmViewer::forward_clicked, this)); set_film (shared_ptr<Film> ()); - + JobManager::instance()->ActiveJobsChanged.connect ( bind (&FilmViewer::active_jobs_changed, this, _1) ); @@ -129,10 +129,10 @@ FilmViewer::set_film (shared_ptr<Film> film) _film = film; _frame.reset (); - + update_position_slider (); update_position_label (); - + if (!_film) { return; } @@ -149,7 +149,7 @@ FilmViewer::set_film (shared_ptr<Film> film) in the preview. */ _player->set_burn_subtitles (true); - + _film_connection = _film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1)); _player_connection = _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1)); @@ -180,7 +180,7 @@ FilmViewer::get (DCPTime p, bool accurate) } catch (exception& e) { error_dialog (this, wxString::Format (_("Could not get video for view (%s)"), std_to_wx(e.what()).data())); } - + if (!pvf.empty ()) { try { _frame = pvf.front()->image (PIX_FMT_RGB24, true, boost::bind (&Log::dcp_log, _film->log().get(), _1, _2)); @@ -189,7 +189,7 @@ FilmViewer::get (DCPTime p, bool accurate) if (pvf.front()->colour_conversion()) { yuv_to_rgb = pvf.front()->colour_conversion().get().yuv_to_rgb(); } - + _frame = _frame->scale (_frame->size(), yuv_to_rgb, PIX_FMT_RGB24, false); _position = pvf.front()->time (); _inter_position = pvf.front()->inter_position (); @@ -229,7 +229,7 @@ FilmViewer::timer () } else { get (_position + frame, true); } - + update_position_label (); update_position_slider (); } @@ -308,10 +308,10 @@ FilmViewer::calculate_sizes () } Ratio const * container = _film->container (); - + float const panel_ratio = _panel_size.ratio (); float const film_ratio = container ? container->ratio () : 1.78; - + if (panel_ratio < film_ratio) { /* panel is less widscreen than the film; clamp width */ _out_size.width = _panel_size.width; @@ -341,7 +341,7 @@ FilmViewer::check_play_state () if (!_film || _film->video_frame_rate() == 0) { return; } - + if (_play_button->GetValue()) { _timer.Start (1000 / _film->video_frame_rate()); } else { @@ -356,7 +356,7 @@ FilmViewer::update_position_slider () _slider->SetValue (0); return; } - + DCPTime const len = _film->length (); if (len.get ()) { @@ -387,17 +387,17 @@ FilmViewer::active_jobs_changed (bool a) { if (a) { list<shared_ptr<Job> > jobs = JobManager::instance()->get (); - list<shared_ptr<Job> >::iterator i = jobs.begin (); + list<shared_ptr<Job> >::iterator i = jobs.begin (); while (i != jobs.end() && boost::dynamic_pointer_cast<ExamineContentJob> (*i) == 0) { ++i; } - + if (i == jobs.end() || (*i)->finished()) { /* no examine content job running, so we're ok to use the viewer */ a = false; } } - + _slider->Enable (!a); _play_button->Enable (!a); } @@ -440,7 +440,7 @@ void FilmViewer::setup_sensitivity () { bool const c = _film && !_film->content().empty (); - + _slider->Enable (c); _back_button->Enable (c); _forward_button->Enable (c); diff --git a/src/wx/filter_dialog.cc b/src/wx/filter_dialog.cc index 13907ae0c..306ee749d 100644 --- a/src/wx/filter_dialog.cc +++ b/src/wx/filter_dialog.cc @@ -46,7 +46,7 @@ FilterDialog::FilterDialog (wxWindow* parent, vector<Filter const *> const & f) sizer->Layout (); sizer->SetSizeHints (this); } - + void FilterDialog::active_changed () diff --git a/src/wx/filter_dialog.h b/src/wx/filter_dialog.h index d54e6f2e4..6ca1f6886 100644 --- a/src/wx/filter_dialog.h +++ b/src/wx/filter_dialog.h @@ -40,6 +40,6 @@ public: private: void active_changed (); - + FilterEditor* _filters; }; diff --git a/src/wx/filter_editor.cc b/src/wx/filter_editor.cc index 4dd18004b..6b5b8505e 100644 --- a/src/wx/filter_editor.cc +++ b/src/wx/filter_editor.cc @@ -34,7 +34,7 @@ FilterEditor::FilterEditor (wxWindow* parent, vector<Filter const *> const & act { wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); SetSizer (sizer); - + vector<Filter const *> filters = Filter::all (); typedef map<string, list<Filter const *> > CategoryMap; diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index aa9fd1540..092faf9e6 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -41,7 +41,7 @@ FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<SubtitleContent> content) ip.SetWidth (100); _fonts->InsertColumn (0, ip); } - + { wxListItem ip; ip.SetId (1); @@ -85,7 +85,7 @@ FontsDialog::setup () if (!content) { return; } - + _fonts->DeleteAllItems (); list<shared_ptr<Font> > fonts = content->fonts (); size_t n = 0; @@ -113,7 +113,7 @@ FontsDialog::set_file_clicked () if (item == -1) { return; } - + /* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using non-Latin filenames or paths. */ diff --git a/src/wx/fonts_dialog.h b/src/wx/fonts_dialog.h index 76eae3ec2..0d4bcfd7e 100644 --- a/src/wx/fonts_dialog.h +++ b/src/wx/fonts_dialog.h @@ -33,7 +33,7 @@ private: void set_file_clicked (); void update_sensitivity (); void selection_changed (); - + boost::weak_ptr<SubtitleContent> _content; wxListCtrl* _fonts; wxButton* _set_file; diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc index d49dfae70..133d84c21 100644 --- a/src/wx/gain_calculator_dialog.cc +++ b/src/wx/gain_calculator_dialog.cc @@ -41,7 +41,7 @@ GainCalculatorDialog::wanted_fader () const if (_wanted->GetValue().IsEmpty()) { return 0; } - + return lexical_cast<float> (wx_to_std (_wanted->GetValue ())); } diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 40f1f3377..36c9eb6c8 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -63,14 +63,14 @@ HintsDialog::film_changed () { _text->Clear (); bool hint = false; - + boost::shared_ptr<Film> film = _film.lock (); if (!film) { return; } ContentList content = film->content (); - + _text->BeginStandardBullet (N_("standard/circle"), 1, 50); bool big_font_files = false; @@ -132,7 +132,7 @@ HintsDialog::film_changed () _text->WriteText (_("All of your content is at 1.85:1 or narrower but your DCP's container is Scope (2.39:1). This will pillar-box your content inside a Flat (1.85:1) frame. You may prefer to set your DCP's container to Flat (1.85:1) in the \"DCP\" tab.")); _text->Newline (); } - + if (film->video_frame_rate() != 24 && film->video_frame_rate() != 48) { hint = true; _text->WriteText (wxString::Format (_("Your DCP frame rate (%d fps) may cause problems in a few (mostly older) projectors. Use 24 or 48 frames per second to be on the safe side."), film->video_frame_rate())); diff --git a/src/wx/hints_dialog.h b/src/wx/hints_dialog.h index 88b2fa1ba..f4ef00aa2 100644 --- a/src/wx/hints_dialog.h +++ b/src/wx/hints_dialog.h @@ -30,7 +30,7 @@ public: private: void film_changed (); - + boost::weak_ptr<Film> _film; wxRichTextCtrl* _text; diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc index 3df393a30..47d159cb9 100644 --- a/src/wx/isdcf_metadata_dialog.cc +++ b/src/wx/isdcf_metadata_dialog.cc @@ -37,7 +37,7 @@ ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm) add (_("Subtitle Language (e.g. FR)"), true); _subtitle_language = add (new wxTextCtrl (this, wxID_ANY)); - + add (_("Territory (e.g. UK)"), true); _territory = add (new wxTextCtrl (this, wxID_ANY)); @@ -70,7 +70,7 @@ ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm) add (_("Mastered luminance (e.g. 14fl)"), true); _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - + _content_version->SetRange (1, 1024); _content_version->SetValue (dm.content_version); diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index 826c46811..24cacf6b0 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -55,26 +55,26 @@ public: gauge_message->Add (_message, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6); table->Insert (n, gauge_message, 1, wxEXPAND | wxLEFT | wxRIGHT); ++n; - + _cancel = new wxButton (panel, wxID_ANY, _("Cancel")); _cancel->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::cancel_clicked, this); table->Insert (n, _cancel, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3); ++n; - + _pause = new wxButton (_panel, wxID_ANY, _("Pause")); _pause->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::pause_clicked, this); table->Insert (n, _pause, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3); ++n; - + _details = new wxButton (_panel, wxID_ANY, _("Details...")); _details->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::details_clicked, this); _details->Enable (false); table->Insert (n, _details, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3); ++n; - + _progress_connection = job->Progress.connect (boost::bind (&JobRecord::progress, this)); _finished_connection = job->Finished.connect (boost::bind (&JobRecord::finished, this)); - + table->Layout (); } @@ -106,11 +106,11 @@ private: void finished () { progress (); - + if (!_job->finished_cancelled ()) { _gauge->SetValue (100); } - + _cancel->Enable (false); _pause->Enable (false); if (!_job->error_details().empty ()) { @@ -124,7 +124,7 @@ private: s[0] = toupper (s[0]); error_dialog (_window, std_to_wx (String::compose ("%1.\n\n%2", s, _job->error_details()))); } - + void cancel_clicked (wxCommandEvent &) { _job->cancel (); @@ -140,7 +140,7 @@ private: _pause->SetLabel (_("Resume")); } } - + boost::shared_ptr<Job> _job; wxScrolledWindow* _window; wxPanel* _panel; diff --git a/src/wx/job_manager_view.h b/src/wx/job_manager_view.h index 244299a40..a83b481dc 100644 --- a/src/wx/job_manager_view.h +++ b/src/wx/job_manager_view.h @@ -43,6 +43,6 @@ private: wxPanel* _panel; wxFlexGridSizer* _table; boost::shared_ptr<wxTimer> _timer; - + std::list<boost::shared_ptr<JobRecord> > _job_records; }; diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 8f4f8622d..67e1a9951 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -60,7 +60,7 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) wxStaticText* h = new wxStaticText (this, wxID_ANY, _("Screens")); h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL); - + wxBoxSizer* targets = new wxBoxSizer (wxHORIZONTAL); _targets = new wxTreeCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT | wxTR_MULTIPLE | wxTR_HAS_BUTTONS); targets->Add (_targets, 1, wxEXPAND | wxTOP | wxRIGHT, DCPOMATIC_SIZER_GAP); @@ -82,7 +82,7 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) target_buttons->Add (_edit_cinema, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); _remove_cinema = new wxButton (this, wxID_ANY, _("Remove Cinema")); target_buttons->Add (_remove_cinema, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); - + _add_screen = new wxButton (this, wxID_ANY, _("Add Screen...")); target_buttons->Add (_add_screen, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); _edit_screen = new wxButton (this, wxID_ANY, _("Edit Screen...")); @@ -99,7 +99,7 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) h = new wxStaticText (this, wxID_ANY, S_("KDM|Timing")); h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); - + wxFlexGridSizer* table = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); add_label_to_sizer (table, this, _("From"), true); wxDateTime from; @@ -125,7 +125,7 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) h = new wxStaticText (this, wxID_ANY, _("CPL")); h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); - + /* CPL choice */ wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); add_label_to_sizer (s, this, _("CPL"), true); @@ -147,16 +147,16 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) _cpl_annotation_text = new wxStaticText (this, wxID_ANY, ""); table->Add (_cpl_annotation_text); vertical->Add (table, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP + 2); - + _cpls = film->cpls (); update_cpl_choice (); - + /* Sub-heading: Output */ h = new wxStaticText (this, wxID_ANY, _("Output")); h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); - + table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, 0); add_label_to_sizer (table, this, _("KDM type"), true); @@ -173,19 +173,19 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film) table->Add (_write_to, 1, wxEXPAND); #ifdef DCPOMATIC_USE_OWN_DIR_PICKER - _folder = new DirPickerCtrl (this); -#else + _folder = new DirPickerCtrl (this); +#else _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1)); #endif _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir()); - + table->Add (_folder, 1, wxEXPAND); _email = new wxRadioButton (this, wxID_ANY, _("Send by email")); table->Add (_email, 1, wxEXPAND); table->AddSpacer (0); - + vertical->Add (table, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP); /* Make an overall sizer to get a nice border, and put some buttons in */ @@ -265,10 +265,10 @@ KDMDialog::setup_sensitivity () bool const sc = selected_cinemas().size() == 1; bool const ss = selected_screens().size() == 1; bool const sd = _cpl->GetSelection() != -1; - + _edit_cinema->Enable (sc); _remove_cinema->Enable (sc); - + _add_screen->Enable (sc); _edit_screen->Enable (ss); _remove_screen->Enable (ss); @@ -328,7 +328,7 @@ KDMDialog::edit_cinema_clicked () } pair<wxTreeItemId, shared_ptr<Cinema> > c = selected_cinemas().front(); - + CinemaDialog* d = new CinemaDialog (this, "Edit cinema", c.second->name, c.second->email); if (d->ShowModal () == wxID_OK) { c.second->name = d->name (); @@ -337,7 +337,7 @@ KDMDialog::edit_cinema_clicked () Config::instance()->changed (); } - d->Destroy (); + d->Destroy (); } void @@ -361,7 +361,7 @@ KDMDialog::add_screen_clicked () } shared_ptr<Cinema> c = selected_cinemas().front().second; - + ScreenDialog* d = new ScreenDialog (this, "Add Screen"); if (d->ShowModal () != wxID_OK) { return; @@ -384,7 +384,7 @@ KDMDialog::edit_screen_clicked () } pair<wxTreeItemId, shared_ptr<Screen> > s = selected_screens().front(); - + ScreenDialog* d = new ScreenDialog (this, "Edit screen", s.second->name, s.second->certificate); if (d->ShowModal () == wxID_OK) { s.second->name = d->name (); @@ -500,7 +500,7 @@ void KDMDialog::update_cpl_choice () { _cpl->Clear (); - + for (vector<CPLSummary>::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) { _cpl->Append (std_to_wx (i->cpl_id)); @@ -556,7 +556,7 @@ KDMDialog::cpl_browse_clicked () error_dialog (this, _("This is not a valid CPL file")); return; } - + update_cpl_choice (); _cpl->SetSelection (_cpls.size() - 1); update_cpl_summary (); diff --git a/src/wx/kdm_dialog.h b/src/wx/kdm_dialog.h index 0fc95db84..1cf4ddde8 100644 --- a/src/wx/kdm_dialog.h +++ b/src/wx/kdm_dialog.h @@ -44,7 +44,7 @@ public: boost::posix_time::ptime from () const; /** @return KDM until time in local time */ boost::posix_time::ptime until () const; - + boost::filesystem::path cpl () const; boost::filesystem::path directory () const; bool write_to () const; @@ -67,7 +67,7 @@ private: void cpl_browse_clicked (); static boost::posix_time::ptime posix_time (wxDatePickerCtrl *, wxTimePickerCtrl *); - + wxTreeCtrl* _targets; wxButton* _add_cinema; wxButton* _edit_cinema; diff --git a/src/wx/key_dialog.cc b/src/wx/key_dialog.cc index 70229c7a9..6133e8583 100644 --- a/src/wx/key_dialog.cc +++ b/src/wx/key_dialog.cc @@ -40,7 +40,7 @@ KeyDialog::KeyDialog (wxWindow* parent, dcp::Key key) } validator.SetIncludes (list); - + _key = add (new wxTextCtrl (this, wxID_ANY, _(""), wxDefaultPosition, size, 0, validator)); _key->SetValue (std_to_wx (key.hex ())); _key->SetMaxLength (32); diff --git a/src/wx/key_dialog.h b/src/wx/key_dialog.h index 81402d46e..b04566212 100644 --- a/src/wx/key_dialog.h +++ b/src/wx/key_dialog.h @@ -30,7 +30,7 @@ public: private: void key_changed (); void random (); - + wxTextCtrl* _key; wxButton* _random; }; diff --git a/src/wx/make_signer_chain_dialog.h b/src/wx/make_signer_chain_dialog.h index fc6391a94..6d018c0dc 100644 --- a/src/wx/make_signer_chain_dialog.h +++ b/src/wx/make_signer_chain_dialog.h @@ -44,7 +44,7 @@ public: std::string leaf_common_name () const { return wx_to_std (_leaf_common_name->GetValue ()); } - + private: wxTextCtrl* _organisation; @@ -53,4 +53,4 @@ private: wxTextCtrl* _intermediate_common_name; wxTextCtrl* _leaf_common_name; }; - + diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index 8f317f42f..96c8a0b0c 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -40,15 +40,15 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) add (_("Create in folder"), true); #ifdef DCPOMATIC_USE_OWN_DIR_PICKER - _folder = new DirPickerCtrl (this); -#else + _folder = new DirPickerCtrl (this); +#else _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1)); #endif if (!_directory) { _directory = Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())); } - + _folder->SetPath (std_to_wx (_directory.get().string())); add (_folder); diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h index 5ec5863c6..6ce3d6e3a 100644 --- a/src/wx/new_film_dialog.h +++ b/src/wx/new_film_dialog.h @@ -36,8 +36,8 @@ private: wxTextCtrl* _name; #ifdef DCPOMATIC_USE_OWN_DIR_PICKER DirPickerCtrl* _folder; -#else +#else wxDirPickerCtrl* _folder; -#endif +#endif static boost::optional<boost::filesystem::path> _directory; }; diff --git a/src/wx/report_problem_dialog.cc b/src/wx/report_problem_dialog.cc index ae9b1d3ed..971619daf 100644 --- a/src/wx/report_problem_dialog.cc +++ b/src/wx/report_problem_dialog.cc @@ -49,7 +49,7 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil #ifdef __WXOSX__ flags |= wxALIGN_RIGHT; t += wxT (":"); -#endif +#endif wxStaticText* m = new wxStaticText (this, wxID_ANY, t); _table->Add (m, 1, flags, 6); diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h index 3e110d230..69d0fff81 100644 --- a/src/wx/screen_dialog.h +++ b/src/wx/screen_dialog.h @@ -31,13 +31,13 @@ public: std::string name () const; boost::optional<dcp::Certificate> certificate () const; - + private: void select_certificate (); void load_certificate (boost::filesystem::path); void download_certificate (); void setup_sensitivity (); - + wxTextCtrl* _name; wxChoice* _manufacturer; wxButton* _load_certificate; diff --git a/src/wx/servers_list_dialog.cc b/src/wx/servers_list_dialog.cc index 299ce2f20..13c6df707 100644 --- a/src/wx/servers_list_dialog.cc +++ b/src/wx/servers_list_dialog.cc @@ -31,7 +31,7 @@ ServersListDialog::ServersListDialog (wxWindow* parent) { wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); SetSizer (s); - + _list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize (400, 200), wxLC_REPORT | wxLC_SINGLE_SEL); { @@ -60,7 +60,7 @@ ServersListDialog::ServersListDialog (wxWindow* parent) SetSizer (s); s->Layout (); s->SetSizeHints (this); - + _server_finder_connection = ServerFinder::instance()->connect (boost::bind (&ServersListDialog::server_found, this, _1)); } diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 1e137f233..9823df7a7 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -67,7 +67,7 @@ SubtitlePanel::SubtitlePanel (ContentPanel* p) add_label_to_sizer (s, this, _("%"), false); grid->Add (s); } - + { add_label_to_sizer (grid, this, _("X Scale"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -89,7 +89,7 @@ SubtitlePanel::SubtitlePanel (ContentPanel* p) add_label_to_sizer (grid, this, _("Language"), true); _language = new wxTextCtrl (this, wxID_ANY); grid->Add (_language, 1, wxEXPAND); - + add_label_to_sizer (grid, this, _("Stream"), true); _stream = new wxChoice (this, wxID_ANY); grid->Add (_stream, 1, wxEXPAND); @@ -101,7 +101,7 @@ SubtitlePanel::SubtitlePanel (ContentPanel* p) _fonts_dialog_button = new wxButton (this, wxID_ANY, _("Fonts...")); grid->Add (_fonts_dialog_button); grid->AddSpacer (0); - + _x_offset->SetRange (-100, 100); _y_offset->SetRange (-100, 100); _x_scale->SetRange (10, 1000); @@ -149,7 +149,7 @@ SubtitlePanel::film_content_changed (int property) for (vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = s.begin(); i != s.end(); ++i) { _stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx ((*i)->identifier ()))); } - + if (fcs->subtitle_stream()) { checked_set (_stream, fcs->subtitle_stream()->identifier ()); } else { @@ -205,10 +205,10 @@ SubtitlePanel::setup_sensitivity () ++any_subs; } } - + _use->Enable (any_subs > 0); bool const use = _use->GetValue (); - + _x_offset->Enable (any_subs > 0 && use); _y_offset->Enable (any_subs > 0 && use); _x_scale->Enable (any_subs > 0 && use); @@ -228,7 +228,7 @@ SubtitlePanel::stream_changed () } shared_ptr<FFmpegContent> fcs = fc.front (); - + vector<shared_ptr<FFmpegSubtitleStream> > a = fcs->subtitle_streams (); vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = a.begin (); string const s = string_client_data (_stream->GetClientObject (_stream->GetSelection ())); @@ -311,17 +311,17 @@ SubtitlePanel::subtitle_view_clicked () DCPOMATIC_ASSERT (c.size() == 1); shared_ptr<SubtitleDecoder> decoder; - + shared_ptr<SubRipContent> sr = dynamic_pointer_cast<SubRipContent> (c.front ()); if (sr) { decoder.reset (new SubRipDecoder (sr)); } - + shared_ptr<DCPSubtitleContent> dc = dynamic_pointer_cast<DCPSubtitleContent> (c.front ()); if (dc) { decoder.reset (new DCPSubtitleDecoder (dc)); } - + if (decoder) { _subtitle_view = new SubtitleView (this, _parent->film(), decoder, c.front()->position ()); _subtitle_view->Show (); diff --git a/src/wx/subtitle_panel.h b/src/wx/subtitle_panel.h index ef94adb54..5a39f3bcd 100644 --- a/src/wx/subtitle_panel.h +++ b/src/wx/subtitle_panel.h @@ -32,7 +32,7 @@ public: void film_changed (Film::Property); void film_content_changed (int); void content_selection_changed (); - + private: void use_toggled (); void x_offset_changed (); @@ -45,7 +45,7 @@ private: void fonts_dialog_clicked (); void setup_sensitivity (); - + wxCheckBox* _use; wxSpinCtrl* _x_offset; wxSpinCtrl* _y_offset; diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc index b58af3019..33ef7cfda 100644 --- a/src/wx/subtitle_view.cc +++ b/src/wx/subtitle_view.cc @@ -47,7 +47,7 @@ SubtitleView::SubtitleView (wxWindow* parent, shared_ptr<Film> film, shared_ptr< ip.SetText (_("End")); ip.SetWidth (100); _list->InsertColumn (1, ip); - } + } { wxListItem ip; diff --git a/src/wx/subtitle_view.h b/src/wx/subtitle_view.h index 338742afc..f5a61890b 100644 --- a/src/wx/subtitle_view.h +++ b/src/wx/subtitle_view.h @@ -28,6 +28,6 @@ class SubtitleView : public wxDialog public: SubtitleView (wxWindow *, boost::shared_ptr<Film>, boost::shared_ptr<SubtitleDecoder>, DCPTime position); -private: +private: wxListCtrl* _list; }; diff --git a/src/wx/table_dialog.cc b/src/wx/table_dialog.cc index 571fcf3a4..b3937fd18 100644 --- a/src/wx/table_dialog.cc +++ b/src/wx/table_dialog.cc @@ -35,7 +35,7 @@ TableDialog::TableDialog (wxWindow* parent, wxString title, int columns, bool ca if (cancel) { flags |= wxCANCEL; } - + wxSizer* buttons = CreateSeparatedButtonSizer (flags); if (buttons) { _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); diff --git a/src/wx/table_dialog.h b/src/wx/table_dialog.h index 23017c3b6..f04c2027c 100644 --- a/src/wx/table_dialog.h +++ b/src/wx/table_dialog.h @@ -36,10 +36,10 @@ protected: void add (wxString text, bool label); void add_spacer (); - + void layout (); -private: +private: wxSizer* _overall_sizer; wxFlexGridSizer* _table; }; diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index 291a6ba58..8029d2f6a 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -30,7 +30,7 @@ TimecodeBase::TimecodeBase (wxWindow* parent) : wxPanel (parent) { wxSize const s = TimecodeBase::size (parent); - + wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); wxArrayString list; @@ -42,7 +42,7 @@ TimecodeBase::TimecodeBase (wxWindow* parent) validator.SetIncludes (list); _sizer = new wxBoxSizer (wxHORIZONTAL); - + _editable = new wxPanel (this); wxSizer* editable_sizer = new wxBoxSizer (wxHORIZONTAL); _hours = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, s, 0, validator); @@ -66,7 +66,7 @@ TimecodeBase::TimecodeBase (wxWindow* parent) _sizer->Add (_editable); _fixed = add_label_to_sizer (_sizer, this, wxT ("42"), false); - + _hours->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); _minutes->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); _seconds->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&TimecodeBase::changed, this)); diff --git a/src/wx/timecode.h b/src/wx/timecode.h index 620782567..45a421c4d 100644 --- a/src/wx/timecode.h +++ b/src/wx/timecode.h @@ -42,7 +42,7 @@ public: protected: void changed (); void set_clicked (); - + wxSizer* _sizer; wxPanel* _editable; wxTextCtrl* _hours; @@ -70,12 +70,12 @@ public: int s; int f; t.split (fps, h, m, s, f); - + checked_set (_hours, boost::lexical_cast<std::string> (h)); checked_set (_minutes, boost::lexical_cast<std::string> (m)); checked_set (_seconds, boost::lexical_cast<std::string> (s)); checked_set (_frames, boost::lexical_cast<std::string> (f)); - + checked_set (_fixed, t.timecode (fps)); } @@ -90,7 +90,7 @@ public: t += T::from_seconds (boost::lexical_cast<int> (s.empty() ? "0" : s)); std::string const f = wx_to_std (_frames->GetValue()); t += T::from_seconds (boost::lexical_cast<double> (f.empty() ? "0" : f) / fps); - + return t; } }; diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 8c8692aa1..4f0eef0e1 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -55,7 +55,7 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film) { #ifndef __WXOSX__ SetDoubleBuffered (true); -#endif +#endif Bind (wxEVT_PAINT, boost::bind (&Timeline::paint, this)); Bind (wxEVT_LEFT_DOWN, boost::bind (&Timeline::left_down, this, _1)); @@ -176,21 +176,21 @@ Timeline::assign_tracks () ++j; continue; } - + shared_ptr<Content> test_content = test->content(); - + if (test && test->track() && test->track().get() == t) { bool const no_overlap = (content->position() < test_content->position() && content->end() < test_content->position()) || (content->position() > test_content->end() && content->end() > test_content->end()); - + if (!no_overlap) { /* we have an overlap on track `t' */ ++t; break; } } - + ++j; } @@ -258,11 +258,11 @@ Timeline::left_down (wxMouseEvent& ev) if (!cv) { continue; } - + if (!ev.ShiftDown ()) { cv->set_selected (view == *i); } - + if (view == *i) { _content_panel->set_selection (cv->content ()); } @@ -360,9 +360,9 @@ Timeline::set_position_from_event (wxMouseEvent& ev) if (!_down_view) { return; } - + DCPTime new_position = _down_view_position + DCPTime::from_seconds ((p.x - _down_point.x) / pps); - + if (_snap) { DCPTime const new_end = new_position + _down_view->content()->length_after_trim () - DCPTime (1); @@ -370,7 +370,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev) positive is right). */ optional<DCPTime> nearest_distance; - + /* Find the nearest content edge; this is inefficient */ for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) { shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (*i); @@ -383,7 +383,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev) maybe_snap (cv->content()->end() + DCPTime (1), new_position, nearest_distance); maybe_snap (cv->content()->end() + DCPTime (1), new_end, nearest_distance); } - + if (nearest_distance) { /* Snap if it's close; `close' means within a proportion of the time on the timeline */ if (nearest_distance.get().abs() < DCPTime::from_seconds ((width() / pps) / 64)) { @@ -391,13 +391,13 @@ Timeline::set_position_from_event (wxMouseEvent& ev) } } } - + if (new_position < DCPTime ()) { new_position = DCPTime (); } _down_view->content()->set_position (new_position); - + shared_ptr<Film> film = _film.lock (); DCPOMATIC_ASSERT (film); film->set_sequence_video (false); @@ -436,7 +436,7 @@ TimelineContentViewList Timeline::selected_views () const { TimelineContentViewList sel; - + for (TimelineViewList::const_iterator i = _views.begin(); i != _views.end(); ++i) { shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (*i); if (cv && cv->selected()) { @@ -452,7 +452,7 @@ Timeline::selected_content () const { ContentList sel; TimelineContentViewList views = selected_views (); - + for (TimelineContentViewList::const_iterator i = views.begin(); i != views.end(); ++i) { sel.push_back ((*i)->content ()); } diff --git a/src/wx/timeline_audio_content_view.h b/src/wx/timeline_audio_content_view.h index 23c5c6d85..6f1a383de 100644 --- a/src/wx/timeline_audio_content_view.h +++ b/src/wx/timeline_audio_content_view.h @@ -26,7 +26,7 @@ class TimelineAudioContentView : public TimelineContentView { public: TimelineAudioContentView (Timeline& tl, boost::shared_ptr<Content> c); - + private: wxString type () const; wxColour background_colour () const; diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index b72ba48c8..df0772be9 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -37,13 +37,13 @@ dcpomatic::Rect<int> TimelineContentView::bbox () const { DCPOMATIC_ASSERT (_track); - + shared_ptr<const Film> film = _timeline.film (); shared_ptr<const Content> content = _content.lock (); if (!film || !content) { return dcpomatic::Rect<int> (); } - + return dcpomatic::Rect<int> ( time_x (content->position ()) - 8, y_pos (_track.get()) - 8, @@ -93,18 +93,18 @@ void TimelineContentView::do_paint (wxGraphicsContext* gc) { DCPOMATIC_ASSERT (_track); - + shared_ptr<const Film> film = _timeline.film (); shared_ptr<const Content> cont = content (); if (!film || !cont) { return; } - + DCPTime const position = cont->position (); DCPTime const len = cont->length_after_trim (); - + wxColour selected (background_colour().Red() / 2, background_colour().Green() / 2, background_colour().Blue() / 2); - + gc->SetPen (*wxThePenList->FindOrCreatePen (foreground_colour(), 4, wxPENSTYLE_SOLID)); if (_selected) { gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (selected, wxBRUSHSTYLE_SOLID)); @@ -120,14 +120,14 @@ TimelineContentView::do_paint (wxGraphicsContext* gc) path.AddLineToPoint (time_x (position), y_pos (_track.get()) + 4); gc->StrokePath (path); gc->FillPath (path); - + wxString name = wxString::Format (wxT ("%s [%s]"), std_to_wx (cont->summary()).data(), type().data()); wxDouble name_width; wxDouble name_height; wxDouble name_descent; wxDouble name_leading; gc->GetTextExtent (name, &name_width, &name_height, &name_descent, &name_leading); - + gc->Clip (wxRegion (time_x (position), y_pos (_track.get()), len.seconds() * _timeline.pixels_per_second().get_value_or(0), _timeline.track_height())); gc->SetFont (gc->CreateFont (*wxNORMAL_FONT, foreground_colour ())); gc->DrawText (name, time_x (position) + 12, y_pos (_track.get() + 1) - name_height - 4); @@ -144,11 +144,11 @@ void TimelineContentView::content_changed (int p, bool frequent) { ensure_ui_thread (); - + if (p == ContentProperty::POSITION || p == ContentProperty::LENGTH) { force_redraw (); } - + if (!frequent) { _timeline.setup_pixels_per_second (); _timeline.Refresh (); diff --git a/src/wx/timeline_content_view.h b/src/wx/timeline_content_view.h index d5c9126c0..3262f13f3 100644 --- a/src/wx/timeline_content_view.h +++ b/src/wx/timeline_content_view.h @@ -46,7 +46,7 @@ public: virtual wxString type () const = 0; virtual wxColour background_colour () const = 0; virtual wxColour foreground_colour () const = 0; - + private: void do_paint (wxGraphicsContext* gc); diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 6ec52ff38..ab2162b39 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -70,7 +70,7 @@ TimelineDialog::sequence_video_toggled () if (!film) { return; } - + film->set_sequence_video (_sequence_video->GetValue ()); } diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h index 0ee345154..b760c2c5b 100644 --- a/src/wx/timeline_dialog.h +++ b/src/wx/timeline_dialog.h @@ -33,7 +33,7 @@ private: void snap_toggled (); void sequence_video_toggled (); void film_changed (Film::Property); - + boost::weak_ptr<Film> _film; Timeline _timeline; wxCheckBox* _snap; diff --git a/src/wx/timeline_subtitle_content_view.cc b/src/wx/timeline_subtitle_content_view.cc index 407997b0f..3d1766391 100644 --- a/src/wx/timeline_subtitle_content_view.cc +++ b/src/wx/timeline_subtitle_content_view.cc @@ -42,7 +42,7 @@ TimelineSubtitleContentView::background_colour () const if (!sc || !sc->use_subtitles ()) { return wxColour (210, 210, 210, 128); } - + return wxColour (163, 255, 154, 255); } @@ -53,6 +53,6 @@ TimelineSubtitleContentView::foreground_colour () const if (!sc || !sc->use_subtitles ()) { return wxColour (180, 180, 180, 128); } - + return wxColour (0, 0, 0, 255); } diff --git a/src/wx/timeline_time_axis_view.cc b/src/wx/timeline_time_axis_view.cc index 88236c64f..7882c1231 100644 --- a/src/wx/timeline_time_axis_view.cc +++ b/src/wx/timeline_time_axis_view.cc @@ -28,7 +28,7 @@ TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y) { } - + dcpomatic::Rect<int> TimelineTimeAxisView::bbox () const { @@ -48,11 +48,11 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc) if (!_timeline.pixels_per_second()) { return; } - + double const pps = _timeline.pixels_per_second().get (); - + gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 1, wxPENSTYLE_SOLID)); - + double mark_interval = rint (128 / pps); if (mark_interval > 5) { mark_interval -= int (rint (mark_interval)) % 5; @@ -66,18 +66,18 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc) if (mark_interval > 3600) { mark_interval -= int (rint (mark_interval)) % 3600; } - + if (mark_interval < 1) { mark_interval = 1; } - + wxGraphicsPath path = gc->CreatePath (); path.MoveToPoint (_timeline.x_offset(), _y); path.AddLineToPoint (_timeline.width(), _y); gc->StrokePath (path); - + gc->SetFont (gc->CreateFont (*wxNORMAL_FONT)); - + /* Time in seconds */ DCPTime t; while ((t.seconds() * pps) < _timeline.width()) { @@ -85,26 +85,26 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc) path.MoveToPoint (time_x (t), _y - 4); path.AddLineToPoint (time_x (t), _y + 4); gc->StrokePath (path); - + double tc = t.seconds (); int const h = tc / 3600; tc -= h * 3600; int const m = tc / 60; tc -= m * 60; int const s = tc; - + wxString str = wxString::Format (wxT ("%02d:%02d:%02d"), h, m, s); wxDouble str_width; wxDouble str_height; wxDouble str_descent; wxDouble str_leading; gc->GetTextExtent (str, &str_width, &str_height, &str_descent, &str_leading); - + int const tx = _timeline.x_offset() + t.seconds() * pps; if ((tx + str_width) < _timeline.width()) { gc->DrawText (str, time_x (t), _y + 16); } - + t += DCPTime::from_seconds (mark_interval); } } diff --git a/src/wx/timeline_time_axis_view.h b/src/wx/timeline_time_axis_view.h index 4b17c099d..f72acd4a7 100644 --- a/src/wx/timeline_time_axis_view.h +++ b/src/wx/timeline_time_axis_view.h @@ -27,7 +27,7 @@ public: dcpomatic::Rect<int> bbox () const; void set_y (int y); -private: +private: void do_paint (wxGraphicsContext* gc); private: diff --git a/src/wx/timeline_video_content_view.h b/src/wx/timeline_video_content_view.h index 667c54485..3dd76140a 100644 --- a/src/wx/timeline_video_content_view.h +++ b/src/wx/timeline_video_content_view.h @@ -27,7 +27,7 @@ class TimelineVideoContentView : public TimelineContentView public: TimelineVideoContentView (Timeline& tl, boost::shared_ptr<Content> c); -private: +private: wxString type () const; wxColour background_colour () const; wxColour foreground_colour () const; diff --git a/src/wx/timeline_view.cc b/src/wx/timeline_view.cc index dbcbe0259..0d2fca381 100644 --- a/src/wx/timeline_view.cc +++ b/src/wx/timeline_view.cc @@ -26,7 +26,7 @@ TimelineView::TimelineView (Timeline& t) : _timeline (t) { - + } void diff --git a/src/wx/timeline_view.h b/src/wx/timeline_view.h index e52e28d47..55fd64d51 100644 --- a/src/wx/timeline_view.h +++ b/src/wx/timeline_view.h @@ -35,7 +35,7 @@ class TimelineView : public boost::noncopyable public: TimelineView (Timeline& t); virtual ~TimelineView () {} - + void paint (wxGraphicsContext* g); void force_redraw (); @@ -43,9 +43,9 @@ public: protected: virtual void do_paint (wxGraphicsContext *) = 0; - + int time_x (DCPTime t) const; - + Timeline& _timeline; private: diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 03189ecf5..4baafe9db 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -43,35 +43,35 @@ TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer) _sizer->Add (grid, 0, wxALL, 8); wxSize size = TimecodeBase::size (this); - + wxSizer* labels = new wxBoxSizer (wxHORIZONTAL); //// TRANSLATORS: this is an abbreviation for "hours" wxStaticText* t = new wxStaticText (this, wxID_ANY, _("h"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL); #ifdef DCPOMATIC_LINUX /* Hack to work around failure to centre text on GTK */ gtk_label_set_line_wrap (GTK_LABEL (t->GetHandle()), FALSE); -#endif +#endif labels->Add (t, 1, wxEXPAND); add_label_to_sizer (labels, this, wxT (":"), false); //// TRANSLATORS: this is an abbreviation for "minutes" t = new wxStaticText (this, wxID_ANY, _("m"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL); #ifdef DCPOMATIC_LINUX gtk_label_set_line_wrap (GTK_LABEL (t->GetHandle()), FALSE); -#endif +#endif labels->Add (t, 1, wxEXPAND); add_label_to_sizer (labels, this, wxT (":"), false); //// TRANSLATORS: this is an abbreviation for "seconds" t = new wxStaticText (this, wxID_ANY, _("s"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL); #ifdef DCPOMATIC_LINUX gtk_label_set_line_wrap (GTK_LABEL (t->GetHandle()), FALSE); -#endif +#endif labels->Add (t, 1, wxEXPAND); add_label_to_sizer (labels, this, wxT (":"), false); //// TRANSLATORS: this is an abbreviation for "frames" t = new wxStaticText (this, wxID_ANY, _("f"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL); #ifdef DCPOMATIC_LINUX gtk_label_set_line_wrap (GTK_LABEL (t->GetHandle()), FALSE); -#endif +#endif labels->Add (t, 1, wxEXPAND); grid->Add (new wxStaticText (this, wxID_ANY, wxT (""))); grid->Add (labels); @@ -128,7 +128,7 @@ TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer) ++current; } } - + t = new wxStaticText (this, wxID_ANY, wxT ("")); t->SetLabelMarkup (out); grid->Add (t, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 6); @@ -153,7 +153,7 @@ TimingPanel::update_full_length () for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) { check.insert ((*i)->full_length ()); } - + if (check.size() == 1) { _full_length->set (cl.front()->full_length (), _parent->film()->video_frame_rate ()); } else { @@ -170,7 +170,7 @@ TimingPanel::update_play_length () for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) { check.insert ((*i)->length_after_trim ()); } - + if (check.size() == 1) { _play_length->set (cl.front()->length_after_trim (), _parent->film()->video_frame_rate ()); } else { @@ -187,7 +187,7 @@ TimingPanel::film_content_changed (int property) /* Here we check to see if we have exactly one different value of various properties, and fill the controls with that value if so. */ - + if (property == ContentProperty::POSITION) { set<DCPTime> check; @@ -200,7 +200,7 @@ TimingPanel::film_content_changed (int property) } else { _position->clear (); } - + } else if ( property == ContentProperty::LENGTH || property == VideoContentProperty::VIDEO_FRAME_RATE || @@ -215,20 +215,20 @@ TimingPanel::film_content_changed (int property) for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) { check.insert ((*i)->trim_start ()); } - + if (check.size() == 1) { _trim_start->set (cl.front()->trim_start (), film_video_frame_rate); } else { _trim_start->clear (); } - + } else if (property == ContentProperty::TRIM_END) { set<DCPTime> check; for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) { check.insert ((*i)->trim_end ()); } - + if (check.size() == 1) { _trim_end->set (cl.front()->trim_end (), film_video_frame_rate); } else { @@ -359,7 +359,7 @@ TimingPanel::content_selection_changed () _trim_end->Enable (e); _play_length->Enable (e); _video_frame_rate->Enable (e); - + film_content_changed (ContentProperty::POSITION); film_content_changed (ContentProperty::LENGTH); film_content_changed (ContentProperty::TRIM_START); @@ -395,6 +395,6 @@ TimingPanel::trim_end_to_playhead_clicked () if (i->position() < ph && ph < i->end ()) { i->set_trim_end (i->position() + i->full_length() - i->trim_start() - ph); } - + } } diff --git a/src/wx/timing_panel.h b/src/wx/timing_panel.h index e300e4975..100945731 100644 --- a/src/wx/timing_panel.h +++ b/src/wx/timing_panel.h @@ -30,7 +30,7 @@ public: void film_changed (Film::Property); void film_content_changed (int); void content_selection_changed (); - + private: void position_changed (); void full_length_changed (); @@ -45,7 +45,7 @@ private: void update_play_length (); FilmViewer* _viewer; - + Timecode<DCPTime>* _position; Timecode<DCPTime>* _full_length; Timecode<DCPTime>* _trim_start; diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc index c8c90d86e..e0c08ef15 100644 --- a/src/wx/update_dialog.cc +++ b/src/wx/update_dialog.cc @@ -46,19 +46,19 @@ UpdateDialog::UpdateDialog (wxWindow* parent, optional<string> stable, optional< wxHyperlinkCtrl* h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/download", "http://dcpomatic.com/download"); table->Add (h); } - + if (test) { add_label_to_sizer (table, this, _("Test version ") + std_to_wx (test.get ()), true); wxHyperlinkCtrl* h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/test-download", "http://dcpomatic.com/test-download"); table->Add (h); } - + overall_sizer->Add (table, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateButtonSizer (wxOK); if (buttons) { overall_sizer->Add (buttons, 1, wxEXPAND | wxALL); } - + SetSizerAndFit (overall_sizer); } diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 0cef2504f..a0775023c 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -114,7 +114,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _right_crop->add (crop, wxGBPosition (cr, 3)); ++cr; - + add_label_to_grid_bag_sizer (crop, this, _("Top"), true, wxGBPosition (cr, 0)); _top_crop = new ContentSpinCtrl<VideoContent> ( this, @@ -147,7 +147,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _fade_out = new Timecode<ContentTime> (this); grid->Add (_fade_out, wxGBPosition (r, 1), wxGBSpan (1, 3)); ++r; - + add_label_to_grid_bag_sizer (grid, this, _("Scale to"), true, wxGBPosition (r, 0)); _scale = new ContentChoice<VideoContent, VideoContentScale> ( this, @@ -189,10 +189,10 @@ VideoPanel::VideoPanel (ContentPanel* p) } _colour_conversion->Append (_("Custom")); s->Add (_colour_conversion, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6); - + _edit_colour_conversion_button = new wxButton (this, wxID_ANY, _("Edit...")); s->Add (_edit_colour_conversion_button, 0, wxALIGN_CENTER_VERTICAL); - + grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); } ++r; @@ -225,7 +225,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this)); _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this)); - + _filters_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_filters_clicked, this)); _colour_conversion->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&VideoPanel::colour_conversion_changed, this)); _edit_colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this)); @@ -255,7 +255,7 @@ VideoPanel::film_content_changed (int property) vcs = vc.front (); fcs = dynamic_pointer_cast<FFmpegContent> (vcs); } - + if (property == VideoContentProperty::VIDEO_FRAME_TYPE) { setup_description (); } else if (property == VideoContentProperty::VIDEO_CROP) { @@ -299,7 +299,7 @@ VideoPanel::film_content_changed (int property) for (VideoContentList::const_iterator i = vc.begin (); i != vc.end(); ++i) { check.insert ((*i)->fade_in ()); } - + if (check.size() == 1) { _fade_in->set (ContentTime::from_frames (vc.front()->fade_in (), vc.front()->video_frame_rate ()), vc.front()->video_frame_rate ()); } else { @@ -310,7 +310,7 @@ VideoPanel::film_content_changed (int property) for (VideoContentList::const_iterator i = vc.begin (); i != vc.end(); ++i) { check.insert ((*i)->fade_out ()); } - + if (check.size() == 1) { _fade_out->set (ContentTime::from_frames (vc.front()->fade_out (), vc.front()->video_frame_rate ()), vc.front()->video_frame_rate ()); } else { @@ -397,7 +397,7 @@ VideoPanel::content_selection_changed () { VideoContentList video_sel = _parent->selected_video (); FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg (); - + bool const single = video_sel.size() == 1; _frame_type->set_content (video_sel); diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 218b24b02..c05a271f7 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -52,7 +52,7 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, bool, int prop) flags |= wxALIGN_RIGHT; t += wxT (":"); } -#endif +#endif wxStaticText* m = new wxStaticText (p, wxID_ANY, t); s->Add (m, prop, flags, 6); return m; @@ -71,7 +71,7 @@ add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool, w flags |= wxALIGN_RIGHT; t += wxT (":"); } -#endif +#endif wxStaticText* m = new wxStaticText (p, wxID_ANY, t); s->Add (m, pos, span, flags); return m; @@ -97,7 +97,7 @@ confirm_dialog (wxWindow* parent, wxString m) d->Destroy (); return r == wxID_YES; } - + /** @param s wxWidgets string. * @return Corresponding STL string. @@ -169,7 +169,7 @@ checked_set (wxChoice* widget, string value) if (widget->GetSelection() != -1) { 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) { @@ -269,7 +269,7 @@ dcpomatic_setup_i18n () #ifdef DCPOMATIC_WINDOWS locale->AddCatalogLookupPathPrefix (std_to_wx (mo_path().string())); -#endif +#endif #ifdef DCPOMATIC_LINUX locale->AddCatalogLookupPathPrefix (LINUX_LOCALE_PREFIX); @@ -279,11 +279,11 @@ dcpomatic_setup_i18n () of wxWidgets. */ locale->AddCatalog (wxT ("dcpomatic2-wxstd")); -#endif - +#endif + locale->AddCatalog (wxT ("libdcpomatic2-wx")); locale->AddCatalog (wxT ("dcpomatic2")); - + if (!locale->IsOk()) { delete locale; locale = new wxLocale (wxLANGUAGE_ENGLISH); |
