[MPlayer-cvslog] r21058 - in trunk: DOCS/tech/slave.txt input/input.c input/input.h mplayer.c stream/stream_radio.c stream/stream_radio.h

voroshil subversion at mplayerhq.hu
Sun Nov 19 17:15:06 CET 2006


Author: voroshil
Date: Sun Nov 19 17:15:05 2006
New Revision: 21058

Modified:
   trunk/DOCS/tech/slave.txt
   trunk/input/input.c
   trunk/input/input.h
   trunk/mplayer.c
   trunk/stream/stream_radio.c
   trunk/stream/stream_radio.h

Log:
new slave command: radio_step_freq


Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	(original)
+++ trunk/DOCS/tech/slave.txt	Sun Nov 19 17:15:05 2006
@@ -222,6 +222,9 @@
     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).

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Sun Nov 19 17:15:05 2006
@@ -51,6 +51,7 @@
   { 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}} } },

Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h	(original)
+++ trunk/input/input.h	Sun Nov 19 17:15:05 2006
@@ -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

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Sun Nov 19 17:15:05 2006
@@ -5025,6 +5025,11 @@
       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 :  {

Modified: trunk/stream/stream_radio.c
==============================================================================
--- trunk/stream/stream_radio.c	(original)
+++ trunk/stream/stream_radio.c	Sun Nov 19 17:15:05 2006
@@ -981,6 +981,27 @@
 }
 
 /*****************************************************************
+ * \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

Modified: trunk/stream/stream_radio.h
==============================================================================
--- trunk/stream/stream_radio.h	(original)
+++ trunk/stream/stream_radio.h	Sun Nov 19 17:15:05 2006
@@ -22,6 +22,7 @@
 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
 



More information about the MPlayer-cvslog mailing list