From bd453939da140ea994282e1c167ea5f8d02e2d94 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 19 Jul 2013 16:08:29 +0100 Subject: Spacing tweaks; rename ImageMagick -> StillImage. --- src/wx/config_dialog.cc | 2 +- src/wx/dci_metadata_dialog.cc | 2 +- src/wx/film_editor.cc | 10 +++--- src/wx/film_viewer.cc | 2 +- src/wx/gain_calculator_dialog.cc | 2 +- src/wx/imagemagick_content_dialog.cc | 70 ------------------------------------ src/wx/imagemagick_content_dialog.h | 36 ------------------- src/wx/new_film_dialog.cc | 2 +- src/wx/properties_dialog.cc | 2 +- src/wx/repeat_dialog.cc | 2 +- src/wx/still_image_content_dialog.cc | 70 ++++++++++++++++++++++++++++++++++++ src/wx/still_image_content_dialog.h | 36 +++++++++++++++++++ src/wx/wscript | 2 +- src/wx/wx_util.h | 1 + 14 files changed, 120 insertions(+), 119 deletions(-) delete mode 100644 src/wx/imagemagick_content_dialog.cc delete mode 100644 src/wx/imagemagick_content_dialog.h create mode 100644 src/wx/still_image_content_dialog.cc create mode 100644 src/wx/still_image_content_dialog.h (limited to 'src/wx') diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 8fc68f06a..7ab23c997 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -59,7 +59,7 @@ ConfigDialog::ConfigDialog (wxWindow* parent) _notebook->AddPage (_tms_panel, _("TMS"), false); wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (s, 1, wxEXPAND | wxALL, 6); + overall_sizer->Add (s, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); if (buttons) { diff --git a/src/wx/dci_metadata_dialog.cc b/src/wx/dci_metadata_dialog.cc index a5ddca44b..2862228e4 100644 --- a/src/wx/dci_metadata_dialog.cc +++ b/src/wx/dci_metadata_dialog.cc @@ -68,7 +68,7 @@ DCIMetadataDialog::DCIMetadataDialog (wxWindow* parent, DCIMetadata dm) _package_type->SetValue (std_to_wx (dm.package_type)); wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6); + overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); if (buttons) { diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index bfef303a8..fe332e335 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -36,7 +36,7 @@ #include "lib/filter.h" #include "lib/ratio.h" #include "lib/config.h" -#include "lib/imagemagick_content.h" +#include "lib/still_image_content.h" #include "lib/sndfile_content.h" #include "lib/dcp_content_type.h" #include "lib/sound_processor.h" @@ -48,7 +48,7 @@ #include "gain_calculator_dialog.h" #include "dci_metadata_dialog.h" #include "audio_dialog.h" -#include "imagemagick_content_dialog.h" +#include "still_image_content_dialog.h" #include "timeline_dialog.h" #include "audio_mapping_view.h" @@ -1166,8 +1166,8 @@ FilmEditor::content_add_clicked (wxCommandEvent &) shared_ptr c; - if (ImageMagickContent::valid_file (p)) { - c.reset (new ImageMagickContent (_film, p)); + if (StillImageContent::valid_file (p)) { + c.reset (new StillImageContent (_film, p)); } else if (SndfileContent::valid_file (p)) { c.reset (new SndfileContent (_film, p)); } else { @@ -1457,7 +1457,7 @@ FilmEditor::length_changed () return; } - shared_ptr ic = dynamic_pointer_cast (c); + shared_ptr ic = dynamic_pointer_cast (c); if (ic) { ic->set_video_length (_length->get(_film->dcp_video_frame_rate()) * ic->video_frame_rate() / TIME_HZ); } diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index fffb64796..9d7225416 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -36,7 +36,7 @@ #include "lib/player.h" #include "lib/video_content.h" #include "lib/ffmpeg_content.h" -#include "lib/imagemagick_content.h" +#include "lib/still_image_content.h" #include "lib/video_decoder.h" #include "film_viewer.h" #include "wx_util.h" diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc index 17ebbb983..f9880c044 100644 --- a/src/wx/gain_calculator_dialog.cc +++ b/src/wx/gain_calculator_dialog.cc @@ -38,7 +38,7 @@ GainCalculatorDialog::GainCalculatorDialog (wxWindow* parent) table->Add (_actual, 1, wxEXPAND); wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6); + overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); if (buttons) { diff --git a/src/wx/imagemagick_content_dialog.cc b/src/wx/imagemagick_content_dialog.cc deleted file mode 100644 index 6aa756260..000000000 --- a/src/wx/imagemagick_content_dialog.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include "lib/imagemagick_content.h" -#include "imagemagick_content_dialog.h" -#include "wx_util.h" - -using boost::shared_ptr; -using boost::dynamic_pointer_cast; - -ImageMagickContentDialog::ImageMagickContentDialog (wxWindow* parent, shared_ptr content) - : wxDialog (parent, wxID_ANY, _("Image")) - , _content (content) -{ - wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); - grid->AddGrowableCol (1, 1); - - { - add_label_to_sizer (grid, this, _("Duration"), true); - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _video_length = new wxSpinCtrl (this); - s->Add (_video_length); - /// TRANSLATORS: this is an abbreviation for seconds, the unit of time - add_label_to_sizer (s, this, _("s"), false); - grid->Add (s); - } - - wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6); - - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); - if (buttons) { - overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer (overall_sizer); - overall_sizer->Layout (); - overall_sizer->SetSizeHints (this); - - checked_set (_video_length, content->video_length () / 24); - _video_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ImageMagickContentDialog::video_length_changed), 0, this); -} - -void -ImageMagickContentDialog::video_length_changed (wxCommandEvent &) -{ - shared_ptr c = _content.lock (); - if (!c) { - return; - } - - c->set_video_length (_video_length->GetValue() * 24); -} diff --git a/src/wx/imagemagick_content_dialog.h b/src/wx/imagemagick_content_dialog.h deleted file mode 100644 index 23722f183..000000000 --- a/src/wx/imagemagick_content_dialog.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include - -class wxSpinCtrl; -class ImageMagickContent; -class Region; - -class ImageMagickContentDialog : public wxDialog -{ -public: - ImageMagickContentDialog (wxWindow *, boost::shared_ptr); - -private: - void video_length_changed (wxCommandEvent &); - - boost::weak_ptr _content; - wxSpinCtrl* _video_length; -}; diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index d4b78d5bf..4b12c1714 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -39,7 +39,7 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); table->AddGrowableCol (1, 1); - overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6); + overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); add_label_to_sizer (table, this, _("Film name"), true); _name = new wxTextCtrl (this, wxID_ANY); diff --git a/src/wx/properties_dialog.cc b/src/wx/properties_dialog.cc index d525fe38b..a1ba81b3b 100644 --- a/src/wx/properties_dialog.cc +++ b/src/wx/properties_dialog.cc @@ -57,7 +57,7 @@ PropertiesDialog::PropertiesDialog (wxWindow* parent, shared_ptr film) _disk->SetLabel (std_to_wx (s.str ())); wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (table, 0, wxALL, 6); + overall_sizer->Add (table, 0, wxALL, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); if (buttons) { diff --git a/src/wx/repeat_dialog.cc b/src/wx/repeat_dialog.cc index 9eb02ba57..3721c61b9 100644 --- a/src/wx/repeat_dialog.cc +++ b/src/wx/repeat_dialog.cc @@ -28,7 +28,7 @@ RepeatDialog::RepeatDialog (wxWindow* parent) wxFlexGridSizer* table = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); table->AddGrowableCol (1, 1); - overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6); + overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); add_label_to_sizer (table, this, _("Repeat"), true); _number = new wxSpinCtrl (this, wxID_ANY); diff --git a/src/wx/still_image_content_dialog.cc b/src/wx/still_image_content_dialog.cc new file mode 100644 index 000000000..704205418 --- /dev/null +++ b/src/wx/still_image_content_dialog.cc @@ -0,0 +1,70 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include "lib/still_image_content.h" +#include "still_image_content_dialog.h" +#include "wx_util.h" + +using boost::shared_ptr; +using boost::dynamic_pointer_cast; + +StillImageContentDialog::StillImageContentDialog (wxWindow* parent, shared_ptr content) + : wxDialog (parent, wxID_ANY, _("Stlll Image")) + , _content (content) +{ + wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); + grid->AddGrowableCol (1, 1); + + { + add_label_to_sizer (grid, this, _("Duration"), true); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _video_length = new wxSpinCtrl (this); + s->Add (_video_length); + /// TRANSLATORS: this is an abbreviation for seconds, the unit of time + add_label_to_sizer (s, this, _("s"), false); + grid->Add (s); + } + + wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); + overall_sizer->Add (grid, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); + + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); + if (buttons) { + overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } + + SetSizer (overall_sizer); + overall_sizer->Layout (); + overall_sizer->SetSizeHints (this); + + checked_set (_video_length, content->video_length () / 24); + _video_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (StillImageContentDialog::video_length_changed), 0, this); +} + +void +StillImageContentDialog::video_length_changed (wxCommandEvent &) +{ + shared_ptr c = _content.lock (); + if (!c) { + return; + } + + c->set_video_length (_video_length->GetValue() * 24); +} diff --git a/src/wx/still_image_content_dialog.h b/src/wx/still_image_content_dialog.h new file mode 100644 index 000000000..b01d79b28 --- /dev/null +++ b/src/wx/still_image_content_dialog.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include + +class wxSpinCtrl; +class StillImageContent; +class Region; + +class StillImageContentDialog : public wxDialog +{ +public: + StillImageContentDialog (wxWindow *, boost::shared_ptr); + +private: + void video_length_changed (wxCommandEvent &); + + boost::weak_ptr _content; + wxSpinCtrl* _video_length; +}; diff --git a/src/wx/wscript b/src/wx/wscript index 3402d4b41..09ce0218d 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -16,7 +16,7 @@ sources = """ filter_dialog.cc filter_view.cc gain_calculator_dialog.cc - imagemagick_content_dialog.cc + still_image_content_dialog.cc job_manager_view.cc job_wrapper.cc new_film_dialog.cc diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index de6a09c35..d942d8fa8 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -34,6 +34,7 @@ class wxGridBagSizer; #define DCPOMATIC_SIZER_X_GAP 8 #define DCPOMATIC_SIZER_Y_GAP 8 +#define DCPOMATIC_DIALOG_BORDER 12 /** @file src/wx/wx_util.h * @brief Some utility functions and classes. -- cgit v1.2.3