[vlc-commits] macosx: update OSD message display

Felix Paul Kühne git at videolan.org
Mon Mar 25 17:11:19 CET 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Mon Mar 25 16:46:15 2019 +0100| [317be084523486d3d087fb89f6928b85e912274b] | committer: Felix Paul Kühne

macosx: update OSD message display

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=317be084523486d3d087fb89f6928b85e912274b
---

 .../macosx/coreinteraction/VLCCoreInteraction.m    | 25 +++++-----------------
 modules/gui/macosx/playlist/VLCPlayerController.h  |  5 +++++
 modules/gui/macosx/playlist/VLCPlayerController.m  |  5 +++++
 3 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/modules/gui/macosx/coreinteraction/VLCCoreInteraction.m b/modules/gui/macosx/coreinteraction/VLCCoreInteraction.m
index 0ec106ef3c..3805742f18 100644
--- a/modules/gui/macosx/coreinteraction/VLCCoreInteraction.m
+++ b/modules/gui/macosx/coreinteraction/VLCCoreInteraction.m
@@ -386,9 +386,9 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
         return;
     }
     if (on) {
-        vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Random On"));
+        [_playerController displayOSDMessage:_NS("Random On")];
     } else {
-        vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Random Off"));
+        [_playerController displayOSDMessage:_NS("Random Off")];
     }
 
     vout_Release(p_vout);
@@ -397,34 +397,19 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 - (void)repeatAll
 {
     _playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_ALL;
-
-    vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
-    if (p_vout) {
-        vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Repeat All"));
-        vout_Release(p_vout);
-    }
+    [_playerController displayOSDMessage:_NS("Repeat All")];
 }
 
 - (void)repeatOne
 {
     _playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT;
-
-    vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
-    if (p_vout) {
-        vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Repeat One"));
-        vout_Release(p_vout);
-    }
+    [_playerController displayOSDMessage:_NS("Repeat One")];
 }
 
 - (void)repeatOff
 {
     _playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_NONE;
-
-    vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
-    if (p_vout) {
-        vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Repeat Off"));
-        vout_Release(p_vout);
-    }
+    [_playerController displayOSDMessage:_NS("Repeat Off")];
 }
 
 - (void)setAtoB
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.h b/modules/gui/macosx/playlist/VLCPlayerController.h
index aac55005be..fd87fee484 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.h
+++ b/modules/gui/macosx/playlist/VLCPlayerController.h
@@ -569,6 +569,11 @@ extern NSString *VLCPlayerMuteChanged;
  */
 - (void)takeSnapshot;
 
+/**
+ * displays a OSD message format string
+ */
+- (void)displayOSDMessage:(NSString *)message;
+
 #pragma mark - audio output properties
 
 /**
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m b/modules/gui/macosx/playlist/VLCPlayerController.m
index 5d899b7805..1b61f218aa 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -1218,6 +1218,11 @@ static const struct vlc_player_aout_cbs player_aout_callbacks = {
     return vouts;
 }
 
+- (void)displayOSDMessage:(NSString *)message
+{
+    vlc_player_vout_OSDMessage(_p_player, [message UTF8String]);
+}
+
 #pragma mark - audio specific delegation
 
 - (void)volumeChanged:(float)volume



More information about the vlc-commits mailing list