+2013-01-25 Carl Hetherington <cth@carlh.net>
+
+ * When using formats which pad smaller frames into
+ larger ones, the padding black now shown in
+ the preview.
+
+ * Fix the old DCP content type being left behind
+ when creating a new film.
+
+ * Add option to specify default details
+ for the DCI name details dialog in new
+ Films (#42).
+
+2013-01-24 Carl Hetherington <cth@carlh.net>
+
+ * Version 0.72 released.
+
+2013-01-24 Carl Hetherington <cth@carlh.net>
+
+ * Version 0.71 released.
+
+2013-01-24 Carl Hetherington <cth@carlh.net>
+
+ * Fix lack of audio with trimmed DCPs.
+
2013-01-23 Carl Hetherington <cth@carlh.net>
* Remove multi-reel support (for now); needs more thinking about
-dvdomatic (0.71beta2-1) UNRELEASED; urgency=low
+dvdomatic (0.72-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Carl Hetherington <carl@houllier.lan> Thu, 24 Jan 2013 15:31:57 +0000
+
+dvdomatic (0.71-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Carl Hetherington <carl@houllier.lan> Thu, 24 Jan 2013 11:36:04 +0000
+
+dvdomatic (0.70-1) UNRELEASED; urgency=low
* New upstream release.
* New upstream release.
} else if (k == "sound_processor") {
_sound_processor = SoundProcessor::from_id (v);
}
+
+ _default_dci_metadata.read (k, v);
}
}
f << "tms_path " << _tms_path << "\n";
f << "tms_user " << _tms_user << "\n";
f << "tms_password " << _tms_password << "\n";
- f << "sound_processor " << _sound_processor->id ();
+ f << "sound_processor " << _sound_processor->id () << "\n";
+
+ _default_dci_metadata.write (f);
}
string
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
+#include "dci_metadata.h"
class ServerDescription;
class Scaler;
return _allowed_dcp_frame_rates;
}
+ DCIMetadata default_dci_metadata () const {
+ return _default_dci_metadata;
+ }
+
/** @param n New number of local encoding threads */
void set_num_local_encoding_threads (int n) {
_num_local_encoding_threads = n;
_allowed_dcp_frame_rates = r;
}
+ void set_default_dci_metadata (DCIMetadata d) {
+ _default_dci_metadata = d;
+ }
+
void write () const;
static Config* instance ();
/** Our sound processor */
SoundProcessor const * _sound_processor;
std::list<int> _allowed_dcp_frame_rates;
+ /** Default DCI metadata for newly-created Films */
+ DCIMetadata _default_dci_metadata;
/** Singleton instance, or 0 */
static Config* _instance;
--- /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 <iostream>
+#include "dci_metadata.h"
+
+using namespace std;
+
+void
+DCIMetadata::write (ostream& f) const
+{
+ 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";
+}
+
+void
+DCIMetadata::read (string k, string v)
+{
+ 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;
+ }
+}
--- /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.
+
+*/
+
+#ifndef DVDOMATIC_DCI_METADATA_H
+#define DVDOMATIC_DCI_METADATA_H
+
+#include <string>
+
+class DCIMetadata
+{
+public:
+ void read (std::string, std::string);
+ void write (std::ostream &) const;
+
+ std::string audio_language;
+ std::string subtitle_language;
+ std::string territory;
+ std::string rating;
+ std::string studio;
+ std::string facility;
+ std::string package_type;
+};
+
+#endif
, _subtitle_scale (1)
, _colour_lut (0)
, _j2k_bandwidth (200000000)
+ , _dci_metadata (Config::instance()->default_dci_metadata ())
, _frames_per_second (0)
, _dirty (false)
{
, _subtitle_scale (o._subtitle_scale)
, _colour_lut (o._colour_lut)
, _j2k_bandwidth (o._j2k_bandwidth)
- , _audio_language (o._audio_language)
- , _subtitle_language (o._subtitle_language)
- , _territory (o._territory)
- , _rating (o._rating)
- , _studio (o._studio)
- , _facility (o._facility)
- , _package_type (o._package_type)
+ , _dci_metadata (o._dci_metadata)
, _size (o._size)
, _length (o._length)
, _dcp_intrinsic_duration (o._dcp_intrinsic_duration)
f << "subtitle_scale " << _subtitle_scale << "\n";
f << "colour_lut " << _colour_lut << "\n";
f << "j2k_bandwidth " << _j2k_bandwidth << "\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";
-
+ _dci_metadata.write (f);
f << "width " << _size.width << "\n";
f << "height " << _size.height << "\n";
f << "length " << _length.get_value_or(0) << "\n";
_colour_lut = atoi (v.c_str ());
} else if (k == "j2k_bandwidth") {
_j2k_bandwidth = atoi (v.c_str ());
- } 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;
}
+
+ _dci_metadata.read (k, v);
/* Cached stuff */
if (k == "width") {
d << format()->dci_name() << "_";
}
- if (!audio_language().empty ()) {
- d << audio_language();
- if (!subtitle_language().empty() && with_subtitles()) {
- d << "-" << subtitle_language();
+ DCIMetadata const dm = dci_metadata ();
+
+ if (!dm.audio_language.empty ()) {
+ d << dm.audio_language;
+ if (!dm.subtitle_language.empty() && with_subtitles()) {
+ d << "-" << dm.subtitle_language;
} else {
d << "-XX";
}
d << "_";
}
- if (!territory().empty ()) {
- d << territory();
- if (!rating().empty ()) {
- d << "-" << rating();
+ if (!dm.territory.empty ()) {
+ d << dm.territory;
+ if (!dm.rating.empty ()) {
+ d << "-" << dm.rating;
}
d << "_";
}
d << "2K_";
- if (!studio().empty ()) {
- d << studio() << "_";
+ if (!dm.studio.empty ()) {
+ d << dm.studio << "_";
}
d << boost::gregorian::to_iso_string (_dci_date) << "_";
- if (!facility().empty ()) {
- d << facility() << "_";
+ if (!dm.facility.empty ()) {
+ d << dm.facility << "_";
}
- if (!package_type().empty ()) {
- d << package_type();
+ if (!dm.package_type.empty ()) {
+ d << dm.package_type;
}
return d.str ();
}
void
-Film::set_audio_language (string l)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _audio_language = l;
- }
- signal_changed (DCI_METADATA);
-}
-
-void
-Film::set_subtitle_language (string l)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _subtitle_language = l;
- }
- signal_changed (DCI_METADATA);
-}
-
-void
-Film::set_territory (string t)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _territory = t;
- }
- signal_changed (DCI_METADATA);
-}
-
-void
-Film::set_rating (string r)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _rating = r;
- }
- signal_changed (DCI_METADATA);
-}
-
-void
-Film::set_studio (string s)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _studio = s;
- }
- signal_changed (DCI_METADATA);
-}
-
-void
-Film::set_facility (string f)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _facility = f;
- }
- signal_changed (DCI_METADATA);
-}
-
-void
-Film::set_package_type (string p)
+Film::set_dci_metadata (DCIMetadata m)
{
{
boost::mutex::scoped_lock lm (_state_mutex);
- _package_type = p;
+ _dci_metadata = m;
}
signal_changed (DCI_METADATA);
}
#include "dcp_content_type.h"
#include "util.h"
#include "stream.h"
+#include "dci_metadata.h"
class Format;
class Job;
return _j2k_bandwidth;
}
- std::string audio_language () const {
+ DCIMetadata dci_metadata () const {
boost::mutex::scoped_lock lm (_state_mutex);
- return _audio_language;
+ return _dci_metadata;
}
- std::string subtitle_language () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _subtitle_language;
- }
-
- std::string territory () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _territory;
- }
-
- std::string rating () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _rating;
- }
-
- std::string studio () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _studio;
- }
-
- std::string facility () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _facility;
- }
-
- std::string package_type () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _package_type;
- }
-
libdcp::Size size () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _size;
void set_subtitle_scale (float);
void set_colour_lut (int);
void set_j2k_bandwidth (int);
- 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);
+ void set_dci_metadata (DCIMetadata);
void set_size (libdcp::Size);
void set_length (SourceFrame);
void unset_length ();
int _colour_lut;
/** bandwidth for J2K files in bits per second */
int _j2k_bandwidth;
-
- /* DCI naming stuff */
- std::string _audio_language;
- std::string _subtitle_language;
- std::string _territory;
- std::string _rating;
- std::string _studio;
- std::string _facility;
- std::string _package_type;
+
+ /** DCI naming stuff */
+ DCIMetadata _dci_metadata;
/* Data which are cached to speed things up */
}
+/** @return Number of pixels (int the DCP image) to pad either side of the film
+ * (so there are dcp_padding() pixels on the left and dcp_padding() on the right)
+ */
int
Format::dcp_padding (shared_ptr<const Film> f) const
{
return p;
}
+float
+Format::container_ratio_as_float () const
+{
+ return static_cast<float> (_dcp_size.width) / _dcp_size.height;
+}
+
VariableFormat::VariableFormat (libdcp::Size dcp, string id, string n, string d)
: Format (dcp, id, n, d)
{
/** @return the ratio as a floating point number */
virtual float ratio_as_float (boost::shared_ptr<const Film> f) const = 0;
+ /** @return the ratio of the container (including any padding) as a floating point number */
+ float container_ratio_as_float () const;
+
int dcp_padding (boost::shared_ptr<const Film> f) const;
/** @return size in pixels of the images that we should
*/
TimedSubtitle::TimedSubtitle (AVSubtitle const & sub)
{
- assert (sub.rects > 0);
+ assert (sub.num_rects > 0);
/* Subtitle PTS in seconds (within the source, not taking into account any of the
source that we may have chopped off for the DCP)
obj.name = 'libdvdomatic'
obj.export_includes = ['.']
- obj.uselib = 'AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE SNDFILE BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 OPENJPEG POSTPROC TIFF MAGICK SSH DCP GLIB'
+ obj.uselib = 'AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE SNDFILE BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 OPENJPEG POSTPROC TIFF MAGICK SSH DCP GLIB LZMA'
if bld.env.TARGET_WINDOWS:
obj.uselib += ' WINSOCK2'
obj.source = """
config.cc
combiner.cc
cross.cc
+ dci_metadata.cc
dcp_content_type.cc
dcp_video_frame.cc
decoder.cc
#include "filter_dialog.h"
#include "server_dialog.h"
#include "dir_picker_ctrl.h"
+#include "dci_metadata_dialog.h"
using namespace std;
using boost::bind;
table->Add (_default_directory, 1, wxEXPAND);
table->AddSpacer (0);
+ add_label_to_sizer (table, this, "Default DCI name details");
+ _default_dci_metadata_button = new wxButton (this, wxID_ANY, _("Edit..."));
+ table->Add (_default_dci_metadata_button);
+ table->AddSpacer (1);
+
add_label_to_sizer (table, this, "Reference scaler for A/B");
- _reference_scaler = new wxComboBox (this, wxID_ANY);
+ _reference_scaler = new wxChoice (this, wxID_ANY);
vector<Scaler const *> const sc = Scaler::all ();
for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
_reference_scaler->Append (std_to_wx ((*i)->name ()));
_default_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()))));
_default_directory->Connect (wxID_ANY, wxEVT_COMMAND_DIRPICKER_CHANGED, wxCommandEventHandler (ConfigDialog::default_directory_changed), 0, this);
+ _default_dci_metadata_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::edit_default_dci_metadata_clicked), 0, this);
+
_reference_scaler->SetSelection (Scaler::as_index (config->reference_scaler ()));
- _reference_scaler->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::reference_scaler_changed), 0, this);
+ _reference_scaler->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::reference_scaler_changed), 0, this);
pair<string, string> p = Filter::ffmpeg_strings (config->reference_filters ());
_reference_filters->SetLabel (std_to_wx (p.first + " " + p.second));
pair<string, string> p = Filter::ffmpeg_strings (Config::instance()->reference_filters ());
_reference_filters->SetLabel (std_to_wx (p.first + " " + p.second));
}
+
+void
+ConfigDialog::edit_default_dci_metadata_clicked (wxCommandEvent &)
+{
+ DCIMetadataDialog* d = new DCIMetadataDialog (this, Config::instance()->default_dci_metadata ());
+ d->ShowModal ();
+ Config::instance()->set_default_dci_metadata (d->dci_metadata ());
+ d->Destroy ();
+}
void tms_password_changed (wxCommandEvent &);
void num_local_encoding_threads_changed (wxCommandEvent &);
void default_directory_changed (wxCommandEvent &);
+ void edit_default_dci_metadata_clicked (wxCommandEvent &);
void reference_scaler_changed (wxCommandEvent &);
void edit_reference_filters_clicked (wxCommandEvent &);
void reference_filters_changed (std::vector<Filter const *>);
DirPickerCtrl* _default_directory;
#else
wxDirPickerCtrl* _default_directory;
-#endif
- wxComboBox* _reference_scaler;
+#endif
+ wxButton* _default_dci_metadata_button;
+ wxChoice* _reference_scaler;
wxStaticText* _reference_filters;
wxButton* _reference_filters_button;
wxListCtrl* _servers;
--- /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_metadata_dialog.h"
+#include "wx_util.h"
+#include "film.h"
+
+using boost::shared_ptr;
+
+DCIMetadataDialog::DCIMetadataDialog (wxWindow* parent, DCIMetadata dm)
+ : wxDialog (parent, wxID_ANY, _("DCI name"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+{
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ table->AddGrowableCol (1, 1);
+
+ 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);
+
+ _audio_language->SetValue (std_to_wx (dm.audio_language));
+ _subtitle_language->SetValue (std_to_wx (dm.subtitle_language));
+ _territory->SetValue (std_to_wx (dm.territory));
+ _rating->SetValue (std_to_wx (dm.rating));
+ _studio->SetValue (std_to_wx (dm.studio));
+ _facility->SetValue (std_to_wx (dm.facility));
+ _package_type->SetValue (std_to_wx (dm.package_type));
+
+ 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);
+}
+
+DCIMetadata
+DCIMetadataDialog::dci_metadata () const
+{
+ DCIMetadata dm;
+
+ dm.audio_language = wx_to_std (_audio_language->GetValue ());
+ dm.subtitle_language = wx_to_std (_subtitle_language->GetValue ());
+ dm.territory = wx_to_std (_territory->GetValue ());
+ dm.rating = wx_to_std (_rating->GetValue ());
+ dm.studio = wx_to_std (_studio->GetValue ());
+ dm.facility = wx_to_std (_facility->GetValue ());
+ dm.package_type = wx_to_std (_package_type->GetValue ());
+
+ return dm;
+}
--- /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>
+#include <boost/shared_ptr.hpp>
+#include "dci_metadata.h"
+
+class Film;
+
+class DCIMetadataDialog : public wxDialog
+{
+public:
+ DCIMetadataDialog (wxWindow *, DCIMetadata);
+
+ DCIMetadata dci_metadata () const;
+
+private:
+ wxTextCtrl* _audio_language;
+ wxTextCtrl* _subtitle_language;
+ wxTextCtrl* _territory;
+ wxTextCtrl* _rating;
+ wxTextCtrl* _studio;
+ wxTextCtrl* _facility;
+ wxTextCtrl* _package_type;
+};
+++ /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"
-
-using boost::shared_ptr;
-
-DCINameDialog::DCINameDialog (wxWindow* parent, shared_ptr<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, "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);
-
- _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 ()));
-
- _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::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>
-#include <boost/shared_ptr.hpp>
-
-class Film;
-
-class DCINameDialog : public wxDialog
-{
-public:
- DCINameDialog (wxWindow *, boost::shared_ptr<Film>);
-
-private:
- 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* _audio_language;
- wxTextCtrl* _subtitle_language;
- wxTextCtrl* _territory;
- wxTextCtrl* _rating;
- wxTextCtrl* _studio;
- wxTextCtrl* _facility;
- wxTextCtrl* _package_type;
-
- boost::shared_ptr<Film> _film;
-};
#include "film_editor.h"
#include "gain_calculator_dialog.h"
#include "sound_processor.h"
-#include "dci_name_dialog.h"
+#include "dci_metadata_dialog.h"
#include "scaler.h"
using std::string;
_film_sizer->AddSpacer (0);
add_label_to_sizer (_film_sizer, _film_panel, "Content Type");
- _dcp_content_type = new wxComboBox (_film_panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY);
+ _dcp_content_type = new wxChoice (_film_panel, wxID_ANY);
_film_sizer->Add (_dcp_content_type);
video_control (add_label_to_sizer (_film_sizer, _film_panel, "Frames Per Second"));
_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);
+ _format->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this);
_content->Connect (wxID_ANY, wxEVT_COMMAND_FILEPICKER_CHANGED, wxCommandEventHandler (FilmEditor::content_changed), 0, this);
_trust_content_header->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::trust_content_header_changed), 0, this);
_left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this);
_top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::top_crop_changed), 0, this);
_bottom_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::bottom_crop_changed), 0, this);
_filters_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_filters_clicked), 0, this);
- _scaler->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::scaler_changed), 0, this);
- _dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this);
+ _scaler->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::scaler_changed), 0, this);
+ _dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this);
_dcp_ab->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::dcp_ab_toggled), 0, this);
_still_duration->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::still_duration_changed), 0, this);
_trim_start->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::trim_start_changed), 0, this);
_with_subtitles->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::with_subtitles_toggled), 0, this);
_subtitle_offset->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_offset_changed), 0, this);
_subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this);
- _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::colour_lut_changed), 0, this);
+ _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::colour_lut_changed), 0, this);
_j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this);
- _subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::subtitle_stream_changed), 0, this);
- _audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::audio_stream_changed), 0, this);
+ _subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::subtitle_stream_changed), 0, this);
+ _audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::audio_stream_changed), 0, this);
_audio_gain->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_gain_changed), 0, this);
_audio_gain_calculate_button->Connect (
wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::audio_gain_calculate_button_clicked), 0, this
_video_panel->SetSizer (pad);
add_label_to_sizer (_video_sizer, _video_panel, "Format");
- _format = new wxComboBox (_video_panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY);
+ _format = new wxChoice (_video_panel, wxID_ANY);
_video_sizer->Add (_format);
{
}
video_control (add_label_to_sizer (_video_sizer, _video_panel, "Scaler"));
- _scaler = new wxComboBox (_video_panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY);
+ _scaler = new wxChoice (_video_panel, wxID_ANY);
_video_sizer->Add (video_control (_scaler), 1);
vector<Scaler const *> const sc = Scaler::all ();
}
add_label_to_sizer (_video_sizer, _video_panel, "Colour look-up table");
- _colour_lut = new wxComboBox (_video_panel, wxID_ANY);
+ _colour_lut = new wxChoice (_video_panel, wxID_ANY);
for (int i = 0; i < 2; ++i) {
_colour_lut->Append (std_to_wx (colour_lut_index_to_name (i)));
}
_use_content_audio = new wxRadioButton (_audio_panel, wxID_ANY, _("Use content's audio"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
_audio_sizer->Add (video_control (_use_content_audio));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _audio_stream = new wxComboBox (_audio_panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY);
+ _audio_stream = new wxChoice (_audio_panel, wxID_ANY);
s->Add (video_control (_audio_stream), 1);
_audio = new wxStaticText (_audio_panel, wxID_ANY, wxT (""));
s->Add (video_control (_audio), 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8);
video_control (_with_subtitles);
_subtitle_sizer->Add (_with_subtitles, 1);
- _subtitle_stream = new wxComboBox (_subtitle_panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY);
+ _subtitle_stream = new wxChoice (_subtitle_panel, wxID_ANY);
_subtitle_sizer->Add (video_control (_subtitle_stream));
video_control (add_label_to_sizer (_subtitle_sizer, _subtitle_panel, "Subtitle Offset"));
return;
}
- DCINameDialog* d = new DCINameDialog (this, _film);
+ DCIMetadataDialog* d = new DCIMetadataDialog (this, _film->dci_metadata ());
d->ShowModal ();
+ _film->set_dci_metadata (d->dci_metadata ());
d->Destroy ();
}
if (_film->subtitle_stream()) {
checked_set (_subtitle_stream, _film->subtitle_stream()->to_string());
} else {
- _subtitle_stream->SetValue (wxT (""));
+ _subtitle_stream->SetSelection (wxNOT_FOUND);
}
}
wxCheckBox* _use_dci_name;
wxButton* _edit_dci_button;
/** The Film's format */
- wxComboBox* _format;
+ wxChoice* _format;
/** The Film's content file */
wxFilePickerCtrl* _content;
wxCheckBox* _trust_content_header;
/** Button to open the filters dialogue */
wxButton* _filters_button;
/** The Film's scaler */
- wxComboBox* _scaler;
+ wxChoice* _scaler;
wxRadioButton* _use_content_audio;
- wxComboBox* _audio_stream;
+ wxChoice* _audio_stream;
wxRadioButton* _use_external_audio;
wxFilePickerCtrl* _external_audio[MAX_AUDIO_CHANNELS];
/** The Film's audio gain */
/** The Film's audio delay */
wxSpinCtrl* _audio_delay;
wxCheckBox* _with_subtitles;
- wxComboBox* _subtitle_stream;
+ wxChoice* _subtitle_stream;
wxSpinCtrl* _subtitle_offset;
wxSpinCtrl* _subtitle_scale;
- wxComboBox* _colour_lut;
+ wxChoice* _colour_lut;
wxSpinCtrl* _j2k_bandwidth;
/** The Film's DCP content type */
- wxComboBox* _dcp_content_type;
+ wxChoice* _dcp_content_type;
/** The Film's frames per second */
wxStaticText* _frames_per_second;
/** The Film's original size */
, _panel (new wxPanel (this))
, _slider (new wxSlider (this, wxID_ANY, 0, 0, 4096))
, _play_button (new wxToggleButton (this, wxID_ANY, wxT ("Play")))
+ , _display_frame_x (0)
, _got_frame (false)
- , _out_width (0)
- , _out_height (0)
- , _panel_width (0)
- , _panel_height (0)
, _clear_required (false)
{
_panel->SetDoubleBuffered (true);
_clear_required = false;
}
- if (!_display_frame || !_film || !_out_width || !_out_height) {
+ if (!_display_frame || !_film || !_out_size.width || !_out_size.height) {
dc.Clear ();
return;
}
- wxImage frame (_out_width, _out_height, _display_frame->data()[0], true);
+ if (_display_frame_x) {
+ dc.SetPen(*wxBLACK_PEN);
+ dc.SetBrush(*wxBLACK_BRUSH);
+ dc.DrawRectangle (0, 0, _display_frame_x, _film_size.height);
+ dc.DrawRectangle (_display_frame_x + _film_size.width, 0, _display_frame_x * 2 + _film_size.width, _film_size.height);
+ }
+
+ wxImage frame (_film_size.width, _film_size.height, _display_frame->data()[0], true);
wxBitmap frame_bitmap (frame);
- dc.DrawBitmap (frame_bitmap, 0, 0);
+ dc.DrawBitmap (frame_bitmap, _display_frame_x, 0);
if (_film->with_subtitles() && _display_sub) {
wxImage sub (_display_sub->size().width, _display_sub->size().height, _display_sub->data()[0], _display_sub->alpha(), true);
void
FilmViewer::panel_sized (wxSizeEvent& ev)
{
- _panel_width = ev.GetSize().GetWidth();
- _panel_height = ev.GetSize().GetHeight();
+ _panel_size.width = ev.GetSize().GetWidth();
+ _panel_size.height = ev.GetSize().GetHeight();
calculate_sizes ();
update_from_raw ();
}
void
FilmViewer::raw_to_display ()
{
- if (!_raw_frame || _out_width < 64 || _out_height < 64 || !_film) {
+ if (!_raw_frame || _out_size.width < 64 || _out_size.height < 64 || !_film) {
return;
}
}
/* Get a compacted image as we have to feed it to wxWidgets */
- _display_frame = _raw_frame->scale_and_convert_to_rgb (libdcp::Size (_out_width, _out_height), 0, _film->scaler(), false);
+ _display_frame = _raw_frame->scale_and_convert_to_rgb (_film_size, 0, _film->scaler(), false);
if (old_size != _display_frame->size()) {
_clear_required = true;
if (_raw_sub) {
Rect tx = subtitle_transformed_area (
- float (_out_width) / _film->size().width,
- float (_out_height) / _film->size().height,
+ float (_film_size.width) / _film->size().width,
+ float (_film_size.height) / _film->size().height,
_raw_sub->area(), _film->subtitle_offset(), _film->subtitle_scale()
);
_display_sub.reset (new RGBPlusAlphaImage (_raw_sub->image()->scale (tx.size(), _film->scaler(), false)));
_display_sub_position = tx.position();
+ _display_sub_position.x += _display_frame_x;
} else {
_display_sub.reset ();
}
if (!_film) {
return;
}
+
+ Format const * format = _film->format ();
- float const panel_ratio = static_cast<float> (_panel_width) / _panel_height;
- float const film_ratio = _film->format() ? _film->format()->ratio_as_float(_film) : 1.78;
+ float const panel_ratio = static_cast<float> (_panel_size.width) / _panel_size.height;
+ float const film_ratio = format ? format->container_ratio_as_float () : 1.78;
+
if (panel_ratio < film_ratio) {
/* panel is less widscreen than the film; clamp width */
- _out_width = _panel_width;
- _out_height = _out_width / film_ratio;
+ _out_size.width = _panel_size.width;
+ _out_size.height = _out_size.width / film_ratio;
} else {
- /* panel is more widescreen than the film; clamp heignt */
- _out_height = _panel_height;
- _out_width = _out_height * film_ratio;
+ /* panel is more widescreen than the film; clamp height */
+ _out_size.height = _panel_size.height;
+ _out_size.width = _out_size.height * film_ratio;
+ }
+
+ /* Work out how much padding there is in terms of our display; this will be the x position
+ of our _display_frame.
+ */
+ _display_frame_x = 0;
+ if (format) {
+ _display_frame_x = static_cast<float> (format->dcp_padding (_film)) * _out_size.width / format->dcp_size().width;
+ }
+
+ _film_size = _out_size;
+ _film_size.width -= _display_frame_x * 2;
+
+ /* Catch silly values */
+ if (_out_size.width < 64) {
+ _out_size.width = 64;
}
}
boost::shared_ptr<Image> _raw_frame;
boost::shared_ptr<Subtitle> _raw_sub;
boost::shared_ptr<Image> _display_frame;
+ int _display_frame_x;
boost::shared_ptr<RGBPlusAlphaImage> _display_sub;
Position _display_sub_position;
bool _got_frame;
- int _out_width;
- int _out_height;
- int _panel_width;
- int _panel_height;
+ /** Size of our output (including padding if we have any) */
+ libdcp::Size _out_size;
+ /** Size that we will make our film (equal to _out_size unless we have padding) */
+ libdcp::Size _film_size;
+ /** Size of the panel that we have available */
+ libdcp::Size _panel_size;
bool _clear_required;
};
obj.use = 'libdvdomatic'
obj.source = """
config_dialog.cc
- dci_name_dialog.cc
+ dci_metadata_dialog.cc
dir_picker_ctrl.cc
film_editor.cc
film_viewer.cc
}
void
-checked_set (wxComboBox* widget, int value)
+checked_set (wxChoice* widget, int value)
{
if (widget->GetSelection() != value) {
- if (value == wxNOT_FOUND) {
- /* Work around an apparent wxWidgets bug; SetSelection (wxNOT_FOUND)
- appears not to work sometimes.
- */
- widget->SetValue (wxT (""));
- } else {
- widget->SetSelection (value);
- }
+ widget->SetSelection (value);
}
}
void
-checked_set (wxComboBox* widget, string value)
+checked_set (wxChoice* widget, string value)
{
wxClientData* o = 0;
if (widget->GetSelection() != -1) {
extern void checked_set (wxFilePickerCtrl* widget, std::string value);
extern void checked_set (wxSpinCtrl* widget, int value);
-extern void checked_set (wxComboBox* widget, int value);
-extern void checked_set (wxComboBox* widget, std::string value);
+extern void checked_set (wxChoice* widget, int value);
+extern void checked_set (wxChoice* widget, std::string value);
extern void checked_set (wxTextCtrl* widget, std::string value);
extern void checked_set (wxCheckBox* widget, bool value);
extern void checked_set (wxRadioButton* widget, bool value);
import sys
APPNAME = 'dvdomatic'
-VERSION = '0.71beta2'
+VERSION = '0.73pre'
def options(opt):
opt.load('compiler_cxx')
conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True)
conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True)
+ conf.check_cfg(package = 'liblzma', args = '--cflags --libs', uselib_store = 'LZMA', mandatory = True)
conf.check_cfg(package = '', path = 'Magick++-config', args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True)
- openjpeg_fragment = """
+ if conf.options.static:
+ conf.check_cc(fragment = """
#include <stdio.h>\n
#include <openjpeg.h>\n
int main () {\n
void* p = (void *) opj_image_create;\n
return 0;\n
}
- """
-
- if conf.options.static:
- conf.check_cc(fragment = openjpeg_fragment, msg = 'Checking for library openjpeg', stlib = 'openjpeg', uselib_store = 'OPENJPEG')
+ """, msg = 'Checking for library openjpeg', stlib = 'openjpeg', uselib_store = 'OPENJPEG')
else:
- conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', uselib_store = 'OPENJPEG', mandatory = True)
+ # Only 1.5.0 and 1.5.1 have been tested.
+ conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', atleast_version = '1.5.0', uselib_store = 'OPENJPEG', mandatory = True)
+ conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', max_version = '1.5.1', mandatory = True)
conf.check_cc(fragment = """
#include <libssh/libssh.h>\n
ssh_session s = ssh_new ();\n
return 0;\n
}
- """, msg = 'Checking for library libssh', mandatory = False, lib = 'ssh', uselib_store = 'SSH')
+ """, msg = 'Checking for library libssh', mandatory = True, lib = 'ssh', uselib_store = 'SSH')
conf.check_cxx(fragment = """
#include <boost/thread.hpp>\n