shared_ptr<Player> player (new Player (_film, _playlist));
player->set_ignore_video ();
player->set_fast ();
+ player->set_play_referenced ();
DCPTime const start = _playlist->start().get_value_or (DCPTime ());
DCPTime const length = _playlist->length ();
using boost::shared_ptr;
using boost::optional;
-int const DCPContentProperty::CAN_BE_PLAYED = 600;
+int const DCPContentProperty::CAN_BE_PLAYED = 600;
+int const DCPContentProperty::REFERENCE_VIDEO = 601;
+int const DCPContentProperty::REFERENCE_AUDIO = 602;
+int const DCPContentProperty::REFERENCE_SUBTITLE = 603;
DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
: Content (film)
/* Default to no colour conversion for DCPs */
unset_colour_conversion ();
}
+
+void
+DCPContent::set_reference_video (bool r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _reference_video = r;
+ }
+
+ signal_changed (DCPContentProperty::REFERENCE_VIDEO);
+}
+
+void
+DCPContent::set_reference_audio (bool r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _reference_audio = r;
+ }
+
+ signal_changed (DCPContentProperty::REFERENCE_AUDIO);
+}
+
+void
+DCPContent::set_reference_subtitle (bool r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _reference_subtitle = r;
+ }
+
+ signal_changed (DCPContentProperty::REFERENCE_SUBTITLE);
+}
{
public:
static int const CAN_BE_PLAYED;
+ static int const REFERENCE_VIDEO;
+ static int const REFERENCE_AUDIO;
+ static int const REFERENCE_SUBTITLE;
};
/** @class DCPContent
bool can_be_played () const;
+ void set_reference_video (bool r);
+
bool reference_video () const {
boost::mutex::scoped_lock lm (_mutex);
return _reference_video;
}
+ void set_reference_audio (bool r);
+
bool reference_audio () const {
boost::mutex::scoped_lock lm (_mutex);
return _reference_audio;
}
+ void set_reference_subtitle (bool r);
+
bool reference_subtitle () const {
boost::mutex::scoped_lock lm (_mutex);
return _reference_subtitle;
#include "lib/ffmpeg_content.h"
#include "lib/cinema_sound_processor.h"
#include "lib/job_manager.h"
+#include "lib/dcp_content.h"
#include <wx/spinctrl.h>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
int r = 0;
+ _reference = new wxCheckBox (this, wxID_ANY, _("Refer to existing DCP"));
+ grid->Add (_reference, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ ++r;
+
{
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_show = new wxButton (this, wxID_ANY, _("Show graph of audio levels..."));
_gain->wrapped()->SetIncrement (0.5);
_delay->wrapped()->SetRange (-1000, 1000);
- _show->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::show_clicked, this));
- _gain_calculate_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::gain_calculate_button_clicked, this));
+ _reference->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AudioPanel::reference_clicked, this));
+ _show->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::show_clicked, this));
+ _gain_calculate_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::gain_calculate_button_clicked, this));
_mapping_connection = _mapping->Changed.connect (boost::bind (&AudioPanel::mapping_changed, this, _1));
void
AudioPanel::film_content_changed (int property)
{
+ AudioContentList ac = _parent->selected_audio ();
if (property == AudioContentProperty::AUDIO_STREAMS) {
- AudioContentList ac = _parent->selected_audio ();
if (ac.size() == 1) {
_mapping->set (ac.front()->audio_mapping());
_mapping->set_input_channels (ac.front()->audio_channel_names ());
_sizer->Layout ();
} else if (property == AudioContentProperty::AUDIO_GAIN) {
setup_peak ();
+ } else if (property == DCPContentProperty::REFERENCE_AUDIO) {
+ if (ac.size() == 1) {
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (ac.front ());
+ checked_set (_reference, dcp ? dcp->reference_audio () : false);
+ } else {
+ checked_set (_reference, false);
+ }
+
+ setup_sensitivity ();
}
}
_gain->set_content (sel);
_delay->set_content (sel);
- _gain_calculate_button->Enable (sel.size() == 1);
- _mapping->Enable (sel.size() == 1);
-
film_content_changed (AudioContentProperty::AUDIO_STREAMS);
+
+ setup_sensitivity ();
+}
+
+void
+AudioPanel::setup_sensitivity ()
+{
+ AudioContentList sel = _parent->selected_audio ();
+ _reference->Enable (sel.size() == 1 && dynamic_pointer_cast<DCPContent> (sel.front ()));
+
+ if (_reference->GetValue ()) {
+ _gain->wrapped()->Enable (false);
+ _gain_calculate_button->Enable (false);
+ _peak->Enable (false);
+ _delay->wrapped()->Enable (false);
+ _mapping->Enable (false);
+ _description->Enable (false);
+ } else {
+ _gain->wrapped()->Enable (true);
+ _gain_calculate_button->Enable (sel.size() == 1);
+ _peak->Enable (true);
+ _delay->wrapped()->Enable (true);
+ _mapping->Enable (sel.size() == 1);
+ _description->Enable (true);
+ }
}
void
setup_peak ();
}
}
+
+void
+AudioPanel::reference_clicked ()
+{
+ ContentList c = _parent->selected ();
+ if (c.size() != 1) {
+ return;
+ }
+
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
+ if (!d) {
+ return;
+ }
+
+ d->set_reference_audio (_reference->GetValue ());
+}
void setup_description ();
void setup_peak ();
void active_jobs_changed (boost::optional<std::string>);
+ void setup_sensitivity ();
+ void reference_clicked ();
+ wxCheckBox* _reference;
wxButton* _show;
ContentSpinCtrlDouble<AudioContent>* _gain;
wxButton* _gain_calculate_button;
*/
+#include "lib/colour_conversion.h"
#include <wx/wx.h>
class ColourConversionEditor;
#include "lib/dcp_subtitle_content.h"
#include "lib/subrip_decoder.h"
#include "lib/dcp_subtitle_decoder.h"
+#include "lib/dcp_content.h"
#include <wx/spinctrl.h>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
wxFlexGridSizer* grid = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
_sizer->Add (grid, 0, wxALL, 8);
+ _reference = new wxCheckBox (this, wxID_ANY, _("Refer to existing DCP"));
+ grid->Add (_reference);
+ grid->AddSpacer (0);
+
_use = new wxCheckBox (this, wxID_ANY, _("Use subtitles"));
grid->Add (_use);
grid->AddSpacer (0);
_x_scale->SetRange (10, 1000);
_y_scale->SetRange (10, 1000);
+ _reference->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&SubtitlePanel::reference_clicked, this));
_use->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&SubtitlePanel::use_toggled, this));
_burn->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&SubtitlePanel::burn_toggled, this));
_x_offset->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&SubtitlePanel::x_offset_changed, this));
checked_set (_y_scale, scs ? lrint (scs->subtitle_y_scale() * 100) : 100);
} else if (property == SubtitleContentProperty::SUBTITLE_LANGUAGE) {
checked_set (_language, scs ? scs->subtitle_language() : "");
+ } else if (property == DCPContentProperty::REFERENCE_SUBTITLE) {
+ if (scs) {
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (scs);
+ checked_set (_reference, dcp ? dcp->reference_subtitle () : false);
+ } else {
+ checked_set (_reference, false);
+ }
+
+ setup_sensitivity ();
}
}
}
}
- _use->Enable (any_subs > 0);
+ bool const reference = _reference->GetValue ();
+
+ _use->Enable (!reference && any_subs > 0);
bool const use = _use->GetValue ();
- _burn->Enable (any_subs > 0 && use && image_subs == 0);
- _x_offset->Enable (any_subs > 0 && use);
- _y_offset->Enable (any_subs > 0 && use);
- _x_scale->Enable (any_subs > 0 && use);
- _y_scale->Enable (any_subs > 0 && use);
- _language->Enable (any_subs > 0 && use);
- _stream->Enable (ffmpeg_subs == 1);
- _subtitle_view_button->Enable (subrip_or_dcp_subs == 1);
- _fonts_dialog_button->Enable (subrip_or_dcp_subs == 1);
+ _burn->Enable (!reference && any_subs > 0 && use && image_subs == 0);
+ _x_offset->Enable (!reference && any_subs > 0 && use);
+ _y_offset->Enable (!reference && any_subs > 0 && use);
+ _x_scale->Enable (!reference && any_subs > 0 && use);
+ _y_scale->Enable (!reference && any_subs > 0 && use);
+ _language->Enable (!reference && any_subs > 0 && use);
+ _stream->Enable (!reference && ffmpeg_subs == 1);
+ _subtitle_view_button->Enable (!reference && subrip_or_dcp_subs == 1);
+ _fonts_dialog_button->Enable (!reference && subrip_or_dcp_subs == 1);
}
void
_fonts_dialog = new FontsDialog (this, c.front ());
_fonts_dialog->Show ();
}
+
+void
+SubtitlePanel::reference_clicked ()
+{
+ ContentList c = _parent->selected ();
+ if (c.size() != 1) {
+ return;
+ }
+
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
+ if (!d) {
+ return;
+ }
+
+ d->set_reference_subtitle (_reference->GetValue ());
+}
void stream_changed ();
void subtitle_view_clicked ();
void fonts_dialog_clicked ();
+ void reference_clicked ();
void setup_sensitivity ();
+ wxCheckBox* _reference;
wxCheckBox* _use;
wxCheckBox* _burn;
wxSpinCtrl* _x_offset;
*/
+#include "filter_dialog.h"
+#include "video_panel.h"
+#include "wx_util.h"
+#include "content_colour_conversion_dialog.h"
+#include "content_widget.h"
+#include "content_panel.h"
#include "lib/filter.h"
#include "lib/ffmpeg_content.h"
#include "lib/colour_conversion.h"
#include "lib/util.h"
#include "lib/ratio.h"
#include "lib/frame_rate_change.h"
-#include "filter_dialog.h"
-#include "video_panel.h"
-#include "wx_util.h"
-#include "content_colour_conversion_dialog.h"
-#include "content_widget.h"
-#include "content_panel.h"
+#include "lib/dcp_content.h"
#include <wx/spinctrl.h>
#include <boost/foreach.hpp>
#include <set>
int r = 0;
+ _reference = new wxCheckBox (this, wxID_ANY, _("Refer to existing DCP"));
+ grid->Add (_reference, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ ++r;
+
add_label_to_grid_bag_sizer (grid, this, _("Type"), true, wxGBPosition (r, 0));
_frame_type = new ContentChoice<VideoContent, VideoFrameType> (
this,
_fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this));
_fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this));
- _filters_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_filters_clicked, this));
- _colour_conversion->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&VideoPanel::colour_conversion_changed, this));
- _edit_colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
+ _reference->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&VideoPanel::reference_clicked, this));
+ _filters_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_filters_clicked, this));
+ _colour_conversion->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&VideoPanel::colour_conversion_changed, this));
+ _edit_colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
}
void
} else {
_fade_out->clear ();
}
+ } else if (property == DCPContentProperty::REFERENCE_VIDEO) {
+ if (vc.size() == 1) {
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (vc.front ());
+ checked_set (_reference, dcp ? dcp->reference_video () : false);
+ } else {
+ checked_set (_reference, false);
+ }
+
+ setup_sensitivity ();
}
}
VideoPanel::content_selection_changed ()
{
VideoContentList video_sel = _parent->selected_video ();
- FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg ();
-
- bool const single = video_sel.size() == 1;
_frame_type->set_content (video_sel);
_left_crop->set_content (video_sel);
_right_crop->set_content (video_sel);
_top_crop->set_content (video_sel);
_bottom_crop->set_content (video_sel);
- _fade_in->Enable (!video_sel.empty ());
- _fade_out->Enable (!video_sel.empty ());
_scale->set_content (video_sel);
- _colour_conversion->Enable (single && !video_sel.empty ());
- _filters_button->Enable (single && !ffmpeg_sel.empty ());
-
film_content_changed (VideoContentProperty::VIDEO_CROP);
film_content_changed (VideoContentProperty::VIDEO_FRAME_RATE);
film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
film_content_changed (VideoContentProperty::VIDEO_FADE_IN);
film_content_changed (VideoContentProperty::VIDEO_FADE_OUT);
film_content_changed (FFmpegContentProperty::FILTERS);
+ film_content_changed (DCPContentProperty::REFERENCE_VIDEO);
+
+ setup_sensitivity ();
+}
+
+void
+VideoPanel::setup_sensitivity ()
+{
+ ContentList sel = _parent->selected ();
+ _reference->Enable (sel.size() == 1 && dynamic_pointer_cast<DCPContent> (sel.front ()));
+
+ if (_reference->GetValue ()) {
+ _frame_type->wrapped()->Enable (false);
+ _left_crop->wrapped()->Enable (false);
+ _right_crop->wrapped()->Enable (false);
+ _top_crop->wrapped()->Enable (false);
+ _bottom_crop->wrapped()->Enable (false);
+ _fade_in->Enable (false);
+ _fade_out->Enable (false);
+ _scale->wrapped()->Enable (false);
+ _description->Enable (false);
+ _filters->Enable (false);
+ _filters_button->Enable (false);
+ _colour_conversion->Enable (false);
+ _edit_colour_conversion_button->Enable (false);
+ } else {
+ VideoContentList video_sel = _parent->selected_video ();
+ FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg ();
+ bool const single = video_sel.size() == 1;
+
+ _frame_type->wrapped()->Enable (true);
+ _left_crop->wrapped()->Enable (true);
+ _right_crop->wrapped()->Enable (true);
+ _top_crop->wrapped()->Enable (true);
+ _bottom_crop->wrapped()->Enable (true);
+ _fade_in->Enable (!video_sel.empty ());
+ _fade_out->Enable (!video_sel.empty ());
+ _scale->wrapped()->Enable (true);
+ _description->Enable (true);
+ _filters->Enable (true);
+ _filters_button->Enable (single && !ffmpeg_sel.empty ());
+ _colour_conversion->Enable (single && !video_sel.empty ());
+ _edit_colour_conversion_button->Enable (true);
+ }
}
void
i->set_fade_out (_fade_out->get (vfr).frames_round (vfr));
}
}
+
+void
+VideoPanel::reference_clicked ()
+{
+ ContentList c = _parent->selected ();
+ if (c.size() != 1) {
+ return;
+ }
+
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
+ if (!d) {
+ return;
+ }
+
+ d->set_reference_video (_reference->GetValue ());
+}
void content_selection_changed ();
private:
+ void reference_clicked ();
void edit_filters_clicked ();
void colour_conversion_changed ();
void edit_colour_conversion_clicked ();
void fade_out_changed ();
void setup_description ();
+ void setup_sensitivity ();
+ wxCheckBox* _reference;
ContentChoice<VideoContent, VideoFrameType>* _frame_type;
ContentSpinCtrl<VideoContent>* _left_crop;
ContentSpinCtrl<VideoContent>* _right_crop;