+2017-01-04 Carl Hetherington <cth@carlh.net>
+
+ * Fix non frame-aligned trims when using the to-playhead
+ buttons.
+
+2016-12-25 Carl Hetherington <cth@carlh.net>
+
+ * Updated fr_FR translation from Thierry Journet.
+
2016-12-21 Carl Hetherington <cth@carlh.net>
* Add approximate finish time to progress on jobs (#927).
{
list<DCPTime> t;
/* XXX: this is questionable; perhaps the position itself should be forced to be on a frame boundary */
- t.push_back (position().round_up (film()->video_frame_rate()));
+ t.push_back (position().ceil (film()->video_frame_rate()));
return t;
}
* at some sampling rate.
* @param r Sampling rate.
*/
- Time<S, O> round_up (float r) const {
- Type const n = llrintf (HZ / r);
- Type const a = _t + n - 1;
- return Time<S, O> (a - (a % n));
+ Time<S, O> ceil (float r) const {
+ return Time<S, O> (llrint (HZ * frames_ceil(r) / double(r)));
+ }
+
+ Time<S, O> floor (float r) const {
+ return Time<S, O> (llrint (HZ * frames_floor(r) / double(r)));
}
double seconds () const {
template <typename T>
int64_t frames_floor (T r) const {
- return floor (_t * r / HZ);
+ return ::floor (_t * r / HZ);
}
template <typename T>
the calculation will round down before we get the chance
to ceil().
*/
- return ceil (_t * double(r) / HZ);
+ return ::ceil (_t * double(r) / HZ);
}
/** @param r Frames per second */
}
private:
- friend struct dcptime_round_up_test;
+ friend struct dcptime_ceil_test;
+ friend struct dcptime_floor_test;
Type _t;
static const int HZ = 96000;
/* Now adjust so that the video pts starts on a frame */
if (first_video) {
ContentTime const fvc = first_video.get() + po;
- po += fvc.round_up (video_frame_rate) - fvc;
+ po += fvc.ceil (video_frame_rate) - fvc;
}
return po;
Film::reels () const
{
list<DCPTimePeriod> p;
- DCPTime const len = length().round_up (video_frame_rate ());
+ DCPTime const len = length().ceil (video_frame_rate ());
switch (reel_type ()) {
case REELTYPE_SINGLE:
"Project-Id-Version: DCP-o-matic FRENCH\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-16 16:15+0000\n"
-"PO-Revision-Date: 2016-11-14 01:09+0100\n"
+"PO-Revision-Date: 2016-12-23 11:11+0100\n"
"Last-Translator: Grégoire AUSINA <gregoire@gisele-productions.eu>\n"
"Language-Team: \n"
"Language: fr_FR\n"
#: src/lib/colour_conversion.cc:288
msgid "S-Gamut3/S-Log3"
-msgstr ""
+msgstr "S-Gamut3/S-Log3"
#: src/lib/ffmpeg_content.cc:516 src/lib/ffmpeg_content.cc:535
msgid "SMPTE 170M (BT601)"
#: src/lib/ffmpeg_content.cc:565
msgid "SMPTE 2085, Y'D'zD'x"
-msgstr ""
+msgstr "SMPTE 2085, Y'D'zD'x"
#: src/lib/ffmpeg_content.cc:517 src/lib/ffmpeg_content.cc:536
#: src/lib/ffmpeg_content.cc:561
msgstr "SMPTE ST 428-1 (CIE 1931 XYZ)"
#: src/lib/ffmpeg_content.cc:521
-#, fuzzy
msgid "SMPTE ST 431-2 (2011)"
-msgstr "SMPTE ST 428-1"
+msgstr "SMPTE ST 431-2 (2011)"
#: src/lib/ffmpeg_content.cc:522
-#, fuzzy
msgid "SMPTE ST 432-1 D65 (2010)"
-msgstr "SMPTE ST 428-1"
+msgstr "SMPTE ST 432-1 D65 (2010)"
#: src/lib/scp_uploader.cc:56
msgid "SSH error (%1)"
"Project-Id-Version: DCP-o-matic FRENCH\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-16 16:15+0000\n"
-"PO-Revision-Date: 2016-11-14 01:12+0100\n"
+"PO-Revision-Date: 2016-12-23 11:18+0100\n"
"Last-Translator: Grégoire AUSINA <gregoire@gisele-productions.eu>\n"
"Language-Team: \n"
"Language: fr_FR\n"
msgstr "Serveurs d'encodage"
#: src/tools/dcpomatic_kdm.cc:276
-#, fuzzy, c-format
+#, c-format
msgid "File %s already exists. Do you want to overwrite it?"
-msgstr ""
-"Le répertoire %s existe déjà et n'est pas vide. Etes-vous sûr de vouloir "
-"l'utiliser ?"
+msgstr "Le fichier %s existe déjà. Etes-vous sûr de vouloir le remplacer ?"
#. / TRANSLATORS: this is the heading for a dialog box, which tells the user that the current
#. / project (Film) has been changed since it was last saved.
/*
- Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
t = new wxStaticText (
this, wxID_ANY,
- _("(C) 2012-2016 Carl Hetherington, Terrence Meiczinger\n Ole Laursen, Brecht Sanders"),
+ _("(C) 2012-2017 Carl Hetherington, Terrence Meiczinger\n Ole Laursen, Brecht Sanders"),
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
);
supported_by.Add (wxT ("Aditya Pratama"));
supported_by.Add (wxT ("Ceridwen Productions"));
supported_by.Add (wxT ("Ivan Pullman"));
+ supported_by.Add (wxT ("Arts Quest"));
supported_by.Add (wxT ("Desiderio Garcia Ramirez"));
supported_by.Add (wxT ("Steve Reverand"));
supported_by.Add (wxT ("Mark Rolfe"));
/*
- Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
void set_film (boost::shared_ptr<Film>);
+ /** @return our `playhead' position; this may not lie exactly on a frame boundary */
DCPTime position () const {
return _position;
}
"Project-Id-Version: DCP-o-matic FRENCH\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-16 16:15+0000\n"
-"PO-Revision-Date: 2016-11-14 01:09+0100\n"
+"PO-Revision-Date: 2016-12-23 11:17+0100\n"
"Last-Translator: Grégoire AUSINA <gregoire@gisele-productions.eu>\n"
"Language-Team: \n"
"Language: fr_FR\n"
msgstr "Qualité JPEG2000 par défaut"
#: src/wx/config_dialog.cc:463
-#, fuzzy
msgid "Default KDM directory"
-msgstr "Dossier de sortie par défaut"
+msgstr "Répertoire KDM par défaut"
#: src/wx/config_dialog.cc:451
msgid "Default audio delay"
#: src/wx/kdm_dialog.cc:132
msgid "File %s already exists. Do you want to overwrite it?"
-msgstr ""
+msgstr "Le fichier %s existe déjà. Voulez-vous le remplacer?"
#: src/wx/kdm_output_panel.cc:51
msgid "Filename format"
#: src/wx/colour_conversion_editor.cc:60
msgid "Gamma"
-msgstr ""
+msgstr "Gamma"
#: src/wx/colour_conversion_editor.cc:61
-#, fuzzy
msgid "Gamma, linearised for small values"
-msgstr "Linéariser la courbe d'entrée gamma pour les bas niveaux"
+msgstr "Gamma, linéarisée pour les bas niveaux"
#: src/wx/config_dialog.cc:1488 src/wx/content_properties_dialog.cc:70
msgid "General"
#: src/wx/colour_conversion_editor.cc:58
msgid "Input transfer function"
-msgstr ""
+msgstr "Fonction transfert d'entrée"
#: src/wx/audio_dialog.cc:351
#, c-format
msgstr "MXF-Interop"
#: src/wx/colour_conversion_editor.cc:203
-#, fuzzy
msgid "Inverse 2.6 gamma correction on output"
-msgstr "Correction gamma d'entrée"
+msgstr "Inversion de la correction gamma 2.6 en entrée"
#: src/wx/config_dialog.cc:227
msgid "Issuer"
msgid "NEEDS OV: "
msgstr "OV Nécessaire:"
-#: src/wx/cinema_dialog.cc:50 src/wx/dcp_panel.cc:72 src/wx/screen_dialog.cc:68
+#: src/wx/cinema_dialog.cc:50 src/wx/dcp_panel.cc:72
+#: src/wx/screen_dialog.cc:68
msgid "Name"
msgstr "Nom"
#: src/wx/image_subtitle_colour_dialog.cc:70
msgid "Restore to original colours"
-msgstr ""
+msgstr "Rétablir Couleurs originelles"
#: src/wx/normal_job_view.cc:56
msgid "Resume"
#: src/wx/colour_conversion_editor.cc:62
msgid "S-Gamut3"
-msgstr ""
+msgstr "S-Gamut3"
#: src/wx/config_dialog.cc:1168
msgid "SCP (for AAM and Doremi)"
"You cannot add a screen called '%s' as the cinema already has a screen with "
"this name."
msgstr ""
+"Vous ne pouvez pas ajouter un écran appelé '%s' car le cinéma possède déjà "
+"un écran appelé ainsi."
#: src/wx/screens_panel.cc:258
#, c-format
"You cannot change this screen's name to '%s' as the cinema already has a "
"screen with this name."
msgstr ""
+"Vous ne pouvez pas modifier le nom de l'écran en '%s' car le cinéma possède "
+"déjà un écran nommé ainsi."
#: src/wx/report_problem_dialog.cc:66
msgid "Your email address"
void
TimingPanel::trim_start_to_playhead_clicked ()
{
- DCPTime const ph = _viewer->position ();
+ shared_ptr<const Film> film = _parent->film ();
+ DCPTime const ph = _viewer->position().floor (film->video_frame_rate ());
optional<DCPTime> new_ph;
_viewer->set_coalesce_player_changes (true);
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
if (i->position() < ph && ph < i->end ()) {
- FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
+ FrameRateChange const frc = film->active_frame_rate_change (i->position ());
i->set_trim_start (i->trim_start() + ContentTime (ph - i->position (), frc));
new_ph = i->position ();
}
void
TimingPanel::trim_end_to_playhead_clicked ()
{
- DCPTime const ph = _viewer->position ();
+ shared_ptr<const Film> film = _parent->film ();
+ DCPTime const ph = _viewer->position().floor (film->video_frame_rate ());
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
if (i->position() < ph && ph < i->end ()) {
- FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
+ FrameRateChange const frc = film->active_frame_rate_change (i->position ());
i->set_trim_end (ContentTime (i->position() + i->full_length() - ph - DCPTime::from_frames (1, frc.dcp), frc) - i->trim_start());
}
}
BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
++i;
BOOST_CHECK_EQUAL (i->from.get(), 96000 * 3);
- BOOST_CHECK_EQUAL (i->to.get(), sub->full_length().round_up(film->video_frame_rate()).get());
+ BOOST_CHECK_EQUAL (i->to.get(), sub->full_length().ceil(film->video_frame_rate()).get());
}
/** Check creation of a multi-reel DCP with a single .srt subtitle file;
video_delay = ContentTime ();
}
- Frame const first_frame = video_delay.round_up (content->active_video_frame_rate ()).frames_round (content->active_video_frame_rate ());
+ Frame const first_frame = video_delay.ceil (content->active_video_frame_rate ()).frames_round (content->active_video_frame_rate ());
FFmpegDecoder decoder (content, film->log());
list<ContentVideo> a = decoder.video->get (first_frame, true);
BOOST_CHECK_THROW (digest_head_tail (p, 1024), OpenFileError);
}
-/* Straightforward test of DCPTime::round_up */
-BOOST_AUTO_TEST_CASE (dcptime_round_up_test)
+/* Straightforward test of DCPTime::ceil */
+BOOST_AUTO_TEST_CASE (dcptime_ceil_test)
{
- BOOST_CHECK_EQUAL (DCPTime(0).round_up(DCPTime::HZ / 2).get(), 0);
- BOOST_CHECK_EQUAL (DCPTime(1).round_up(DCPTime::HZ / 2).get(), 2);
- BOOST_CHECK_EQUAL (DCPTime(2).round_up(DCPTime::HZ / 2).get(), 2);
- BOOST_CHECK_EQUAL (DCPTime(3).round_up(DCPTime::HZ / 2).get(), 4);
+ BOOST_CHECK_EQUAL (DCPTime(0).ceil(DCPTime::HZ / 2).get(), 0);
+ BOOST_CHECK_EQUAL (DCPTime(1).ceil(DCPTime::HZ / 2).get(), 2);
+ BOOST_CHECK_EQUAL (DCPTime(2).ceil(DCPTime::HZ / 2).get(), 2);
+ BOOST_CHECK_EQUAL (DCPTime(3).ceil(DCPTime::HZ / 2).get(), 4);
- BOOST_CHECK_EQUAL (DCPTime(0).round_up(DCPTime::HZ / 42).get(), 0);
- BOOST_CHECK_EQUAL (DCPTime(1).round_up(DCPTime::HZ / 42).get(), 42);
- BOOST_CHECK_EQUAL (DCPTime(42).round_up(DCPTime::HZ / 42).get(), 42);
- BOOST_CHECK_EQUAL (DCPTime(43).round_up(DCPTime::HZ / 42).get(), 84);
+ BOOST_CHECK_EQUAL (DCPTime(0).ceil(DCPTime::HZ / 42).get(), 0);
+ BOOST_CHECK_EQUAL (DCPTime(1).ceil(DCPTime::HZ / 42).get(), 42);
+ BOOST_CHECK_EQUAL (DCPTime(42).ceil(DCPTime::HZ / 42).get(), 42);
+ BOOST_CHECK_EQUAL (DCPTime(43).ceil(DCPTime::HZ / 42).get(), 84);
/* Check that rounding up to non-integer frame rates works */
- BOOST_CHECK_EQUAL (DCPTime(45312).round_up(29.976).get(), 48045);
+ BOOST_CHECK_EQUAL (DCPTime(45312).ceil(29.976).get(), 48038);
+}
+
+/* Straightforward test of DCPTime::floor */
+BOOST_AUTO_TEST_CASE (dcptime_floor_test)
+{
+ BOOST_CHECK_EQUAL (DCPTime(0).floor(DCPTime::HZ / 2).get(), 0);
+ BOOST_CHECK_EQUAL (DCPTime(1).floor(DCPTime::HZ / 2).get(), 0);
+ BOOST_CHECK_EQUAL (DCPTime(2).floor(DCPTime::HZ / 2).get(), 2);
+ BOOST_CHECK_EQUAL (DCPTime(3).floor(DCPTime::HZ / 2).get(), 2);
+
+ BOOST_CHECK_EQUAL (DCPTime(0).floor(DCPTime::HZ / 42).get(), 0);
+ BOOST_CHECK_EQUAL (DCPTime(1).floor(DCPTime::HZ / 42).get(), 0);
+ BOOST_CHECK_EQUAL (DCPTime(42).floor(DCPTime::HZ / 42.0).get(), 42);
+ BOOST_CHECK_EQUAL (DCPTime(43).floor(DCPTime::HZ / 42.0).get(), 42);
+
+ /* Check that rounding down to non-integer frame rates works */
+ BOOST_CHECK_EQUAL (DCPTime(45312).floor(29.976).get(), 44836);
}
BOOST_AUTO_TEST_CASE (timecode_test)