summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-09 19:58:37 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit19f94521139aac13ef8fb4eaa55855b2ada307b4 (patch)
tree6e4b457c1fa46c674433fb1a5d2a9cd0f07c5a11 /src/wx
parent0a2d40420813403a96352c6dc895d23fcd9994c0 (diff)
Move video frame rate ('prepared-for') into Content.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_panel.cc2
-rw-r--r--src/wx/content_panel.cc2
-rw-r--r--src/wx/timing_panel.cc64
-rw-r--r--src/wx/video_panel.cc21
4 files changed, 31 insertions, 58 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index 28d81d07b..dad1981f4 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -170,7 +170,7 @@ AudioPanel::film_content_changed (int property)
}
setup_sensitivity ();
- } else if (property == AudioContentProperty::VIDEO_FRAME_RATE) {
+ } else if (property == ContentProperty::VIDEO_FRAME_RATE) {
setup_description ();
}
}
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index a591c72b3..200824189 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -334,7 +334,7 @@ ContentPanel::add_folder_clicked ()
return;
}
- ic->video->set_frame_rate (frame_rate);
+ ic->set_video_frame_rate (frame_rate);
}
_film->examine_and_add_content (content);
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index 8e253c070..2f909aefd 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -210,10 +210,8 @@ TimingPanel::film_content_changed (int property)
} else if (
property == ContentProperty::LENGTH ||
- property == VideoContentProperty::FRAME_RATE ||
- property == VideoContentProperty::FRAME_TYPE ||
- property == AudioContentProperty::VIDEO_FRAME_RATE ||
- property == SubtitleContentProperty::VIDEO_FRAME_RATE
+ property == ContentProperty::VIDEO_FRAME_RATE ||
+ property == VideoContentProperty::FRAME_TYPE
) {
update_full_length ();
@@ -249,48 +247,38 @@ TimingPanel::film_content_changed (int property)
property == ContentProperty::LENGTH ||
property == ContentProperty::TRIM_START ||
property == ContentProperty::TRIM_END ||
- property == VideoContentProperty::FRAME_RATE ||
- property == VideoContentProperty::FRAME_TYPE ||
- property == AudioContentProperty::VIDEO_FRAME_RATE ||
- property == SubtitleContentProperty::VIDEO_FRAME_RATE
+ property == ContentProperty::VIDEO_FRAME_RATE ||
+ property == VideoContentProperty::FRAME_TYPE
) {
update_play_length ();
}
- if (property == VideoContentProperty::FRAME_RATE || property == SubtitleContentProperty::VIDEO_FRAME_RATE) {
+ if (property == ContentProperty::VIDEO_FRAME_RATE) {
set<double> check_vc;
- shared_ptr<const Content> vc;
+ shared_ptr<const Content> content;
int count_ac = 0;
- shared_ptr<const Content> ac;
int count_sc = 0;
- shared_ptr<const Content> sc;
BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
- if (i->video) {
- check_vc.insert (i->video->frame_rate ());
- vc = i;
+ if (i->video && i->video_frame_rate()) {
+ check_vc.insert (i->video_frame_rate().get());
+ content = i;
}
- if (i->audio) {
+ if (i->audio && i->video_frame_rate()) {
++count_ac;
- ac = i;
+ content = i;
}
- if (i->subtitle) {
+ if (i->subtitle && i->video_frame_rate()) {
++count_sc;
- sc = i;
+ content = i;
}
}
- bool const single_frame_image_content = vc && dynamic_pointer_cast<const ImageContent> (vc) && vc->number_of_paths() == 1;
+ bool const single_frame_image_content = content && dynamic_pointer_cast<const ImageContent> (content) && content->number_of_paths() == 1;
if ((check_vc.size() == 1 || count_ac == 1 || count_sc == 1) && !single_frame_image_content) {
- if (vc) {
- checked_set (_video_frame_rate, raw_convert<string> (vc->video->frame_rate (), 5));
- } else if (ac) {
- checked_set (_video_frame_rate, raw_convert<string> (ac->audio->video_frame_rate (), 5));
- } else if (sc) {
- checked_set (_video_frame_rate, raw_convert<string> (sc->subtitle->video_frame_rate (), 5));
- }
+ checked_set (_video_frame_rate, raw_convert<string> (content->video_frame_rate().get(), 5));
_video_frame_rate->Enable (true);
} else {
checked_set (_video_frame_rate, wxT (""));
@@ -401,22 +389,12 @@ TimingPanel::video_frame_rate_changed ()
void
TimingPanel::set_video_frame_rate ()
{
+ double const fr = raw_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
- shared_ptr<DCPSubtitleContent> dsc = dynamic_pointer_cast<DCPSubtitleContent> (i);
- shared_ptr<TextSubtitleContent> tsc = dynamic_pointer_cast<TextSubtitleContent> (i);
- double const fr = raw_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
- if (i->video) {
- i->video->set_frame_rate (fr);
- } else if (i->audio) {
- /* Audio but not video, i.e. SndfileContent */
- i->audio->set_video_frame_rate (fr);
- } else if (dsc) {
- dsc->subtitle->set_video_frame_rate (fr);
- } else if (tsc) {
- tsc->subtitle->set_video_frame_rate (fr);
- }
- _set_video_frame_rate->Enable (false);
+ i->set_video_frame_rate (fr);
}
+
+ _set_video_frame_rate->Enable (false);
}
void
@@ -428,9 +406,7 @@ TimingPanel::content_selection_changed ()
film_content_changed (ContentProperty::LENGTH);
film_content_changed (ContentProperty::TRIM_START);
film_content_changed (ContentProperty::TRIM_END);
- film_content_changed (VideoContentProperty::FRAME_RATE);
- film_content_changed (SubtitleContentProperty::VIDEO_FRAME_RATE);
- film_content_changed (AudioContentProperty::VIDEO_FRAME_RATE);
+ film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
}
void
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 28a26ce08..a8a1d98c8 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -273,13 +273,10 @@ VideoPanel::film_content_changed (int property)
fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
}
- if (property == VideoContentProperty::FRAME_TYPE) {
- setup_description ();
- } else if (property == VideoContentProperty::CROP) {
- setup_description ();
- } else if (property == VideoContentProperty::SCALE) {
- setup_description ();
- } else if (property == VideoContentProperty::FRAME_RATE) {
+ if (property == ContentProperty::VIDEO_FRAME_RATE ||
+ property == VideoContentProperty::FRAME_TYPE ||
+ property == VideoContentProperty::CROP ||
+ property == VideoContentProperty::SCALE) {
setup_description ();
} else if (property == VideoContentProperty::COLOUR_CONVERSION) {
if (vcs && vcs->video->colour_conversion ()) {
@@ -316,8 +313,8 @@ VideoPanel::film_content_changed (int property)
if (check.size() == 1) {
_fade_in->set (
- ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->video->frame_rate ()),
- vc.front()->video->frame_rate ()
+ ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->active_video_frame_rate ()),
+ vc.front()->active_video_frame_rate ()
);
} else {
_fade_in->clear ();
@@ -330,8 +327,8 @@ VideoPanel::film_content_changed (int property)
if (check.size() == 1) {
_fade_out->set (
- ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->video->frame_rate ()),
- vc.front()->video->frame_rate ()
+ ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->active_video_frame_rate ()),
+ vc.front()->active_video_frame_rate ()
);
} else {
_fade_out->clear ();
@@ -433,8 +430,8 @@ VideoPanel::content_selection_changed ()
_bottom_crop->set_content (video_sel);
_scale->set_content (video_sel);
+ film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
film_content_changed (VideoContentProperty::CROP);
- film_content_changed (VideoContentProperty::FRAME_RATE);
film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
film_content_changed (VideoContentProperty::FADE_IN);
film_content_changed (VideoContentProperty::FADE_OUT);