2001-08-16 22:13:20 +00:00
|
|
|
|
2002-02-23 15:12:55 +00:00
|
|
|
#ifndef _MP_MSG_H
|
|
|
|
#define _MP_MSG_H
|
|
|
|
|
2001-08-17 00:39:49 +00:00
|
|
|
extern int verbose; // defined in mplayer.c
|
|
|
|
|
2001-08-16 22:13:20 +00:00
|
|
|
// verbosity elevel:
|
|
|
|
|
2001-08-17 00:39:49 +00:00
|
|
|
// stuff from level MSGL_FATAL-MSGL_HINT should be translated.
|
|
|
|
|
2001-08-16 22:13:20 +00:00
|
|
|
#define MSGL_FATAL 0 // will exit/abort
|
2001-08-16 22:39:46 +00:00
|
|
|
#define MSGL_ERR 1 // continues
|
2001-08-16 22:13:20 +00:00
|
|
|
#define MSGL_WARN 2 // only warning
|
2001-08-17 00:39:49 +00:00
|
|
|
#define MSGL_HINT 3 // short help message
|
|
|
|
#define MSGL_INFO 4 // -quiet
|
|
|
|
#define MSGL_STATUS 5 // v=0
|
|
|
|
#define MSGL_V 6 // v=1
|
|
|
|
#define MSGL_DBG2 7 // v=2
|
|
|
|
#define MSGL_DBG3 8 // v=3
|
|
|
|
#define MSGL_DBG4 9 // v=4
|
2001-08-16 22:13:20 +00:00
|
|
|
|
|
|
|
// code/module:
|
|
|
|
|
2001-08-17 00:39:49 +00:00
|
|
|
#define MSGT_GLOBAL 0 // common player stuff errors
|
|
|
|
#define MSGT_CPLAYER 1 // console player (mplayer.c)
|
2001-08-16 22:13:20 +00:00
|
|
|
#define MSGT_GPLAYER 2 // gui player
|
|
|
|
|
|
|
|
#define MSGT_VO 3 // libvo
|
|
|
|
#define MSGT_AO 4 // libao
|
|
|
|
|
|
|
|
#define MSGT_DEMUXER 5 // demuxer.c (general stuff)
|
|
|
|
#define MSGT_DS 6 // demux stream (add/read packet etc)
|
|
|
|
#define MSGT_DEMUX 7 // fileformat-specific stuff (demux_*.c)
|
2001-08-16 22:39:46 +00:00
|
|
|
#define MSGT_HEADER 8 // fileformat-specific header (*header.c)
|
2001-08-16 22:13:20 +00:00
|
|
|
|
2001-08-17 00:39:49 +00:00
|
|
|
#define MSGT_AVSYNC 9 // mplayer.c timer stuff
|
|
|
|
#define MSGT_AUTOQ 10 // mplayer.c auto-quality stuff
|
|
|
|
|
|
|
|
#define MSGT_CFGPARSER 11 // cfgparser.c
|
|
|
|
|
|
|
|
#define MSGT_DECAUDIO 12 // av decoder
|
|
|
|
#define MSGT_DECVIDEO 13
|
|
|
|
|
|
|
|
#define MSGT_SEEK 14 // seeking code
|
|
|
|
#define MSGT_WIN32 15 // win32 dll stuff
|
|
|
|
#define MSGT_OPEN 16 // open.c (stream opening)
|
2001-08-20 20:14:10 +00:00
|
|
|
#define MSGT_DVD 17 // open.c (DVD init/read/seek)
|
2001-08-17 00:39:49 +00:00
|
|
|
|
2001-09-26 21:35:14 +00:00
|
|
|
#define MSGT_PARSEES 18 // parse_es.c (mpeg stream parser)
|
2002-03-19 13:30:16 +00:00
|
|
|
#define MSGT_LIRC 19 // lirc_mp.c and input lirc driver
|
2001-09-26 21:35:14 +00:00
|
|
|
|
|
|
|
#define MSGT_STREAM 20 // stream.c
|
2001-11-09 22:04:09 +00:00
|
|
|
#define MSGT_CACHE 21 // cache2.c
|
2001-09-26 21:35:14 +00:00
|
|
|
|
2001-11-02 01:35:27 +00:00
|
|
|
#define MSGT_MENCODER 22
|
|
|
|
|
2001-11-09 22:04:09 +00:00
|
|
|
#define MSGT_XACODEC 23 // XAnim codecs
|
|
|
|
|
|
|
|
#define MSGT_TV 24 // TV input subsystem
|
|
|
|
|
2001-11-23 16:09:05 +00:00
|
|
|
#define MSGT_OSDEP 25 // OS Dependant parts (linux/ for now)
|
|
|
|
|
2001-12-28 01:09:28 +00:00
|
|
|
#define MSGT_SPUDEC 26 // spudec.c
|
|
|
|
|
2002-01-08 01:52:11 +00:00
|
|
|
#define MSGT_PLAYTREE 27 // Playtree handeling (playtree.c, playtreeparser.c)
|
|
|
|
|
2002-03-19 13:30:16 +00:00
|
|
|
#define MSGT_INPUT 28
|
|
|
|
|
2002-04-06 22:00:27 +00:00
|
|
|
#define MSGT_VFILTER 29
|
|
|
|
|
2001-08-16 22:13:20 +00:00
|
|
|
#define MSGT_MAX 64
|
|
|
|
|
2002-03-20 15:14:59 +00:00
|
|
|
void mp_msg_init();
|
|
|
|
void mp_msg_set_level(int verbose);
|
2001-08-16 22:13:20 +00:00
|
|
|
|
2002-03-15 21:07:48 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-03-23 20:56:34 +00:00
|
|
|
#ifdef TARGET_OS2
|
|
|
|
// va_start/vsnprintf seems to be broken under OS2 :(
|
|
|
|
#define mp_msg(mod,lev, fmt, args... ) do{if(lev<=mp_msg_levels[mod]) printf( fmt, ## args );}while(0)
|
|
|
|
#define mp_dbg(mod,lev, args... )
|
|
|
|
#else
|
|
|
|
|
2002-03-15 21:07:48 +00:00
|
|
|
#ifdef USE_I18N
|
|
|
|
#include <libintl.h>
|
2002-03-20 15:14:59 +00:00
|
|
|
#include <locale.h>
|
2002-03-15 21:07:48 +00:00
|
|
|
#define mp_gettext(String) gettext(String)
|
|
|
|
#else
|
|
|
|
#define mp_gettext(String) String
|
|
|
|
#endif
|
2001-08-17 07:26:07 +00:00
|
|
|
|
2002-03-23 20:56:34 +00:00
|
|
|
void mp_msg_c( int x, const char *format, ... );
|
|
|
|
|
2001-08-17 07:26:07 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define mp_msg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
|
2001-08-16 22:13:20 +00:00
|
|
|
|
2001-08-17 00:39:49 +00:00
|
|
|
#ifdef MP_DEBUG
|
2001-08-17 07:26:07 +00:00
|
|
|
#define mp_dbg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
|
2001-08-17 00:39:49 +00:00
|
|
|
#else
|
|
|
|
// these messages are only usefull for developers, disable them
|
2001-08-17 07:26:07 +00:00
|
|
|
#define mp_dbg(mod,lev, args... )
|
|
|
|
#endif
|
|
|
|
#else // not GNU C
|
|
|
|
#define mp_msg(mod,lev, ... ) mp_msg_c((mod<<8)|lev, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef MP_DEBUG
|
|
|
|
#define mp_dbg(mod,lev, ... ) mp_msg_c((mod<<8)|lev, __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
// these messages are only usefull for developers, disable them
|
|
|
|
#define mp_dbg(mod,lev, ... )
|
|
|
|
#endif
|
2001-08-17 00:39:49 +00:00
|
|
|
#endif
|
2002-02-23 15:12:55 +00:00
|
|
|
|
|
|
|
#endif
|
2002-03-23 20:56:34 +00:00
|
|
|
#endif
|