#include "lib/ratio.h"
#include "lib/config.h"
#include "lib/still_image_content.h"
+#include "lib/moving_image_content.h"
+#include "lib/ffmpeg_content.h"
#include "lib/sndfile_content.h"
#include "lib/dcp_content_type.h"
#include "lib/sound_processor.h"
}
++r;
+ _encrypted = new wxCheckBox (_dcp_panel, wxID_ANY, wxT ("Encrypted"));
+ grid->Add (_encrypted, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ ++r;
+
add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Audio channels"), true, wxGBPosition (r, 0));
_audio_channels = new wxSpinCtrl (_dcp_panel, wxID_ANY);
grid->Add (_audio_channels, wxGBPosition (r, 1));
}
++r;
+ add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Standard"), true, wxGBPosition (r, 0));
+ _standard = new wxChoice (_dcp_panel, wxID_ANY);
+ grid->Add (_standard, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
+ ++r;
+
add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Scaler"), true, wxGBPosition (r, 0));
_scaler = new wxChoice (_dcp_panel, wxID_ANY);
grid->Add (_scaler, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
}
_audio_channels->SetRange (0, MAX_AUDIO_CHANNELS);
- _j2k_bandwidth->SetRange (50, 250);
+ _j2k_bandwidth->SetRange (1, 250);
_resolution->Append (_("2K"));
_resolution->Append (_("4K"));
+
+ _standard->Append (_("SMPTE"));
+ _standard->Append (_("Interop"));
}
void
_content->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&FilmEditor::content_selection_changed, this));
_content->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&FilmEditor::content_selection_changed, this));
_content->Bind (wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, boost::bind (&FilmEditor::content_right_click, this, _1));
- _content_add->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_add_clicked, this));
+ _content_add_file->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_add_file_clicked, this));
+ _content_add_folder->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_add_folder_clicked, this));
_content_remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_remove_clicked, this));
_content_timeline->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_timeline_clicked, this));
_scaler->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&FilmEditor::scaler_changed, this));
_dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&FilmEditor::dcp_content_type_changed, this));
_frame_rate->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&FilmEditor::frame_rate_changed, this));
_best_frame_rate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::best_frame_rate_clicked, this));
+ _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::encrypted_toggled, this));
_audio_channels->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&FilmEditor::audio_channels_changed, this));
_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&FilmEditor::j2k_bandwidth_changed, this));
_resolution->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&FilmEditor::resolution_changed, this));
_sequence_video->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::sequence_video_changed, this));
_three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::three_d_changed, this));
+ _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&FilmEditor::standard_changed, this));
}
void
_content->SetColumnWidth (0, 512);
wxBoxSizer* b = new wxBoxSizer (wxVERTICAL);
- _content_add = new wxButton (_content_panel, wxID_ANY, _("Add..."));
- b->Add (_content_add, 1, wxEXPAND | wxLEFT | wxRIGHT);
+ _content_add_file = new wxButton (_content_panel, wxID_ANY, _("Add file(s)..."));
+ b->Add (_content_add_file, 1, wxEXPAND | wxLEFT | wxRIGHT);
+ _content_add_folder = new wxButton (_content_panel, wxID_ANY, _("Add folder..."));
+ b->Add (_content_add_folder, 1, wxEXPAND | wxLEFT | wxRIGHT);
_content_remove = new wxButton (_content_panel, wxID_ANY, _("Remove"));
b->Add (_content_remove, 1, wxEXPAND | wxLEFT | wxRIGHT);
_content_timeline = new wxButton (_content_panel, wxID_ANY, _("Timeline..."));
_film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
}
+void
+FilmEditor::encrypted_toggled ()
+{
+ if (!_film) {
+ return;
+ }
+
+ _film->set_encrypted (_encrypted->GetValue ());
+}
+
+/** Called when the name widget has been changed */
void
FilmEditor::frame_rate_changed ()
{
_film->set_resolution (_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K);
}
+void
+FilmEditor::standard_changed ()
+{
+ if (!_film) {
+ return;
+ }
+
+ _film->set_interop (_standard->GetSelection() == 1);
+}
/** Called when the metadata stored in the Film object has changed;
* so that we can update the GUI.
case Film::SCALER:
checked_set (_scaler, Scaler::as_index (_film->scaler ()));
break;
+ case Film::ENCRYPTED:
+ checked_set (_encrypted, _film->encrypted ());
+ break;
case Film::RESOLUTION:
checked_set (_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1);
setup_dcp_name ();
break;
}
case Film::AUDIO_CHANNELS:
- _audio_channels->SetValue (_film->audio_channels ());
+ checked_set (_audio_channels, _film->audio_channels ());
setup_dcp_name ();
break;
case Film::SEQUENCE_VIDEO:
checked_set (_three_d, _film->three_d ());
setup_dcp_name ();
break;
+ case Film::INTEROP:
+ checked_set (_standard, _film->interop() ? 1 : 0);
+ break;
}
}
film_changed (Film::RESOLUTION);
film_changed (Film::SCALER);
film_changed (Film::WITH_SUBTITLES);
+ film_changed (Film::ENCRYPTED);
film_changed (Film::J2K_BANDWIDTH);
film_changed (Film::DCI_METADATA);
film_changed (Film::VIDEO_FRAME_RATE);
film_changed (Film::AUDIO_CHANNELS);
+ film_changed (Film::ENCRYPTED);
film_changed (Film::SEQUENCE_VIDEO);
film_changed (Film::THREE_D);
+ film_changed (Film::INTEROP);
if (!_film->content().empty ()) {
set_selection (_film->content().front ());
- } else {
- content_selection_changed ();
}
+
+ content_selection_changed ();
}
void
_use_dci_name->Enable (s);
_edit_dci_button->Enable (s);
_content->Enable (s);
- _content_add->Enable (s);
+ _content_add_file->Enable (s);
+ _content_add_folder->Enable (s);
_content_remove->Enable (s);
_content_timeline->Enable (s);
_dcp_content_type->Enable (s);
+ _encrypted->Enable (s);
_frame_rate->Enable (s);
_audio_channels->Enable (s);
_j2k_bandwidth->Enable (s);
_resolution->Enable (s);
_scaler->Enable (s);
_three_d->Enable (s);
+ _standard->Enable (s);
/* Set the panels in the content notebook */
for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
}
void
-FilmEditor::content_add_clicked ()
+FilmEditor::content_add_file_clicked ()
{
wxFileDialog* d = new wxFileDialog (this, _("Choose a file or files"), wxT (""), wxT (""), wxT ("*.*"), wxFD_MULTIPLE);
int const r = d->ShowModal ();
wxArrayString paths;
d->GetPaths (paths);
+ /* XXX: check for lots of files here and do something */
+
for (unsigned int i = 0; i < paths.GetCount(); ++i) {
boost::filesystem::path p (wx_to_std (paths[i]));
shared_ptr<Content> c;
- if (StillImageContent::valid_file (p)) {
+ if (valid_image_file (p)) {
c.reset (new StillImageContent (_film, p));
} else if (SndfileContent::valid_file (p)) {
c.reset (new SndfileContent (_film, p));
}
}
+void
+FilmEditor::content_add_folder_clicked ()
+{
+ wxDirDialog* d = new wxDirDialog (this, _("Choose a folder"), wxT (""), wxDD_DIR_MUST_EXIST);
+ int const r = d->ShowModal ();
+ d->Destroy ();
+
+ if (r != wxID_OK) {
+ return;
+ }
+
+ _film->examine_and_add_content (
+ shared_ptr<MovingImageContent> (
+ new MovingImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
+ )
+ );
+}
+
void
FilmEditor::content_remove_clicked ()
{
/* All other sensitivity in content panels should be triggered by
one of these.
*/
- film_content_changed (s, ContentProperty::START);
+ film_content_changed (s, ContentProperty::POSITION);
film_content_changed (s, ContentProperty::LENGTH);
+ film_content_changed (s, ContentProperty::TRIM_START);
+ film_content_changed (s, ContentProperty::TRIM_END);
film_content_changed (s, VideoContentProperty::VIDEO_CROP);
film_content_changed (s, VideoContentProperty::VIDEO_RATIO);
film_content_changed (s, VideoContentProperty::VIDEO_FRAME_TYPE);
+ film_content_changed (s, VideoContentProperty::COLOUR_CONVERSION);
film_content_changed (s, AudioContentProperty::AUDIO_GAIN);
film_content_changed (s, AudioContentProperty::AUDIO_DELAY);
film_content_changed (s, AudioContentProperty::AUDIO_MAPPING);
void
FilmEditor::setup_content_sensitivity ()
{
- _content_add->Enable (_generally_sensitive);
+ _content_add_file->Enable (_generally_sensitive);
+ _content_add_folder->Enable (_generally_sensitive);
shared_ptr<Content> selection = selected_content ();