summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-19 16:15:05 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-19 16:15:05 +0000
commitf41cff8360c04295297cd6eef430a4055345b399 (patch)
tree12852b8b0cf4ca34482ed80c02f0315a0d741708 /stream
parent33f5c28a3e55cf2fa2c2ccbc44bb4200135772ba (diff)
downloadmpv-f41cff8360c04295297cd6eef430a4055345b399.tar.bz2
mpv-f41cff8360c04295297cd6eef430a4055345b399.tar.xz
new slave command: radio_step_freq
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21058 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_radio.c21
-rw-r--r--stream/stream_radio.h1
2 files changed, 22 insertions, 0 deletions
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
@@ -981,6 +981,27 @@ int radio_set_freq(struct stream_st *stream, float frequency){
}
/*****************************************************************
+ * \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
* \return 1 if success,0 - otherwise
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