[vlc-commits] player: add helper to toggle subtitles
Victorien Le Couviour--Tuffet
git at videolan.org
Tue Nov 27 13:16:16 CET 2018
vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Mon Nov 19 19:10:05 2018 +0100| [631c32341e08ed317c9eca1d89183af7b3853bb2] | committer: Thomas Guillem
player: add helper to toggle subtitles
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=631c32341e08ed317c9eca1d89183af7b3853bb2
---
include/vlc_player.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/vlc_player.h b/include/vlc_player.h
index ca59634e3d..78d78d29d3 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -1891,6 +1891,16 @@ vlc_player_IsSubtitleEnabled(vlc_player_t *player)
}
/**
+ * Helper to toggle subtitles
+ */
+static inline void
+vlc_player_ToggleSubtitle(vlc_player_t *player)
+{
+ bool enabled = !vlc_player_IsSubtitleEnabled(player);
+ return vlc_player_SetSubtitleEnabled(player, enabled);
+}
+
+/**
* Get the number of programs
*
* @warning The returned size becomes invalid when the player is unlocked.
More information about the vlc-commits
mailing list