void
Film::make_dcp (bool transcode, int freq)
{
- string const t = name ();
- if (t.find ("/") != string::npos) {
+ if (dcp_name().find ("/") != string::npos) {
throw BadSettingError ("name", "cannot contain slashes");
}
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)
{
return _state.name;
}
+ /** @return name to give the DCP */
+ std::string dcp_name () const {
+ return _state.dcp_name ();
+ }
+
bool use_dci_name () const {
return _state.use_dci_name;
}
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);
return _state.has_subtitles;
}
- std::string dci_name_prefix () const {
- return _state.dci_name_prefix;
- }
-
std::string audio_language () const {
return _state.audio_language;
}
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";
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") {
FilmState::dci_name () const
{
stringstream d;
- d << dci_name_prefix << "_";
+
+ d << name << "_";
if (dcp_content_type) {
d << dcp_content_type->dci_name() << "_";
return d.str ();
}
+
+/** @return name to give the DCP */
+string
+FilmState::dcp_name () const
+{
+ if (use_dci_name) {
+ return dci_name ();
+ }
+
+ return name;
+}
+
+
int dcp_length () const;
std::string dci_name () const;
+ std::string dcp_name () const;
+
/** Complete path to directory containing the film metadata;
must not be relative.
*/
float subtitle_scale;
/* DCI naming stuff */
- std::string dci_name_prefix;
std::string audio_language;
std::string subtitle_language;
std::string territory;
void
MakeDCPJob::run ()
{
- string const dcp_path = _fs->dir (_fs->name);
+ string const dcp_path = _fs->dir (_fs->dcp_name());
/* Remove any old DCP */
filesystem::remove_all (dcp_path);
break;
}
- libdcp::DCP dcp (_fs->dir (_fs->name));
+ libdcp::DCP dcp (_fs->dir (_fs->dcp_name()));
dcp.Progress.connect (sigc::mem_fun (*this, &MakeDCPJob::dcp_progress));
- shared_ptr<libdcp::CPL> cpl (new libdcp::CPL (_fs->dir (_fs->name), _fs->name, _fs->dcp_content_type->libdcp_kind (), frames, rint (_fs->frames_per_second)));
+ shared_ptr<libdcp::CPL> cpl (new libdcp::CPL (_fs->dir (_fs->dcp_name()), _fs->dcp_name(), _fs->dcp_content_type->libdcp_kind (), frames, rint (_fs->frames_per_second)));
dcp.add_cpl (cpl);
descend (0.9);
shared_ptr<libdcp::MonoPictureAsset> pa (
new libdcp::MonoPictureAsset (
sigc::mem_fun (*this, &MakeDCPJob::j2c_path),
- _fs->dir (_fs->name),
+ _fs->dir (_fs->dcp_name()),
"video.mxf",
&dcp.Progress,
rint (_fs->frames_per_second),
sa.reset (
new libdcp::SoundAsset (
sigc::mem_fun (*this, &MakeDCPJob::wav_path),
- _fs->dir (_fs->name),
+ _fs->dir (_fs->dcp_name()),
"audio.mxf",
&dcp.Progress,
rint (_fs->frames_per_second),
throw NetworkError (String::compose ("Could not start SCP session (%1)", ssh_get_error (ss.session)));
}
- r = ssh_scp_push_directory (sc.scp, _fs->name.c_str(), S_IRWXU);
+ r = ssh_scp_push_directory (sc.scp, _fs->dcp_name().c_str(), S_IRWXU);
if (r != SSH_OK) {
- throw NetworkError (String::compose ("Could not create remote directory %1 (%2)", _fs->name, ssh_get_error (ss.session)));
+ throw NetworkError (String::compose ("Could not create remote directory %1 (%2)", _fs->dcp_name(), ssh_get_error (ss.session)));
}
- string const dcp_dir = _fs->dir (_fs->name);
+ string const dcp_dir = _fs->dir (_fs->dcp_name());
boost::uintmax_t bytes_to_transfer = 0;
for (filesystem::directory_iterator i = filesystem::directory_iterator (dcp_dir); i != filesystem::directory_iterator(); ++i) {
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);
_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 ()));
_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);
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 &)
{
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 facility_changed (wxCommandEvent &);
void package_type_changed (wxCommandEvent &);
- wxTextCtrl* _dci_name_prefix;
wxTextCtrl* _audio_language;
wxTextCtrl* _subtitle_language;
wxTextCtrl* _territory;