summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-29 09:53:28 +0200
committerwm4 <wm4@nowhere>2012-10-16 07:26:31 +0200
commite62b3a175016eaf93ef5ead7ea3891bc85327a55 (patch)
tree996ff027533a55d53f92cc7ae454c980d2690821 /sub
parentef43d7701d2ae26227fad403e48a03cf2aea0ab0 (diff)
downloadmpv-e62b3a175016eaf93ef5ead7ea3891bc85327a55.tar.bz2
mpv-e62b3a175016eaf93ef5ead7ea3891bc85327a55.tar.xz
sub: cosmetics: turn some defines into enums
Diffstat (limited to 'sub')
-rw-r--r--sub/osd_libass.c3
-rw-r--r--sub/sub.h59
2 files changed, 34 insertions, 28 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 2d596a6516..6c325642c5 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -35,9 +35,6 @@ static const char osd_font_pfb[] =
#include "mp_core.h"
-// Map OSD symbols (e.g. OSD_PLAY) to the glyphs in osd_font_pfb[].
-#define OSD_CODEPOINTS 0xE000
-
// NOTE: \fs-5 to reduce the size of the symbols in relation to normal text.
// Done because libass doesn't center characters that are too high.
#define ASS_USE_OSD_FONT "{\\fnOSD\\fs-5}"
diff --git a/sub/sub.h b/sub/sub.h
index 7deaf73b8e..ceecce4017 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -26,13 +26,15 @@
struct vo;
-#define OSDTYPE_ASS 0
-#define OSDTYPE_OSD 1
-#define OSDTYPE_SUBTITLE 2
-#define OSDTYPE_PROGBAR 3
-#define OSDTYPE_SPU 4
-
-#define MAX_OSD_PARTS 5
+enum mp_osdtype {
+ OSDTYPE_ASS,
+ OSDTYPE_OSD,
+ OSDTYPE_SUBTITLE,
+ OSDTYPE_PROGBAR,
+ OSDTYPE_SPU,
+
+ MAX_OSD_PARTS
+};
#define OSD_CONV_CACHE_MAX 3
@@ -91,24 +93,31 @@ extern int vo_osd_progbar_value; // 0..255
extern void* vo_spudec;
extern void* vo_vobsub;
-#define OSD_PLAY 0x01
-#define OSD_PAUSE 0x02
-#define OSD_STOP 0x03
-#define OSD_REW 0x04
-#define OSD_FFW 0x05
-#define OSD_CLOCK 0x06
-#define OSD_CONTRAST 0x07
-#define OSD_SATURATION 0x08
-#define OSD_VOLUME 0x09
-#define OSD_BRIGHTNESS 0x0A
-#define OSD_HUE 0x0B
-#define OSD_BALANCE 0x0C
-#define OSD_PANSCAN 0x50
-
-#define OSD_PB_START 0x10
-#define OSD_PB_0 0x11
-#define OSD_PB_END 0x12
-#define OSD_PB_1 0x13
+// Start of OSD symbols in osd_font.pfb
+#define OSD_CODEPOINTS 0xE000
+
+// OSD symbols. osd_font.pfb has them starting from codepoint OSD_CODEPOINTS.
+// Symbols with a value >= 32 are normal unicode codepoints.
+enum mp_osd_font_codepoints {
+ OSD_PLAY = 0x01,
+ OSD_PAUSE = 0x02,
+ OSD_STOP = 0x03,
+ OSD_REW = 0x04,
+ OSD_FFW = 0x05,
+ OSD_CLOCK = 0x06,
+ OSD_CONTRAST = 0x07,
+ OSD_SATURATION = 0x08,
+ OSD_VOLUME = 0x09,
+ OSD_BRIGHTNESS = 0x0A,
+ OSD_HUE = 0x0B,
+ OSD_BALANCE = 0x0C,
+ OSD_PANSCAN = 0x50,
+
+ OSD_PB_START = 0x10,
+ OSD_PB_0 = 0x11,
+ OSD_PB_END = 0x12,
+ OSD_PB_1 = 0x13,
+};
/* now in textform */
extern char * const sub_osd_names[];