From 34fa9ee1f0a8b30d5ae0a033924c9ae671a8342c Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 21 Oct 2016 14:43:00 +0200 Subject: 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. --- macosx/HBVideoController.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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"]) { -- cgit v1.2.3