1
mirror of https://github.com/mpv-player/mpv synced 2024-10-18 10:25:02 +02:00

add a TV_SET_CNANNEL command

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8495 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
henry 2002-12-19 10:09:43 +00:00
parent 64cdb2097c
commit bfddb0aa03
5 changed files with 29 additions and 0 deletions

View File

@ -74,6 +74,7 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_TV_STEP_CHANNEL, "tv_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }},
{ MP_CMD_TV_STEP_NORM, "tv_step_norm",0, { {-1,{0}} } },
{ MP_CMD_TV_STEP_CHANNEL_LIST, "tv_step_chanlist", 0, { {-1,{0}} } },
{ MP_CMD_TV_SET_CHANNEL, "tv_set_channel", 1, { { MP_CMD_ARG_STRING, {0}}, {-1,{0}} }},
#endif
{ MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {-1,{0}} } },
{ MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } },

View File

@ -19,6 +19,7 @@
#define MP_CMD_TV_STEP_CHANNEL 17
#define MP_CMD_TV_STEP_NORM 18
#define MP_CMD_TV_STEP_CHANNEL_LIST 19
#define MP_CMD_TV_SET_CHANNEL 37
#define MP_CMD_VO_FULLSCREEN 20
#define MP_CMD_SUB_POS 21
#define MP_CMD_DVDNAV 22

View File

@ -554,6 +554,27 @@ int tv_step_channel(tvi_handle_t *tvh, int direction)
return(1);
}
int tv_set_channel(tvi_handle_t *tvh, char *channel)
{
int i;
struct CHANLIST cl;
for (i = 0; i < chanlists[tvh->chanlist].count; i++)
{
cl = tvh->chanlist_s[i];
// printf("count%d: name: %s, freq: %d\n",
// i, cl.name, cl.freq);
if (!strcasecmp(cl.name, channel))
{
tvh->channel = i;
mp_msg(MSGT_TV, MSGL_INFO, "Selected channel: %s (freq: %.3f)\n",
cl.name, (float)cl.freq/1000);
tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16));
break;
}
}
}
int tv_step_norm(tvi_handle_t *tvh)
{
return(1);

View File

@ -148,6 +148,8 @@ int tv_step_channel(tvi_handle_t *tvh, int direction);
#define TV_CHANNEL_LOWER 1
#define TV_CHANNEL_HIGHER 2
int tv_set_channel(tvi_handle_t *tvh, char *channel);
int tv_step_norm(tvi_handle_t *tvh);
int tv_step_chanlist(tvi_handle_t *tvh);

View File

@ -2288,6 +2288,10 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
tv_step_channel((tvi_handle_t*)(demuxer->priv), TV_CHANNEL_LOWER);
}
} break;
case MP_CMD_TV_SET_CHANNEL : {
if (tv_param_on == 1)
tv_set_channel((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.s);
} break;
case MP_CMD_TV_STEP_NORM : {
if (tv_param_on == 1)
tv_step_norm((tvi_handle_t*)(demuxer->priv));