Mercurial > mplayer.hg
comparison command.c @ 23244:e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
author | ben |
---|---|
date | Tue, 08 May 2007 12:20:46 +0000 |
parents | 17bf4f4b0715 |
children | 1d86fb12e4ae |
comparison
equal
deleted
inserted
replaced
23243:0ec346252484 | 23244:e5e8ac0bd7fc |
---|---|
29 #ifdef USE_TV | 29 #ifdef USE_TV |
30 #include "stream/tv.h" | 30 #include "stream/tv.h" |
31 #endif | 31 #endif |
32 #ifdef USE_RADIO | 32 #ifdef USE_RADIO |
33 #include "stream/stream_radio.h" | 33 #include "stream/stream_radio.h" |
34 #endif | |
35 #ifdef HAVE_PVR | |
36 #include "stream/pvr.h" | |
34 #endif | 37 #endif |
35 #ifdef HAS_DVBIN_SUPPORT | 38 #ifdef HAS_DVBIN_SUPPORT |
36 #include "stream/dvbin.h" | 39 #include "stream/dvbin.h" |
37 #endif | 40 #endif |
38 #ifdef USE_DVDREAD | 41 #ifdef USE_DVDREAD |
1937 #ifdef USE_TV | 1940 #ifdef USE_TV |
1938 case MP_CMD_TV_SET_FREQ: | 1941 case MP_CMD_TV_SET_FREQ: |
1939 if (mpctx->file_format == DEMUXER_TYPE_TV) | 1942 if (mpctx->file_format == DEMUXER_TYPE_TV) |
1940 tv_set_freq((tvi_handle_t *) (mpctx->demuxer->priv), | 1943 tv_set_freq((tvi_handle_t *) (mpctx->demuxer->priv), |
1941 cmd->args[0].v.f * 16.0); | 1944 cmd->args[0].v.f * 16.0); |
1945 #ifdef HAVE_PVR | |
1946 else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) | |
1947 { | |
1948 pvr_set_freq (mpctx->stream, ROUND (cmd->args[0].v.f)); | |
1949 set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", | |
1950 pvr_get_current_channelname (mpctx->stream), | |
1951 pvr_get_current_stationname (mpctx->stream)); | |
1952 } | |
1953 #endif /* HAVE_PVR */ | |
1942 break; | 1954 break; |
1943 | 1955 |
1944 case MP_CMD_TV_STEP_FREQ: | 1956 case MP_CMD_TV_STEP_FREQ: |
1945 if (mpctx->file_format == DEMUXER_TYPE_TV) | 1957 if (mpctx->file_format == DEMUXER_TYPE_TV) |
1946 tv_step_freq((tvi_handle_t *) (mpctx->demuxer->priv), | 1958 tv_step_freq((tvi_handle_t *) (mpctx->demuxer->priv), |
1947 cmd->args[0].v.f * 16.0); | 1959 cmd->args[0].v.f * 16.0); |
1960 #ifdef HAVE_PVR | |
1961 else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) | |
1962 { | |
1963 pvr_force_freq_step (mpctx->stream, ROUND (cmd->args[0].v.f)); | |
1964 set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: f %d", | |
1965 pvr_get_current_channelname (mpctx->stream), | |
1966 pvr_get_current_frequency (mpctx->stream)); | |
1967 } | |
1968 #endif /* HAVE_PVR */ | |
1948 break; | 1969 break; |
1949 | 1970 |
1950 case MP_CMD_TV_SET_NORM: | 1971 case MP_CMD_TV_SET_NORM: |
1951 if (mpctx->file_format == DEMUXER_TYPE_TV) | 1972 if (mpctx->file_format == DEMUXER_TYPE_TV) |
1952 tv_set_norm((tvi_handle_t *) (mpctx->demuxer->priv), | 1973 tv_set_norm((tvi_handle_t *) (mpctx->demuxer->priv), |
1969 set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, | 1990 set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, |
1970 MSGTR_OSDChannel, tv_channel_current->name); | 1991 MSGTR_OSDChannel, tv_channel_current->name); |
1971 //vo_osd_changed(OSDTYPE_SUBTITLE); | 1992 //vo_osd_changed(OSDTYPE_SUBTITLE); |
1972 } | 1993 } |
1973 } | 1994 } |
1995 #ifdef HAVE_PVR | |
1996 else if (mpctx->stream && | |
1997 mpctx->stream->type == STREAMTYPE_PVR) | |
1998 { | |
1999 pvr_set_channel_step (mpctx->stream, cmd->args[0].v.i); | |
2000 set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", | |
2001 pvr_get_current_channelname (mpctx->stream), | |
2002 pvr_get_current_stationname (mpctx->stream)); | |
2003 } | |
2004 #endif /* HAVE_PVR */ | |
1974 } | 2005 } |
1975 #ifdef HAS_DVBIN_SUPPORT | 2006 #ifdef HAS_DVBIN_SUPPORT |
1976 if ((mpctx->stream->type == STREAMTYPE_DVB) | 2007 if ((mpctx->stream->type == STREAMTYPE_DVB) |
1977 && mpctx->stream->priv) { | 2008 && mpctx->stream->priv) { |
1978 dvb_priv_t *priv = (dvb_priv_t *) mpctx->stream->priv; | 2009 dvb_priv_t *priv = (dvb_priv_t *) mpctx->stream->priv; |
2002 set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, | 2033 set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, |
2003 MSGTR_OSDChannel, tv_channel_current->name); | 2034 MSGTR_OSDChannel, tv_channel_current->name); |
2004 //vo_osd_changed(OSDTYPE_SUBTITLE); | 2035 //vo_osd_changed(OSDTYPE_SUBTITLE); |
2005 } | 2036 } |
2006 } | 2037 } |
2038 #ifdef HAVE_PVR | |
2039 else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) | |
2040 { | |
2041 pvr_set_channel (mpctx->stream, cmd->args[0].v.s); | |
2042 set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", | |
2043 pvr_get_current_channelname (mpctx->stream), | |
2044 pvr_get_current_stationname (mpctx->stream)); | |
2045 } | |
2046 #endif /* HAVE_PVR */ | |
2007 break; | 2047 break; |
2008 | 2048 |
2009 #ifdef HAS_DVBIN_SUPPORT | 2049 #ifdef HAS_DVBIN_SUPPORT |
2010 case MP_CMD_DVB_SET_CHANNEL: | 2050 case MP_CMD_DVB_SET_CHANNEL: |
2011 if ((mpctx->stream->type == STREAMTYPE_DVB) | 2051 if ((mpctx->stream->type == STREAMTYPE_DVB) |
2032 set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, | 2072 set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, |
2033 MSGTR_OSDChannel, tv_channel_current->name); | 2073 MSGTR_OSDChannel, tv_channel_current->name); |
2034 //vo_osd_changed(OSDTYPE_SUBTITLE); | 2074 //vo_osd_changed(OSDTYPE_SUBTITLE); |
2035 } | 2075 } |
2036 } | 2076 } |
2077 #ifdef HAVE_PVR | |
2078 else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) | |
2079 { | |
2080 pvr_set_lastchannel (mpctx->stream); | |
2081 set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", | |
2082 pvr_get_current_channelname (mpctx->stream), | |
2083 pvr_get_current_stationname (mpctx->stream)); | |
2084 } | |
2085 #endif /* HAVE_PVR */ | |
2037 break; | 2086 break; |
2038 | 2087 |
2039 case MP_CMD_TV_STEP_NORM: | 2088 case MP_CMD_TV_STEP_NORM: |
2040 if (mpctx->file_format == DEMUXER_TYPE_TV) | 2089 if (mpctx->file_format == DEMUXER_TYPE_TV) |
2041 tv_step_norm((tvi_handle_t *) (mpctx->demuxer->priv)); | 2090 tv_step_norm((tvi_handle_t *) (mpctx->demuxer->priv)); |