Bläddra i källkod

Fix 'hue' variable type

Felix Paul Kühne 9 år sedan
förälder
incheckning
1c2aaca710
2 ändrade filer med 9 tillägg och 7 borttagningar
  1. 2 2
      Headers/Public/VLCMediaPlayer.h
  2. 7 5
      Sources/VLCMediaPlayer.m

+ 2 - 2
Headers/Public/VLCMediaPlayer.h

@@ -223,9 +223,9 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
 /**
  * Set/Get the adjust filter's hue value
  *
- * \param integer value (range: 0-360, default: 0)
+ * \param float value (range: -180-180, default: 0.)
  */
-@property (nonatomic)  int hue;
+@property (nonatomic)  float hue;
 /**
  * Set/Get the adjust filter's saturation value
  *

+ 7 - 5
Sources/VLCMediaPlayer.m

@@ -585,18 +585,20 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
         libvlc_video_set_adjust_float(_playerInstance, libvlc_adjust_Brightness, f_value);
     }
 }
-- (int)hue
+
+- (float)hue
 {
     libvlc_video_set_adjust_int(_playerInstance, libvlc_adjust_Enable, 1);
-    return libvlc_video_get_adjust_int(_playerInstance, libvlc_adjust_Hue);
+    return libvlc_video_get_adjust_float(_playerInstance, libvlc_adjust_Hue);
 }
-- (void)setHue:(int)i_value
+- (void)setHue:(float)f_value
 {
-    if (i_value <= 360 && i_value >= 0) {
+    if (f_value <= 180. && f_value >= -180.) {
         libvlc_video_set_adjust_int(_playerInstance, libvlc_adjust_Enable, 1);
-        libvlc_video_set_adjust_int(_playerInstance, libvlc_adjust_Hue, i_value);
+        libvlc_video_set_adjust_float(_playerInstance, libvlc_adjust_Hue, f_value);
     }
 }
+
 - (float)saturation
 {
     libvlc_video_set_adjust_int(_playerInstance, libvlc_adjust_Enable, 1);