new slave command: radio_step_freq

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21058 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
voroshil 2006-11-19 16:15:05 +00:00
parent 33f5c28a3e
commit f41cff8360
6 changed files with 32 additions and 0 deletions

View File

@ -222,6 +222,9 @@ radio_step_channel <-1|1>
Step forwards (1) or backwards (-1) in channel list. Works only when the
'channels' radio parameter was set.
radio_step_freq <value>
Tune frequency by the <value> (positive - up, negative - down).
seek <value> [type]
Seek to some place in the movie.
0 is a relative seek of +/- <value> seconds (default).

View File

@ -51,6 +51,7 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_RADIO_STEP_CHANNEL, "radio_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }},
{ MP_CMD_RADIO_SET_CHANNEL, "radio_set_channel", 1, { { MP_CMD_ARG_STRING, {0}}, {-1,{0}} }},
{ MP_CMD_RADIO_SET_FREQ, "radio_set_freq", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
{ MP_CMD_RADIO_STEP_FREQ, "radio_step_freq", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
#endif
{ MP_CMD_SEEK, "seek", 1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_EDL_MARK, "edl_mark", 0, { {-1,{0}} } },

View File

@ -91,6 +91,7 @@
#define MP_CMD_RADIO_SET_FREQ 89
#define MP_CMD_SET_MOUSE_POS 90
#define MP_CMD_STEP_PROPERTY 91
#define MP_CMD_RADIO_STEP_FREQ 92
#define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001

View File

@ -5025,6 +5025,11 @@ if(step_sec>0) {
if (demuxer->stream->type== STREAMTYPE_RADIO)
radio_set_freq(demuxer->stream, cmd->args[0].v.f);
} break;
case MP_CMD_RADIO_STEP_FREQ :
if (demuxer->stream->type == STREAMTYPE_RADIO){
radio_step_freq(demuxer->stream, cmd->args[0].v.f);
}
break;
#endif
#ifdef USE_TV
case MP_CMD_TV_SET_FREQ : {

View File

@ -980,6 +980,27 @@ int radio_set_freq(struct stream_st *stream, float frequency){
return 1;
}
/*****************************************************************
* \brief tune current frequency by step_interval value
* \parameter step_interval increment value
* \return 1 if success,0 - otherwise
*
*/
int radio_step_freq(struct stream_st *stream, float step_interval){
float frequency;
radio_priv_t* priv=(radio_priv_t*)stream->priv;
if (get_frequency(priv,&frequency)!=STREAM_OK)
return 0;
frequency+=step_interval;
if (frequency>priv->rangehigh)
frequency=priv->rangehigh;
if (frequency<priv->rangelow)
frequency=priv->rangelow;
return radio_set_freq(stream,frequency);
}
/*****************************************************************
* \brief step channel up or down
* \parameter direction RADIO_CHANNEL_LOWER - go to prev channel,RADIO_CHANNEL_HIGHER - to next

View File

@ -22,6 +22,7 @@ int radio_get_freq(struct stream_st *stream, float* freq);
char* radio_get_channel_name(struct stream_st *stream);
int radio_set_channel(struct stream_st *stream, char *channel);
int radio_step_channel(struct stream_st *stream, int direction);
int radio_step_freq(struct stream_st *stream, float step_interval);
#endif