mp_msg.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * This file is part of MPlayer.
  3. *
  4. * MPlayer is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * MPlayer is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with MPlayer; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef MPLAYER_MP_MSG_H
  19. #define MPLAYER_MP_MSG_H
  20. #include <stdarg.h>
  21. // defined in mplayer.c and mencoder.c
  22. extern int verbose;
  23. // verbosity elevel:
  24. /* Only messages level MSGL_FATAL-MSGL_STATUS should be translated,
  25. * messages level MSGL_V and above should not be translated. */
  26. #define MSGL_FATAL 0 // will exit/abort
  27. #define MSGL_ERR 1 // continues
  28. #define MSGL_WARN 2 // only warning
  29. #define MSGL_HINT 3 // short help message
  30. #define MSGL_INFO 4 // -quiet
  31. #define MSGL_STATUS 5 // v=0
  32. #define MSGL_V 6 // v=1
  33. #define MSGL_DBG2 7 // v=2
  34. #define MSGL_DBG3 8 // v=3
  35. #define MSGL_DBG4 9 // v=4
  36. #define MSGL_DBG5 10 // v=5
  37. #define MSGL_FIXME 1 // for conversions from printf where the appropriate MSGL is not known; set equal to ERR for obtrusiveness
  38. #define MSGT_FIXME 0 // for conversions from printf where the appropriate MSGT is not known; set equal to GLOBAL for obtrusiveness
  39. // code/module:
  40. #define MSGT_GLOBAL 0 // common player stuff errors
  41. #define MSGT_CPLAYER 1 // console player (mplayer.c)
  42. #define MSGT_GPLAYER 2 // gui player
  43. #define MSGT_VO 3 // libvo
  44. #define MSGT_AO 4 // libao
  45. #define MSGT_DEMUXER 5 // demuxer.c (general stuff)
  46. #define MSGT_DS 6 // demux stream (add/read packet etc)
  47. #define MSGT_DEMUX 7 // fileformat-specific stuff (demux_*.c)
  48. #define MSGT_HEADER 8 // fileformat-specific header (*header.c)
  49. #define MSGT_AVSYNC 9 // mplayer.c timer stuff
  50. #define MSGT_AUTOQ 10 // mplayer.c auto-quality stuff
  51. #define MSGT_CFGPARSER 11 // cfgparser.c
  52. #define MSGT_DECAUDIO 12 // av decoder
  53. #define MSGT_DECVIDEO 13
  54. #define MSGT_SEEK 14 // seeking code
  55. #define MSGT_WIN32 15 // win32 dll stuff
  56. #define MSGT_OPEN 16 // open.c (stream opening)
  57. #define MSGT_DVD 17 // open.c (DVD init/read/seek)
  58. #define MSGT_PARSEES 18 // parse_es.c (mpeg stream parser)
  59. #define MSGT_LIRC 19 // lirc_mp.c and input lirc driver
  60. #define MSGT_STREAM 20 // stream.c
  61. #define MSGT_CACHE 21 // cache2.c
  62. #define MSGT_MENCODER 22
  63. #define MSGT_XACODEC 23 // XAnim codecs
  64. #define MSGT_TV 24 // TV input subsystem
  65. #define MSGT_OSDEP 25 // OS-dependent parts
  66. #define MSGT_SPUDEC 26 // spudec.c
  67. #define MSGT_PLAYTREE 27 // Playtree handeling (playtree.c, playtreeparser.c)
  68. #define MSGT_INPUT 28
  69. #define MSGT_VFILTER 29
  70. #define MSGT_OSD 30
  71. #define MSGT_NETWORK 31
  72. #define MSGT_CPUDETECT 32
  73. #define MSGT_CODECCFG 33
  74. #define MSGT_SWS 34
  75. #define MSGT_VOBSUB 35
  76. #define MSGT_SUBREADER 36
  77. #define MSGT_AFILTER 37 // Audio filter messages
  78. #define MSGT_NETST 38 // Netstream
  79. #define MSGT_MUXER 39 // muxer layer
  80. #define MSGT_OSD_MENU 40
  81. #define MSGT_IDENTIFY 41 // -identify output
  82. #define MSGT_RADIO 42
  83. #define MSGT_ASS 43 // libass messages
  84. #define MSGT_LOADER 44 // dll loader messages
  85. #define MSGT_STATUSLINE 45 // playback/encoding status line
  86. #define MSGT_TELETEXT 46 // Teletext decoder
  87. #define MSGT_MAX 64
  88. extern char *mp_msg_charset;
  89. extern int mp_msg_color;
  90. extern int mp_msg_module;
  91. extern int mp_msg_levels[MSGT_MAX];
  92. extern int mp_msg_level_all;
  93. void mp_msg_init(void);
  94. int mp_msg_test(int mod, int lev);
  95. #include "config.h"
  96. void mp_msg_va(int mod, int lev, const char *format, va_list va);
  97. #ifdef __GNUC__
  98. void mp_msg(int mod, int lev, const char *format, ... ) __attribute__ ((format (printf, 3, 4)));
  99. # ifdef MP_DEBUG
  100. # define mp_dbg(mod,lev, args... ) mp_msg(mod, lev, ## args )
  101. # else
  102. # define mp_dbg(mod,lev, args... ) /* only useful for developers */
  103. # endif
  104. #else // not GNU C
  105. void mp_msg(int mod, int lev, const char *format, ... );
  106. # ifdef MP_DEBUG
  107. # define mp_dbg(mod,lev, ... ) mp_msg(mod, lev, __VA_ARGS__)
  108. # else
  109. # define mp_dbg(mod,lev, ... ) /* only useful for developers */
  110. # endif
  111. #endif /* __GNUC__ */
  112. const char* filename_recode(const char* filename);
  113. #endif /* MPLAYER_MP_MSG_H */