summaryrefslogtreecommitdiffstats
path: root/macosx/HBVideoController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-10-21 14:43:00 +0200
committerDamiano Galassi <[email protected]>2016-10-21 14:43:00 +0200
commit34fa9ee1f0a8b30d5ae0a033924c9ae671a8342c (patch)
treea4bb34fb2754f68e1f74f5d601d29a9f9e52c6a5 /macosx/HBVideoController.m
parent2d41b000637475778a1ee198056f4f7c0b6646c6 (diff)
MacGui: use accessibilityValueDescription for the slider value description, and check if the method is available so it doesn't crash on 10.9-10.7.
Diffstat (limited to 'macosx/HBVideoController.m')
-rw-r--r--macosx/HBVideoController.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/macosx/HBVideoController.m b/macosx/HBVideoController.m
index eeb575ce1..355f24ad9 100644
--- a/macosx/HBVideoController.m
+++ b/macosx/HBVideoController.m
@@ -79,6 +79,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
[self addObserver:self forKeyPath:@"video.encoder" options:NSKeyValueObservingOptionInitial context:HBVideoControllerContext];
[self addObserver:self forKeyPath:@"video.frameRate" options:NSKeyValueObservingOptionInitial context:HBVideoControllerContext];
[self addObserver:self forKeyPath:@"video.quality" options:NSKeyValueObservingOptionInitial context:HBVideoControllerContext];
+ [self addObserver:self forKeyPath:@"video.preset" options:NSKeyValueObservingOptionInitial context:HBVideoControllerContext];
[self addObserver:self forKeyPath:@"video.unparseOptions" options:NSKeyValueObservingOptionInitial context:HBVideoControllerContext];
[self addObserver:self forKeyPath:@"video.advancedOptions" options:NSKeyValueObservingOptionInitial context:HBVideoControllerContext];
}
@@ -129,7 +130,17 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
}
else if ([keyPath isEqualToString:@"video.quality"])
{
- fVidQualitySlider.accessibilityValue = [NSString stringWithFormat:@"%@ %.2f", self.video.constantQualityLabel, self.video.quality];
+ if ([fVidQualitySlider respondsToSelector:@selector(setAccessibilityValueDescription:)])
+ {
+ fVidQualitySlider.accessibilityValueDescription = [NSString stringWithFormat:@"%@ %.2f", self.video.constantQualityLabel, self.video.quality];;
+ }
+ }
+ else if ([keyPath isEqualToString:@"video.preset"])
+ {
+ if ([fPresetsSlider respondsToSelector:@selector(setAccessibilityValueDescription:)])
+ {
+ fPresetsSlider.accessibilityValueDescription = self.video.preset;
+ }
}
else if ([keyPath isEqualToString:@"video.unparseOptions"])
{