#include "lib/audio_content.h"
#include "lib/string_text_file_content.h"
#include "lib/video_content.h"
+#include "lib/dcp_content.h"
+#include "lib/ffmpeg_content.h"
#include <dcp/locale_convert.h>
#include <boost/foreach.hpp>
#include <set>
using boost::dynamic_pointer_cast;
using boost::optional;
using dcp::locale_convert;
+using namespace dcpomatic;
TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer)
/* horrid hack for apparent lack of context support with wxWidgets i18n code */
optional<FrameRateChange> ref_frc;
optional<DCPTime> ref_ph;
- ContentTime const trim = _trim_start->get (_parent->film()->video_frame_rate ());
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
if (i->position() <= ph && ph < i->end(_parent->film())) {
ref_ph = ph - i->position() + DCPTime (i->trim_start(), ref_frc.get());
}
+ ContentTime const trim = _trim_start->get (i->video_frame_rate().get_value_or(_parent->film()->video_frame_rate()));
i->set_trim_start (trim);
}
fv->set_coalesce_player_changes (true);
- ContentTime const trim = _trim_end->get (_parent->film()->video_frame_rate ());
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ ContentTime const trim = _trim_end->get (i->video_frame_rate().get_value_or(_parent->film()->video_frame_rate()));
i->set_trim_end (trim);
}
fv->seek (_parent->film()->length() - DCPTime::from_frames(1, _parent->film()->video_frame_rate()), true);
}
- fv->set_coalesce_player_changes (true);
+ fv->set_coalesce_player_changes (false);
}
void
void
TimingPanel::video_frame_rate_changed ()
{
- _set_video_frame_rate->Enable (true);
+ bool enable = true;
+ if (_video_frame_rate->GetValue() == wxT("")) {
+ /* No frame rate has been entered; if the user clicks "set" now it would unset the video
+ frame rate in the selected content. This can't be allowed for some content types.
+ */
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected()) {
+ if (
+ dynamic_pointer_cast<DCPContent>(i) ||
+ dynamic_pointer_cast<FFmpegContent>(i)
+ ) {
+ enable = false;
+ }
+ }
+ }
+
+ _set_video_frame_rate->Enable (enable);
}
void