#include "i18n.h"
using std::string;
+using boost::lexical_cast;
using boost::shared_ptr;
DCIMetadata::DCIMetadata (shared_ptr<const cxml::Node> node)
{
+ content_version = node->number_child<int> ("ContentVersion");
audio_language = node->string_child ("AudioLanguage");
subtitle_language = node->string_child ("SubtitleLanguage");
territory = node->string_child ("Territory");
void
DCIMetadata::as_xml (xmlpp::Node* root) const
{
+ root->add_child("ContentVersion")->add_child_text (lexical_cast<string> (content_version));
root->add_child("AudioLanguage")->add_child_text (audio_language);
root->add_child("SubtitleLanguage")->add_child_text (subtitle_language);
root->add_child("Territory")->add_child_text (territory);
class DCIMetadata
{
public:
- DCIMetadata () {}
+ DCIMetadata ()
+ : content_version (1)
+ {}
+
DCIMetadata (boost::shared_ptr<const cxml::Node>);
void as_xml (xmlpp::Node *) const;
void read_old_metadata (std::string, std::string);
-
+
+ int content_version;
std::string audio_language;
std::string subtitle_language;
std::string territory;
#include <wx/wx.h>
#include <wx/sizer.h>
+#include <wx/spinctrl.h>
#include "lib/film.h"
#include "dci_metadata_dialog.h"
#include "wx_util.h"
wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
+ add_label_to_sizer (table, this, _("Content version"), true);
+ _content_version = new wxSpinCtrl (this, wxID_ANY);
+ table->Add (_content_version, 1, wxEXPAND);
+
add_label_to_sizer (table, this, _("Audio Language (e.g. EN)"), true);
_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);
+ _content_version->SetRange (1, 1024);
+
+ _content_version->SetValue (dm.content_version);
_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));
{
DCIMetadata dm;
+ dm.content_version = _content_version->GetValue ();
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 ());
#include <boost/shared_ptr.hpp>
#include "lib/dci_metadata.h"
+class wxSpinCtrl;
class Film;
class DCIMetadataDialog : public wxDialog
DCIMetadata dci_metadata () const;
private:
+ wxSpinCtrl* _content_version;
wxTextCtrl* _audio_language;
wxTextCtrl* _subtitle_language;
wxTextCtrl* _territory;