player: merge mp_osd.h into mp_core.h

Just doing this because mp_osd.h and osd.c is not consistent.

There are some other header files (command.h and screenshot.h), but
since I don't feel too good about inflating mp_core.h, I'm not merging
them, at least not yet.
This commit is contained in:
wm4 2013-10-30 21:47:14 +01:00
parent fdd1b8cac1
commit 2ccc3721ef
7 changed files with 33 additions and 59 deletions

View File

@ -45,7 +45,6 @@
#include "mpvcore/m_config.h"
#include "video/filter/vf.h"
#include "video/decode/vd.h"
#include "mp_osd.h"
#include "video/out/vo.h"
#include "video/csputils.h"
#include "audio/mixer.h"

View File

@ -21,6 +21,7 @@
#include <stdbool.h>
#include "compat/compiler.h"
#include "mpvcore/options.h"
#include "demux/demux.h"
@ -77,6 +78,28 @@ enum mp_osd_seek_info {
OSD_SEEK_INFO_EDITION = 8,
};
enum {
OSD_MSG_TEXT = 1,
OSD_MSG_SUB_DELAY,
OSD_MSG_SPEED,
OSD_MSG_OSD_STATUS,
OSD_MSG_BAR,
OSD_MSG_PAUSE,
OSD_MSG_RADIO_CHANNEL,
OSD_MSG_TV_CHANNEL,
// Base id for messages generated from the commmand to property bridge.
OSD_MSG_PROPERTY = 0x100,
OSD_MSG_SUB_BASE = 0x1000,
// other constants
MAX_OSD_LEVEL = 3,
MAX_TERM_OSD_LEVEL = 1,
OSD_LEVEL_INVISIBLE = 4,
OSD_BAR_SEEK = 256,
};
enum seek_type {
MPSEEK_NONE = 0,
MPSEEK_RELATIVE,
@ -358,6 +381,15 @@ void stream_dump(struct MPContext *mpctx);
// osd.c
void write_status_line(struct MPContext *mpctx, const char *line);
void print_status(struct MPContext *mpctx);
void set_osd_bar(struct MPContext *mpctx, int type, const char* name,
double min, double max, double val);
void set_osd_msg(struct MPContext *mpctx, int id, int level, int time,
const char* fmt, ...) PRINTF_ATTRIBUTE(5,6);
void set_osd_tmsg(struct MPContext *mpctx, int id, int level, int time,
const char* fmt, ...) PRINTF_ATTRIBUTE(5,6);
void rm_osd_msg(struct MPContext *mpctx, int id);
void set_osd_function(struct MPContext *mpctx, int osd_function);
void set_osd_subtitle(struct MPContext *mpctx, const char *text);
// playloop.c
void pause_player(struct MPContext *mpctx);

View File

@ -1,54 +0,0 @@
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_MP_OSD_H
#define MPLAYER_MP_OSD_H
#include "compat/compiler.h"
#define OSD_MSG_TEXT 1
#define OSD_MSG_SUB_DELAY 2
#define OSD_MSG_SPEED 3
#define OSD_MSG_OSD_STATUS 4
#define OSD_MSG_BAR 5
#define OSD_MSG_PAUSE 6
#define OSD_MSG_RADIO_CHANNEL 7
#define OSD_MSG_TV_CHANNEL 8
/// Base id for messages generated from the commmand to property bridge.
#define OSD_MSG_PROPERTY 0x100
#define OSD_MSG_SUB_BASE 0x1000
#define MAX_OSD_LEVEL 3
#define MAX_TERM_OSD_LEVEL 1
#define OSD_LEVEL_INVISIBLE 4
#define OSD_BAR_SEEK 256
struct MPContext;
void set_osd_bar(struct MPContext *mpctx, int type,const char* name,double min,double max,double val);
void set_osd_msg(struct MPContext *mpctx, int id, int level, int time, const char* fmt, ...) PRINTF_ATTRIBUTE(5,6);
void set_osd_tmsg(struct MPContext *mpctx, int id, int level, int time, const char* fmt, ...) PRINTF_ATTRIBUTE(5,6);
void rm_osd_msg(struct MPContext *mpctx, int id);
// osd_function is the symbol appearing in the video status, such as OSD_PLAY
void set_osd_function(struct MPContext *mpctx, int osd_function);
void set_osd_subtitle(struct MPContext *mpctx, const char *text);
#endif /* MPLAYER_MP_OSD_H */

View File

@ -38,7 +38,6 @@
#include "sub/sub.h"
#include "mp_core.h"
#include "mp_osd.h"
#include "command.h"
#define saddf(var, ...) (*(var) = talloc_asprintf_append((*var), __VA_ARGS__))
@ -368,6 +367,7 @@ static void set_osd_bar_chapters(struct MPContext *mpctx, int type)
}
}
// osd_function is the symbol appearing in the video status, such as OSD_PLAY
void set_osd_function(struct MPContext *mpctx, int osd_function)
{
struct MPOpts *opts = mpctx->opts;

View File

@ -47,7 +47,6 @@
#include "video/out/vo.h"
#include "mp_core.h"
#include "mp_osd.h"
#include "screenshot.h"
#include "command.h"

View File

@ -30,7 +30,6 @@
#include "command.h"
#include "mpvcore/bstr.h"
#include "mpvcore/mp_msg.h"
#include "mp_osd.h"
#include "mpvcore/path.h"
#include "video/mp_image.h"
#include "video/decode/dec_video.h"

View File

@ -35,7 +35,6 @@
#include "video/mp_image.h"
#include "mp_core.h"
#include "mp_osd.h"
void uninit_subs(struct demuxer *demuxer)
{