summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-17 15:22:57 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-12 11:05:26 +0100
commit56cb528a5781e67d84bdfb6cb8223931b4d283d0 (patch)
tree53ae6efee609af6fcbfa6f14d062dcf3bbc8941b /src
parentdbfbdcba0f5f08a932ba199039f2ca1530e482ac (diff)
Un-attached reel UI.
Diffstat (limited to 'src')
-rw-r--r--src/lib/film.cc21
-rw-r--r--src/lib/film.h13
-rw-r--r--src/lib/types.h7
-rw-r--r--src/wx/dcp_panel.cc73
-rw-r--r--src/wx/dcp_panel.h4
5 files changed, 109 insertions, 9 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 77e1be872..c0060b040 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -126,6 +126,8 @@ Film::Film (boost::filesystem::path dir, bool log)
, _sequence_video (true)
, _interop (Config::instance()->default_interop ())
, _audio_processor (0)
+ , _reel_type (REELTYPE_SINGLE)
+ , _reel_length (2000000000)
, _state_version (current_state_version)
, _dirty (false)
{
@@ -344,6 +346,8 @@ Film::metadata () const
if (_audio_processor) {
root->add_child("AudioProcessor")->add_child_text (_audio_processor->id ());
}
+ root->add_child("ReelType")->add_child_text (raw_convert<string> (_reel_type));
+ root->add_child("ReelLength")->add_child_text (raw_convert<string> (_reel_length));
_playlist->as_xml (root->add_child ("Playlist"));
return doc;
@@ -427,6 +431,9 @@ Film::read_metadata ()
_audio_processor = 0;
}
+ _reel_type = static_cast<ReelType> (f.optional_number_child<int>("ReelType").get_value_or (static_cast<int>(REELTYPE_SINGLE)));
+ _reel_length = f.optional_number_child<int64_t>("ReelLength").get_value_or (2000000000);
+
list<string> notes;
/* This method is the only one that can return notes (so far) */
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
@@ -817,6 +824,20 @@ Film::set_audio_processor (AudioProcessor const * processor)
}
void
+Film::set_reel_type (ReelType t)
+{
+ _reel_type = t;
+ signal_changed (REEL_TYPE);
+}
+
+void
+Film::set_reel_length (int64_t r)
+{
+ _reel_length = r;
+ signal_changed (REEL_LENGTH);
+}
+
+void
Film::signal_changed (Property p)
{
_dirty = true;
diff --git a/src/lib/film.h b/src/lib/film.h
index 937ab99e8..76068136a 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -177,6 +177,8 @@ public:
SEQUENCE_VIDEO,
INTEROP,
AUDIO_PROCESSOR,
+ REEL_TYPE,
+ REEL_LENGTH
};
@@ -252,6 +254,13 @@ public:
return _audio_processor;
}
+ ReelType reel_type () const {
+ return _reel_type;
+ }
+
+ int64_t reel_length () const {
+ return _reel_length;
+ }
/* SET */
@@ -280,6 +289,8 @@ public:
void set_sequence_video (bool);
void set_interop (bool);
void set_audio_processor (AudioProcessor const * processor);
+ void set_reel_type (ReelType);
+ void set_reel_length (int64_t);
/** Emitted when some property has of the Film has changed */
mutable boost::signals2::signal<void (Property)> Changed;
@@ -340,6 +351,8 @@ private:
bool _sequence_video;
bool _interop;
AudioProcessor const * _audio_processor;
+ ReelType _reel_type;
+ int64_t _reel_length;
int _state_version;
diff --git a/src/lib/types.h b/src/lib/types.h
index d0f4ec1f8..5486f8612 100644
--- a/src/lib/types.h
+++ b/src/lib/types.h
@@ -84,6 +84,13 @@ enum Part
PART_WHOLE
};
+enum ReelType
+{
+ REELTYPE_SINGLE,
+ REELTYPE_ONE_PER_VIDEO,
+ REELTYPE_BY_LENGTH
+};
+
/** @struct Crop
* @brief A description of the crop of an image or video.
*/
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 65bf908a7..463b11c16 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -132,26 +132,50 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
++r;
}
+ add_label_to_grid_bag_sizer (grid, _panel, _("Reels"), true, wxGBPosition (r, 0));
+ _reel_type = new wxChoice (_panel, wxID_ANY);
+ grid->Add (_reel_type, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
+ ++r;
+
+ add_label_to_grid_bag_sizer (grid, _panel, _("Reel length"), true, wxGBPosition (r, 0));
+
+ {
+ wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+ _reel_length = new wxSpinCtrl (_panel, wxID_ANY);
+ s->Add (_reel_length);
+ add_label_to_sizer (s, _panel, _("GB"), false);
+ grid->Add (s, wxGBPosition (r, 1));
+ ++r;
+ }
+
add_label_to_grid_bag_sizer (grid, _panel, _("Standard"), true, wxGBPosition (r, 0));
_standard = new wxChoice (_panel, wxID_ANY);
grid->Add (_standard, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
++r;
- _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::name_changed, this));
- _use_isdcf_name->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::use_isdcf_name_toggled, this));
- _edit_isdcf_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this));
- _copy_isdcf_name_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this));
- _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::dcp_content_type_changed, this));
- _signed->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::signed_toggled, this));
- _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::encrypted_toggled, this));
- _edit_key->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_key_clicked, this));
- _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::standard_changed, this));
+ _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::name_changed, this));
+ _use_isdcf_name->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::use_isdcf_name_toggled, this));
+ _edit_isdcf_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this));
+ _copy_isdcf_name_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this));
+ _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::dcp_content_type_changed, this));
+ _signed->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::signed_toggled, this));
+ _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::encrypted_toggled, this));
+ _edit_key->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_key_clicked, this));
+ _reel_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::reel_type_changed, this));
+ _reel_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::reel_length_changed, this));
+ _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::standard_changed, this));
vector<DCPContentType const *> const ct = DCPContentType::all ();
for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
_dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
}
+ _reel_type->Append (_("Single reel"));
+ _reel_type->Append (_("One per video content"));
+ _reel_type->Append (_("Custom"));
+
+ _reel_length->SetRange (1, 64);
+
_standard->Append (_("SMPTE"));
_standard->Append (_("Interop"));
@@ -363,6 +387,13 @@ DCPPanel::film_changed (int p)
setup_audio_channels_choice ();
film_changed (Film::AUDIO_CHANNELS);
break;
+ case Film::REEL_TYPE:
+ checked_set (_reel_type, _film->reel_type ());
+ _reel_length->Enable (_film->reel_type() == REELTYPE_BY_LENGTH);
+ break;
+ case Film::REEL_LENGTH:
+ checked_set (_reel_length, _film->reel_length() / 1000000000LL);
+ break;
default:
break;
}
@@ -457,6 +488,8 @@ DCPPanel::set_film (shared_ptr<Film> film)
film_changed (Film::THREE_D);
film_changed (Film::INTEROP);
film_changed (Film::AUDIO_PROCESSOR);
+ film_changed (Film::REEL_TYPE);
+ film_changed (Film::REEL_LENGTH);
}
void
@@ -477,6 +510,8 @@ DCPPanel::set_general_sensitivity (bool s)
_encrypted->Enable (s);
_key->Enable (s && _film && _film->encrypted ());
_edit_key->Enable (s && _film && _film->encrypted ());
+ _reel_type->Enable (s);
+ _reel_length->Enable (s);
_frame_rate_choice->Enable (s);
_frame_rate_spin->Enable (s);
_audio_channels->Enable (s);
@@ -739,3 +774,23 @@ DCPPanel::show_audio_clicked ()
AudioDialog* d = new AudioDialog (_panel, _film);
d->Show ();
}
+
+void
+DCPPanel::reel_type_changed ()
+{
+ if (!_film) {
+ return;
+ }
+
+ _film->set_reel_type (static_cast<ReelType> (_reel_type->GetSelection ()));
+}
+
+void
+DCPPanel::reel_length_changed ()
+{
+ if (!_film) {
+ return;
+ }
+
+ _film->set_reel_length (_reel_length->GetValue() * 1000000000LL);
+}
diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h
index a81af4f45..da93e752a 100644
--- a/src/wx/dcp_panel.h
+++ b/src/wx/dcp_panel.h
@@ -71,6 +71,8 @@ private:
void edit_key_clicked ();
void audio_processor_changed ();
void show_audio_clicked ();
+ void reel_type_changed ();
+ void reel_length_changed ();
void setup_frame_rate_widget ();
void setup_container ();
@@ -112,6 +114,8 @@ private:
wxCheckBox* _encrypted;
wxStaticText* _key;
wxButton* _edit_key;
+ wxChoice* _reel_type;
+ wxSpinCtrl* _reel_length;
AudioDialog* _audio_dialog;