summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-05-03 22:10:21 +0000
committerCarl Hetherington <cth@carlh.net>2019-05-03 22:10:21 +0000
commitafa7b7e7240198d86146e6fe8c7911e049ee4f95 (patch)
treeac270610fc85f6e00a37eafea375479af97ad45a /src
parent760f2801c37ffd772e41dd3991be3da51fdba242 (diff)
Disallow unsetting the frame rate on FFmpeg/DCP content (#1547).
Diffstat (limited to 'src')
-rw-r--r--src/wx/timing_panel.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index 7e7dd6fbd..f10815ca4 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -33,6 +33,8 @@
#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>
@@ -463,7 +465,22 @@ TimingPanel::play_length_changed ()
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