summaryrefslogtreecommitdiff
path: root/src/wx/timing_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-11 21:05:56 +0200
committerCarl Hetherington <cth@carlh.net>2025-05-11 21:05:56 +0200
commit72f6f3de6a098cc74394e047aaa3fa5f9f44aa83 (patch)
tree0f83898e07b18f18694a09e2209e8418454bab19 /src/wx/timing_panel.cc
parenta98f6e4f84d02b87ba05cecfcc3005858f274afa (diff)
Use case for property checks now that it's possible.
This would have prevented the bug fixed in 6bbf7dee.
Diffstat (limited to 'src/wx/timing_panel.cc')
-rw-r--r--src/wx/timing_panel.cc47
1 files changed, 24 insertions, 23 deletions
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index 482b1ce9c..8619b7e2f 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -224,8 +224,9 @@ TimingPanel::film_content_changed (int property)
properties, and fill the controls with that value if so.
*/
- if (property == ContentProperty::POSITION) {
-
+ switch (property) {
+ case ContentProperty::POSITION:
+ {
set<DCPTime> check;
for (auto i: _parent->selected()) {
check.insert (i->position ());
@@ -236,17 +237,15 @@ TimingPanel::film_content_changed (int property)
} else {
_position->clear ();
}
-
- } else if (
- property == ContentProperty::LENGTH ||
- property == ContentProperty::VIDEO_FRAME_RATE ||
- property == VideoContentProperty::FRAME_TYPE
- ) {
-
+ break;
+ }
+ case ContentProperty::LENGTH:
+ case ContentProperty::VIDEO_FRAME_RATE:
+ case VideoContentProperty::FRAME_TYPE:
update_full_length ();
-
- } else if (property == ContentProperty::TRIM_START) {
-
+ break;
+ case ContentProperty::TRIM_START:
+ {
set<ContentTime> check;
for (auto i: _parent->selected()) {
check.insert (i->trim_start ());
@@ -257,9 +256,10 @@ TimingPanel::film_content_changed (int property)
} else {
_trim_start->clear ();
}
-
- } else if (property == ContentProperty::TRIM_END) {
-
+ break;
+ }
+ case ContentProperty::TRIM_END:
+ {
set<ContentTime> check;
for (auto i: _parent->selected()) {
check.insert (i->trim_end ());
@@ -270,17 +270,18 @@ TimingPanel::film_content_changed (int property)
} else {
_trim_end->clear ();
}
+ break;
+ }
}
- if (
- property == ContentProperty::LENGTH ||
- property == ContentProperty::TRIM_START ||
- property == ContentProperty::TRIM_END ||
- property == ContentProperty::VIDEO_FRAME_RATE ||
- property == VideoContentProperty::FRAME_TYPE
- ) {
-
+ switch (property) {
+ case ContentProperty::LENGTH:
+ case ContentProperty::TRIM_START:
+ case ContentProperty::TRIM_END:
+ case ContentProperty::VIDEO_FRAME_RATE:
+ case VideoContentProperty::FRAME_TYPE:
update_play_length ();
+ break;
}
if (property == ContentProperty::VIDEO_FRAME_RATE) {