_encrypted = e;
}
-void
-Film::set_key (dcp::Key key)
-{
- ChangeSignaller<Film> ch (this, KEY);
- _key = key;
-}
-
ContentList
Film::content () const
{
class Job;
class Film;
struct isdcf_name_test;
+struct recover_test_2d_encrypted;
class InfoFileHandle
{
CONTAINER,
RESOLUTION,
ENCRYPTED,
- KEY,
J2K_BANDWIDTH,
ISDCF_METADATA,
VIDEO_FRAME_RATE,
void set_container (Ratio const *, bool user_explicit = true);
void set_resolution (Resolution, bool user_explicit = true);
void set_encrypted (bool);
- void set_key (dcp::Key key);
void set_j2k_bandwidth (int);
void set_isdcf_metadata (ISDCFMetadata);
void set_video_frame_rate (int rate, bool user_explicit = false);
private:
friend struct ::isdcf_name_test;
+ friend struct ::recover_test_2d_encrypted;
template <typename> friend class ChangeSignaller;
boost::filesystem::path info_file (dcpomatic::DCPTimePeriod p) const;
/*
- Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "dcp_panel.h"
#include "wx_util.h"
-#include "key_dialog.h"
#include "isdcf_metadata_dialog.h"
#include "audio_dialog.h"
#include "focus_manager.h"
#include "lib/dcp_content.h"
#include "lib/audio_content.h"
#include <dcp/locale_convert.h>
-#include <dcp/key.h>
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/gbsizer.h>
wxSize size = dc.GetTextExtent (wxT ("GGGGGGGG..."));
size.SetHeight (-1);
- _key_label = create_label (_panel, _("Key"), true);
- _key = new StaticText (_panel, "", wxDefaultPosition, size);
- _edit_key = new Button (_panel, _("Edit..."));
-
_reels_label = create_label (_panel, _("Reels"), true);
_reel_type = new wxChoice (_panel, wxID_ANY);
_copy_isdcf_name_button->Bind(wxEVT_BUTTON, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this));
_dcp_content_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::dcp_content_type_changed, this));
_encrypted->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::encrypted_toggled, this));
- _edit_key->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::edit_key_clicked, this));
_reel_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::reel_type_changed, this));
_reel_length->Bind (wxEVT_SPINCTRL, boost::bind (&DCPPanel::reel_length_changed, this));
_standard->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::standard_changed, this));
++r;
- _key_label->Show (full);
- _key->Show (full);
- _edit_key->Show (full);
_reels_label->Show (full);
_reel_type->Show (full);
_reel_length_label->Show (full);
_encrypted->Show (full);
if (full) {
- add_label_to_sizer (_grid, _key_label, true, wxGBPosition (r, 0));
- {
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- s->Add (_key, 1, wxALIGN_CENTER_VERTICAL);
- s->Add (_edit_key);
- _grid->Add (s, wxGBPosition (r, 1));
- }
- ++r;
-
add_label_to_sizer (_grid, _reels_label, true, wxGBPosition (r, 0));
_grid->Add (_reel_type, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
++r;
}
}
-void
-DCPPanel::edit_key_clicked ()
-{
- KeyDialog* d = new KeyDialog (_panel, _film->key ());
- if (d->ShowModal () == wxID_OK) {
- _film->set_key (d->key ());
- }
- d->Destroy ();
-}
-
void
DCPPanel::name_changed ()
{
break;
case Film::ENCRYPTED:
checked_set (_encrypted, _film->encrypted ());
- if (_film->encrypted ()) {
- _key->Enable (_generally_sensitive);
- _edit_key->Enable (_generally_sensitive);
- } else {
- _key->Enable (false);
- _edit_key->Enable (false);
- }
- break;
- case Film::KEY:
- checked_set (_key, _film->key().hex().substr (0, 8) + "...");
break;
case Film::RESOLUTION:
checked_set (_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1);
film_changed (Film::CONTAINER);
film_changed (Film::RESOLUTION);
film_changed (Film::ENCRYPTED);
- film_changed (Film::KEY);
film_changed (Film::J2K_BANDWIDTH);
film_changed (Film::ISDCF_METADATA);
film_changed (Film::VIDEO_FRAME_RATE);
_edit_isdcf_button->Enable (_generally_sensitive);
_dcp_content_type->Enable (_generally_sensitive);
_copy_isdcf_name_button->Enable (_generally_sensitive);
-
- bool si = _generally_sensitive;
- if (_film && _film->encrypted ()) {
- si = false;
- }
-
_encrypted->Enable (_generally_sensitive);
- _key->Enable (_generally_sensitive && _film && _film->encrypted ());
- _edit_key->Enable (_generally_sensitive && _film && _film->encrypted ());
_reel_type->Enable (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->references_dcp_audio());
_reel_length->Enable (_generally_sensitive && _film && _film->reel_type() == REELTYPE_BY_LENGTH);
_upload_after_make_dcp->Enable (_generally_sensitive);
void three_d_changed ();
void standard_changed ();
void encrypted_toggled ();
- void edit_key_clicked ();
void audio_processor_changed ();
void show_audio_clicked ();
void reel_type_changed ();
wxStaticText* _standard_label;
wxChoice* _standard;
wxCheckBox* _encrypted;
- wxStaticText* _key_label;
- wxStaticText* _key;
- wxButton* _edit_key;
wxStaticText* _reels_label;
wxChoice* _reel_type;
wxStaticText* _reel_length_label;
+++ /dev/null
-/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic 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.
-
- DCP-o-matic 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 DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "key_dialog.h"
-#include "wx_util.h"
-#include "dcpomatic_button.h"
-#include <iostream>
-
-using std::cout;
-
-KeyDialog::KeyDialog (wxWindow* parent, dcp::Key key)
- : TableDialog (parent, _("Key"), 3, 1, true)
-{
- add (_("Key"), true);
-
- wxClientDC dc (parent);
- wxSize size = dc.GetTextExtent (wxT ("0123456790ABCDEF0123456790ABCDEF"));
- size.SetHeight (-1);
-
- wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST);
- wxArrayString list;
-
- wxString n (wxT ("0123456789abcdefABCDEF"));
- for (size_t i = 0; i < n.Length(); ++i) {
- list.Add (n[i]);
- }
-
- validator.SetIncludes (list);
-
- _key = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, size, 0, validator));
- _key->SetValue (std_to_wx (key.hex ()));
- _key->SetMaxLength (32);
-
- _random = add (new Button(this, _("Random")));
-
- _key->Bind (wxEVT_TEXT, boost::bind (&KeyDialog::key_changed, this));
- _random->Bind (wxEVT_BUTTON, boost::bind (&KeyDialog::random, this));
-
- layout ();
-}
-
-dcp::Key
-KeyDialog::key () const
-{
- return dcp::Key (wx_to_std (_key->GetValue ()));
-}
-
-void
-KeyDialog::key_changed ()
-{
- wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
- ok->Enable (_key->GetValue().Length() == 32);
-}
-
-void
-KeyDialog::random ()
-{
- _key->SetValue (dcp::Key().hex ());
-}
+++ /dev/null
-/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic 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.
-
- DCP-o-matic 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 DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "table_dialog.h"
-#include <dcp/key.h>
-
-class KeyDialog : public TableDialog
-{
-public:
- KeyDialog (wxWindow *, dcp::Key);
-
- dcp::Key key () const;
-
-private:
- void key_changed ();
- void random ();
-
- wxTextCtrl* _key;
- wxButton* _random;
-};
kdm_dialog.cc
kdm_output_panel.cc
kdm_timing_panel.cc
- key_dialog.cc
make_chain_dialog.cc
markers_dialog.cc
message_dialog.cc
film->set_container (Ratio::from_id ("185"));
film->set_name ("recover_test");
film->set_encrypted (true);
- film->set_key (dcp::Key("eafcb91c9f5472edf01f3a2404c57258"));
+ film->_key = dcp::Key("eafcb91c9f5472edf01f3a2404c57258");
shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/count300bd24.m2ts"));
film->examine_and_add_content (content);