list<shared_ptr<Image> > images = graph->process (frame);
for (list<shared_ptr<Image> >::iterator i = images.begin(); i != images.end(); ++i) {
- if (_opt->black_after > 0 && _video_frame_index > _opt->black_after) {
- (*i)->make_black ();
- }
-
shared_ptr<Subtitle> sub;
if (_timed_subtitle && _timed_subtitle->displayed_at (double (video_frame_index()) / _film->frames_per_second())) {
sub = _timed_subtitle->subtitle ();
, _dcp_content_type (0)
, _format (0)
, _scaler (Scaler::from_id ("bicubic"))
- , _dcp_trim_action (CUT)
, _dcp_ab (false)
, _audio_stream (-1)
, _audio_gain (0)
, _filters (o._filters)
, _scaler (o._scaler)
, _dcp_frames (o._dcp_frames)
- , _dcp_trim_action (o._dcp_trim_action)
, _dcp_ab (o._dcp_ab)
, _audio_stream (o._audio_stream)
, _audio_gain (o._audio_gain)
shared_ptr<Options> o (new Options (j2k_dir(), ".j2c", dir ("wavs")));
o->out_size = format()->dcp_size ();
- if (!dcp_frames()) {
- /* Decode the whole film, no blacking */
- o->black_after = 0;
- } else {
- switch (dcp_trim_action()) {
- case CUT:
- /* Decode only part of the film, no blacking */
- o->black_after = 0;
- break;
- case BLACK_OUT:
- /* Decode the whole film, but black some frames out */
- o->black_after = dcp_frames().get ();
- }
- }
-
o->padding = format()->dcp_padding (shared_from_this ());
o->ratio = format()->ratio_as_float (shared_from_this ());
o->decode_subtitles = with_subtitles ();
}
f << "scaler " << _scaler->id () << "\n";
f << "dcp_frames " << _dcp_frames.get_value_or(0) << "\n";
-
- f << "dcp_trim_action ";
- switch (_dcp_trim_action) {
- case CUT:
- f << "cut\n";
- break;
- case BLACK_OUT:
- f << "black_out\n";
- break;
- }
-
f << "dcp_ab " << (_dcp_ab ? "1" : "0") << "\n";
f << "selected_audio_stream " << _audio_stream << "\n";
f << "audio_gain " << _audio_gain << "\n";
if (vv) {
_dcp_frames = vv;
}
- } else if (k == "dcp_trim_action") {
- if (v == "cut") {
- _dcp_trim_action = CUT;
- } else if (v == "black_out") {
- _dcp_trim_action = BLACK_OUT;
- }
} else if (k == "dcp_ab") {
_dcp_ab = (v == "1");
} else if (k == "selected_audio_stream") {
signal_changed (DCP_FRAMES);
}
-void
-Film::set_dcp_trim_action (TrimAction a)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _dcp_trim_action = a;
- }
- signal_changed (DCP_TRIM_ACTION);
-}
-
void
Film::set_dcp_ab (bool a)
{
#include "dcp_content_type.h"
#include "util.h"
#include "stream.h"
-#include "trim_action.h"
class Format;
class Job;
FILTERS,
SCALER,
DCP_FRAMES,
- DCP_TRIM_ACTION,
DCP_AB,
AUDIO_STREAM,
AUDIO_GAIN,
return _dcp_frames;
}
- TrimAction dcp_trim_action () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_trim_action;
- }
-
bool dcp_ab () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _dcp_ab;
void set_scaler (Scaler const *);
void set_dcp_frames (int);
void unset_dcp_frames ();
- void set_dcp_trim_action (TrimAction);
void set_dcp_ab (bool);
void set_audio_stream (int);
void set_audio_gain (float);
Scaler const * _scaler;
/** Maximum number of frames to put in the DCP, if applicable */
boost::optional<int> _dcp_frames;
- /** What to do with audio when trimming DCPs */
- TrimAction _dcp_trim_action;
/** true to create an A/B comparison DCP, where the left half of the image
is the video without any filters or post-processing, and the right half
has the specified filters and post-processing.
Options (std::string f, std::string e, std::string m)
: padding (0)
, apply_crop (true)
- , black_after (0)
, decode_video_frequency (0)
, decode_audio (true)
, decode_subtitles (false)
float ratio; ///< ratio of the wanted output image (not considering padding)
int padding; ///< number of pixels of padding (in terms of the output size) each side of the image
bool apply_crop; ///< true to apply cropping
- int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none
int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails)
bool decode_audio; ///< true to decode audio, otherwise false
bool decode_subtitles;
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program 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.
-
- This program 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 this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DVDOMATIC_TRIM_ACTION_H
-#define DVDOMATIC_TRIM_ACTION_H
-
-enum TrimAction {
- CUT, ///< cut everything out after dcp_frames
- BLACK_OUT ///< black out after dcp_frames so that the film stays the same length (and audio continues)
-};
-
-#endif
table->Add (s);
}
- table->AddSpacer (0);
- _cut = new wxRadioButton (this, wxID_ANY, _("Cut remainder"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
- table->Add (_cut);
-
- table->AddSpacer (0);
- _black_out = new wxRadioButton (this, wxID_ANY, _("Black-out remainder"));
- table->Add (_black_out);
-
_n_frames->SetRange (1, INT_MAX - 1);
if (_film->dcp_frames()) {
_whole->SetValue (false);
_n_frames->SetValue (24);
}
- _black_out->Enable (_film->dcp_trim_action() == BLACK_OUT);
- _cut->Enable (_film->dcp_trim_action() == CUT);
-
_whole->Connect (wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler (DCPRangeDialog::whole_toggled), 0, this);
_first->Connect (wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler (DCPRangeDialog::first_toggled), 0, this);
- _cut->Connect (wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler (DCPRangeDialog::cut_toggled), 0, this);
_n_frames->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (DCPRangeDialog::n_frames_changed), 0, this);
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
DCPRangeDialog::set_sensitivity ()
{
_n_frames->Enable (_first->GetValue ());
- _black_out->Enable (_first->GetValue ());
- _cut->Enable (_first->GetValue ());
-}
-
-void
-DCPRangeDialog::cut_toggled (wxCommandEvent &)
-{
- set_sensitivity ();
- emit_changed ();
}
void
frames = _n_frames->GetValue ();
}
- TrimAction action = CUT;
- if (_black_out->GetValue ()) {
- action = BLACK_OUT;
- }
-
- Changed (frames, action);
+ Changed (frames);
}
#include <wx/wx.h>
#include <wx/spinctrl.h>
#include <boost/signals2.hpp>
-#include "lib/trim_action.h"
class Film;
public:
DCPRangeDialog (wxWindow *, boost::shared_ptr<Film>);
- boost::signals2::signal<void (int, TrimAction)> Changed;
+ boost::signals2::signal<void (int)> Changed;
private:
void whole_toggled (wxCommandEvent &);
void first_toggled (wxCommandEvent &);
- void cut_toggled (wxCommandEvent &);
void n_frames_changed (wxCommandEvent &);
void set_sensitivity ();
wxRadioButton* _whole;
wxRadioButton* _first;
wxSpinCtrl* _n_frames;
- wxRadioButton* _cut;
- wxRadioButton* _black_out;
};
}
_sizer->Layout ();
break;
- case Film::DCP_TRIM_ACTION:
- break;
case Film::DCP_AB:
_dcp_ab->SetValue (_film->dcp_ab ());
break;
film_changed (Film::CROP);
film_changed (Film::FILTERS);
film_changed (Film::DCP_FRAMES);
- film_changed (Film::DCP_TRIM_ACTION);
film_changed (Film::DCP_AB);
film_changed (Film::SIZE);
film_changed (Film::LENGTH);
FilmEditor::change_dcp_range_clicked (wxCommandEvent &)
{
DCPRangeDialog* d = new DCPRangeDialog (this, _film);
- d->Changed.connect (bind (&FilmEditor::dcp_range_changed, this, _1, _2));
+ d->Changed.connect (bind (&FilmEditor::dcp_range_changed, this, _1));
d->ShowModal ();
}
void
-FilmEditor::dcp_range_changed (int frames, TrimAction action)
+FilmEditor::dcp_range_changed (int frames)
{
if (frames == 0) {
_film->unset_dcp_frames ();
} else {
_film->set_dcp_frames (frames);
}
-
- _film->set_dcp_trim_action (action);
}
void
#include <wx/filepicker.h>
#include <wx/collpane.h>
#include <boost/signals2.hpp>
-#include "lib/trim_action.h"
#include "lib/film.h"
class Film;
void bottom_crop_changed (wxCommandEvent &);
void content_changed (wxCommandEvent &);
void format_changed (wxCommandEvent &);
- void dcp_range_changed (int, TrimAction);
+ void dcp_range_changed (int);
void dcp_content_type_changed (wxCommandEvent &);
void dcp_ab_toggled (wxCommandEvent &);
void scaler_changed (wxCommandEvent &);