From f41cff8360c04295297cd6eef430a4055345b399 Mon Sep 17 00:00:00 2001 From: voroshil Date: Sun, 19 Nov 2006 16:15:05 +0000 Subject: new slave command: radio_step_freq git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21058 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_radio.c | 21 +++++++++++++++++++++ stream/stream_radio.h | 1 + 2 files changed, 22 insertions(+) (limited to 'stream') diff --git a/stream/stream_radio.c b/stream/stream_radio.c index bb19aa4fd7..2db3680d0f 100644 --- a/stream/stream_radio.c +++ b/stream/stream_radio.c @@ -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 (frequencyrangelow) + 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 diff --git a/stream/stream_radio.h b/stream/stream_radio.h index 3baca729a0..2d5ffb2cc4 100644 --- a/stream/stream_radio.h +++ b/stream/stream_radio.h @@ -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 -- cgit v1.2.3