return sub;
}
+
+void
+Film::set_dci_name_prefix (string v)
+{
+ _state.dci_name_prefix = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_audio_language (string v)
+{
+ _state.audio_language = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_subtitle_language (string v)
+{
+ _state.subtitle_language = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_territory (string v)
+{
+ _state.territory = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_rating (string v)
+{
+ _state.rating = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_studio (string v)
+{
+ _state.studio = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_facility (string v)
+{
+ _state.facility = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_package_type (string v)
+{
+ _state.package_type = v;
+ signal_changed (DCI_METADATA);
+}
+
+void
+Film::set_use_dci_name (bool v)
+{
+ _state.use_dci_name = v;
+ signal_changed (USE_DCI_NAME);
+}
return _state.name;
}
+ bool use_dci_name () const {
+ return _state.use_dci_name;
+ }
+
/** @return number of pixels to crop from the sides of the original picture */
Crop crop () const {
return _state.crop;
void set_dcp_ab (bool);
void set_name (std::string);
+ void set_use_dci_name (bool);
void set_content (std::string);
void set_top_crop (int);
void set_bottom_crop (int);
void set_with_subtitles (bool);
void set_subtitle_offset (int);
void set_subtitle_scale (float);
+ void set_dci_name_prefix (std::string);
+ void set_audio_language (std::string);
+ void set_subtitle_language (std::string);
+ void set_territory (std::string);
+ void set_rating (std::string);
+ void set_studio (std::string);
+ void set_facility (std::string);
+ void set_package_type (std::string);
/** @return size, in pixels, of the source (ignoring cropping) */
Size size () const {
bool has_subtitles () const {
return _state.has_subtitles;
}
+
+ std::string dci_name_prefix () const {
+ return _state.dci_name_prefix;
+ }
+
+ std::string audio_language () const {
+ return _state.audio_language;
+ }
+
+ std::string subtitle_language () const {
+ return _state.subtitle_language;
+ }
+ std::string territory () const {
+ return _state.territory;
+ }
+
+ std::string rating () const {
+ return _state.rating;
+ }
+
+ std::string studio () const {
+ return _state.studio;
+ }
+
+ std::string facility () const {
+ return _state.facility;
+ }
+
+ std::string package_type () const {
+ return _state.package_type;
+ }
+
std::string j2k_dir () const;
std::vector<std::string> audio_files () const;
STILL_DURATION,
WITH_SUBTITLES,
SUBTITLE_OFFSET,
- SUBTITLE_SCALE
+ SUBTITLE_SCALE,
+ USE_DCI_NAME,
+ DCI_METADATA
};
boost::shared_ptr<FilmState> state_copy () const;
{
/* User stuff */
f << "name " << name << "\n";
+ f << "use_dci_name " << use_dci_name << "\n";
f << "content " << content << "\n";
if (dcp_content_type) {
f << "dcp_content_type " << dcp_content_type->pretty_name () << "\n";
f << "audio_sample_format " << audio_sample_format_to_string (audio_sample_format) << "\n";
f << "content_digest " << content_digest << "\n";
f << "has_subtitles " << has_subtitles << "\n";
+ f << "dci_name_prefix " << dci_name_prefix << "\n";
+ f << "audio_language " << audio_language << "\n";
+ f << "subtitle_language " << subtitle_language << "\n";
+ f << "territory " << territory << "\n";
+ f << "rating " << rating << "\n";
+ f << "studio " << studio << "\n";
+ f << "facility " << facility << "\n";
+ f << "package_type " << package_type << "\n";
}
/** Read state from a key / value pair.
/* User-specified stuff */
if (k == "name") {
name = v;
+ } else if (k == "use_dci_name") {
+ use_dci_name = (v == "1");
} else if (k == "content") {
content = v;
} else if (k == "dcp_content_type") {
content_digest = v;
} else if (k == "has_subtitles") {
has_subtitles = (v == "1");
+ } else if (k == "dci_name_prefix") {
+ dci_name_prefix = v;
+ } else if (k == "audio_language") {
+ audio_language = v;
+ } else if (k == "subtitle_language") {
+ subtitle_language = v;
+ } else if (k == "territory") {
+ territory = v;
+ } else if (k == "rating") {
+ rating = v;
+ } else if (k == "studio") {
+ studio = v;
+ } else if (k == "facility") {
+ facility = v;
+ } else if (k == "package_type") {
+ package_type = v;
}
}
{
public:
FilmState ()
- : dcp_content_type (0)
+ : use_dci_name (false)
+ , dcp_content_type (0)
, frames_per_second (0)
, format (0)
, scaler (Scaler::from_id ("bicubic"))
std::string directory;
/** Name for DVD-o-matic */
std::string name;
+ bool use_dci_name;
/** File or directory containing content; may be relative to our directory
* or an absolute path.
*/
--- /dev/null
+/*
+ Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+ 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 <wx/sizer.h>
+#include "dci_name_dialog.h"
+#include "wx_util.h"
+#include "film.h"
+
+DCINameDialog::DCINameDialog (wxWindow* parent, Film* film)
+ : wxDialog (parent, wxID_ANY, _("DCI name"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+ , _film (film)
+{
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ table->AddGrowableCol (1, 1);
+
+ add_label_to_sizer (table, this, "Short Name (e.g. BLUES-BROS)");
+ _dci_name_prefix = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_dci_name_prefix, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Audio Language (e.g. EN)");
+ _audio_language = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_audio_language, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Subtitle Language (e.g. FR)");
+ _subtitle_language = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_subtitle_language, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Territory (e.g. UK)");
+ _territory = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_territory, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Rating (e.g. 15");
+ _rating = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_rating, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Studio (e.g. TCF)");
+ _studio = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_studio, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Facility (e.g. DLA)");
+ _facility = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_facility, 1, wxEXPAND);
+
+ add_label_to_sizer (table, this, "Package Type (e.g. OV");
+ _package_type = new wxTextCtrl (this, wxID_ANY);
+ table->Add (_package_type, 1, wxEXPAND);
+
+ _dci_name_prefix->SetValue (std_to_wx (_film->dci_name_prefix ()));
+ _audio_language->SetValue (std_to_wx (_film->audio_language ()));
+ _subtitle_language->SetValue (std_to_wx (_film->subtitle_language ()));
+ _territory->SetValue (std_to_wx (_film->territory ()));
+ _rating->SetValue (std_to_wx (_film->rating ()));
+ _studio->SetValue (std_to_wx (_film->studio ()));
+ _facility->SetValue (std_to_wx (_film->facility ()));
+ _package_type->SetValue (std_to_wx (_film->package_type ()));
+
+ _dci_name_prefix->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::dci_name_prefix_changed), 0, this);
+ _audio_language->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::audio_language_changed), 0, this);
+ _subtitle_language->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::subtitle_language_changed), 0, this);
+ _territory->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::territory_changed), 0, this);
+ _rating->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::rating_changed), 0, this);
+ _studio->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::studio_changed), 0, this);
+ _facility->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::facility_changed), 0, this);
+ _package_type->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (DCINameDialog::package_type_changed), 0, this);
+
+ wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+ overall_sizer->Add (table, 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);
+}
+
+void
+DCINameDialog::dci_name_prefix_changed (wxCommandEvent &)
+{
+ _film->set_dci_name_prefix (wx_to_std (_dci_name_prefix->GetValue ()));
+}
+
+void
+DCINameDialog::audio_language_changed (wxCommandEvent &)
+{
+ _film->set_audio_language (wx_to_std (_audio_language->GetValue ()));
+}
+
+void
+DCINameDialog::subtitle_language_changed (wxCommandEvent &)
+{
+ _film->set_subtitle_language (wx_to_std (_subtitle_language->GetValue ()));
+}
+
+void
+DCINameDialog::territory_changed (wxCommandEvent &)
+{
+ _film->set_territory (wx_to_std (_territory->GetValue ()));
+}
+
+void
+DCINameDialog::rating_changed (wxCommandEvent &)
+{
+ _film->set_rating (wx_to_std (_rating->GetValue ()));
+}
+
+void
+DCINameDialog::studio_changed (wxCommandEvent &)
+{
+ _film->set_studio (wx_to_std (_studio->GetValue ()));
+}
+
+void
+DCINameDialog::facility_changed (wxCommandEvent &)
+{
+ _film->set_facility (wx_to_std (_facility->GetValue ()));
+}
+
+void
+DCINameDialog::package_type_changed (wxCommandEvent &)
+{
+ _film->set_package_type (wx_to_std (_package_type->GetValue ()));
+}
--- /dev/null
+/*
+ Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+ 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 <wx/dialog.h>
+#include <wx/textctrl.h>
+
+class Film;
+
+class DCINameDialog : public wxDialog
+{
+public:
+ DCINameDialog (wxWindow *, Film *);
+
+private:
+ void dci_name_prefix_changed (wxCommandEvent &);
+ void audio_language_changed (wxCommandEvent &);
+ void subtitle_language_changed (wxCommandEvent &);
+ void territory_changed (wxCommandEvent &);
+ void rating_changed (wxCommandEvent &);
+ void studio_changed (wxCommandEvent &);
+ void facility_changed (wxCommandEvent &);
+ void package_type_changed (wxCommandEvent &);
+
+ wxTextCtrl* _dci_name_prefix;
+ wxTextCtrl* _audio_language;
+ wxTextCtrl* _subtitle_language;
+ wxTextCtrl* _territory;
+ wxTextCtrl* _rating;
+ wxTextCtrl* _studio;
+ wxTextCtrl* _facility;
+ wxTextCtrl* _package_type;
+
+ Film* _film;
+};
#include "dcp_range_dialog.h"
#include "gain_calculator_dialog.h"
#include "sound_processor.h"
+#include "dci_name_dialog.h"
using namespace std;
using namespace boost;
/* Now connect to them, since initial values are safely set */
_name->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (FilmEditor::name_changed), 0, this);
+ _use_dci_name->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::use_dci_name_toggled), 0, this);
+ _edit_dci_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_dci_button_clicked), 0, this);
_format->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this);
_content->Connect (wxID_ANY, wxEVT_COMMAND_FILEPICKER_CHANGED, wxCommandEventHandler (FilmEditor::content_changed), 0, this);
_left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this);
case Film::SUBTITLE_SCALE:
_subtitle_scale->SetValue (_film->subtitle_scale() * 100);
break;
+ case Film::USE_DCI_NAME:
+ _use_dci_name->SetValue (_film->use_dci_name ());
+ break;
+ case Film::DCI_METADATA:
+ _name->SetValue (std_to_wx (_film->state_copy()->dci_name()));
+ break;
}
}
film_changed (Film::WITH_SUBTITLES);
film_changed (Film::SUBTITLE_OFFSET);
film_changed (Film::SUBTITLE_SCALE);
+ film_changed (Film::USE_DCI_NAME);
+ film_changed (Film::DCI_METADATA);
}
/** Updates the sensitivity of lots of widgets to a given value.
FilmEditor::set_things_sensitive (bool s)
{
_name->Enable (s);
+ _use_dci_name->Enable (s);
+ _edit_dci_button->Enable (s);
_frames_per_second->Enable (s);
_format->Enable (s);
_content->Enable (s);
}
}
+void
+FilmEditor::use_dci_name_toggled (wxCommandEvent &)
+{
+ if (!_film) {
+ return;
+ }
+
+ _ignore_changes = Film::USE_DCI_NAME;
+ _film->set_use_dci_name (_use_dci_name->GetValue ());
+ _ignore_changes = Film::NONE;
+}
+
+void
+FilmEditor::edit_dci_button_clicked (wxCommandEvent &)
+{
+ if (!_film) {
+ return;
+ }
+
+ DCINameDialog* d = new DCINameDialog (this, _film);
+ d->ShowModal ();
+ d->Destroy ();
+}
private:
/* Handle changes to the view */
void name_changed (wxCommandEvent &);
+ void use_dci_name_toggled (wxCommandEvent &);
+ void edit_dci_button_clicked (wxCommandEvent &);
void left_crop_changed (wxCommandEvent &);
void right_crop_changed (wxCommandEvent &);
void top_crop_changed (wxCommandEvent &);
obj.uselib = 'WXWIDGETS'
obj.use = 'libdvdomatic'
obj.source = """
+ config_dialog.cc
+ dci_name_dialog.cc
+ dcp_range_dialog.cc
+ dir_picker_ctrl.cc
film_editor.cc
- wx_util.cc
film_viewer.cc
- job_manager_view.cc
- job_wrapper.cc
- gain_calculator_dialog.cc
- config_dialog.cc
filter_dialog.cc
filter_view.cc
- dcp_range_dialog.cc
- server_dialog.cc
+ gain_calculator_dialog.cc
+ job_manager_view.cc
+ job_wrapper.cc
new_film_dialog.cc
- dir_picker_ctrl.cc
properties_dialog.cc
+ server_dialog.cc
+ wx_util.cc
"""
# alignment.cc