summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-11-04 01:15:31 +0000
committerCarl Hetherington <cth@carlh.net>2012-11-04 01:15:31 +0000
commitfad1998b907232b01a46369a49b55129149613bb (patch)
treed6a330ec0d27d76480acbd4eac849c91e053fe20 /src
parent09fcd95ff5125d7238188c59aa40430acb45ecbc (diff)
Remove trim action settings.
Diffstat (limited to 'src')
-rw-r--r--src/lib/decoder.cc4
-rw-r--r--src/lib/film.cc44
-rw-r--r--src/lib/film.h10
-rw-r--r--src/lib/options.h2
-rw-r--r--src/lib/trim_action.h28
-rw-r--r--src/wx/dcp_range_dialog.cc28
-rw-r--r--src/wx/dcp_range_dialog.h6
-rw-r--r--src/wx/film_editor.cc9
-rw-r--r--src/wx/film_editor.h3
9 files changed, 5 insertions, 129 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 6f5d63358..32d0bab64 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -300,10 +300,6 @@ Decoder::process_video (AVFrame* frame)
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 ();
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 9c351a64d..70c8f7db2 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -82,7 +82,6 @@ Film::Film (string d, bool must_exist)
, _dcp_content_type (0)
, _format (0)
, _scaler (Scaler::from_id ("bicubic"))
- , _dcp_trim_action (CUT)
, _dcp_ab (false)
, _audio_stream (-1)
, _audio_gain (0)
@@ -143,7 +142,6 @@ Film::Film (Film const & o)
, _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)
@@ -254,21 +252,6 @@ Film::make_dcp (bool transcode)
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 ();
@@ -420,17 +403,6 @@ Film::write_metadata () const
}
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";
@@ -514,12 +486,6 @@ Film::read_metadata ()
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") {
@@ -1066,16 +1032,6 @@ Film::unset_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)
{
{
diff --git a/src/lib/film.h b/src/lib/film.h
index f3ddc652a..ff312fcb5 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -38,7 +38,6 @@ extern "C" {
#include "dcp_content_type.h"
#include "util.h"
#include "stream.h"
-#include "trim_action.h"
class Format;
class Job;
@@ -119,7 +118,6 @@ public:
FILTERS,
SCALER,
DCP_FRAMES,
- DCP_TRIM_ACTION,
DCP_AB,
AUDIO_STREAM,
AUDIO_GAIN,
@@ -193,11 +191,6 @@ public:
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;
@@ -353,7 +346,6 @@ public:
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);
@@ -426,8 +418,6 @@ private:
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.
diff --git a/src/lib/options.h b/src/lib/options.h
index 86db35210..d8b99815d 100644
--- a/src/lib/options.h
+++ b/src/lib/options.h
@@ -39,7 +39,6 @@ public:
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)
@@ -97,7 +96,6 @@ public:
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;
diff --git a/src/lib/trim_action.h b/src/lib/trim_action.h
deleted file mode 100644
index 405d31bbc..000000000
--- a/src/lib/trim_action.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- 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
diff --git a/src/wx/dcp_range_dialog.cc b/src/wx/dcp_range_dialog.cc
index 509db121e..5ecd3168e 100644
--- a/src/wx/dcp_range_dialog.cc
+++ b/src/wx/dcp_range_dialog.cc
@@ -43,14 +43,6 @@ DCPRangeDialog::DCPRangeDialog (wxWindow* p, shared_ptr<Film> f)
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);
@@ -62,12 +54,8 @@ DCPRangeDialog::DCPRangeDialog (wxWindow* p, shared_ptr<Film> f)
_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);
@@ -102,15 +90,6 @@ void
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
@@ -127,10 +106,5 @@ DCPRangeDialog::emit_changed ()
frames = _n_frames->GetValue ();
}
- TrimAction action = CUT;
- if (_black_out->GetValue ()) {
- action = BLACK_OUT;
- }
-
- Changed (frames, action);
+ Changed (frames);
}
diff --git a/src/wx/dcp_range_dialog.h b/src/wx/dcp_range_dialog.h
index 2c5c3cec2..e3f875e51 100644
--- a/src/wx/dcp_range_dialog.h
+++ b/src/wx/dcp_range_dialog.h
@@ -20,7 +20,6 @@
#include <wx/wx.h>
#include <wx/spinctrl.h>
#include <boost/signals2.hpp>
-#include "lib/trim_action.h"
class Film;
@@ -29,12 +28,11 @@ class DCPRangeDialog : public wxDialog
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 ();
@@ -44,6 +42,4 @@ private:
wxRadioButton* _whole;
wxRadioButton* _first;
wxSpinCtrl* _n_frames;
- wxRadioButton* _cut;
- wxRadioButton* _black_out;
};
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index f8e914f20..8bcbd2beb 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -510,8 +510,6 @@ FilmEditor::film_changed (Film::Property p)
}
_sizer->Layout ();
break;
- case Film::DCP_TRIM_ACTION:
- break;
case Film::DCP_AB:
_dcp_ab->SetValue (_film->dcp_ab ());
break;
@@ -619,7 +617,6 @@ FilmEditor::set_film (shared_ptr<Film> f)
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);
@@ -767,20 +764,18 @@ void
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
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index 2d3659615..936dd7d6b 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -26,7 +26,6 @@
#include <wx/filepicker.h>
#include <wx/collpane.h>
#include <boost/signals2.hpp>
-#include "lib/trim_action.h"
#include "lib/film.h"
class Film;
@@ -55,7 +54,7 @@ private:
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 &);