[MPlayer-cvslog] r22685 - in trunk: DOCS/tech/slave.txt command.c input/input.c input/input.h stream/tv.c stream/tv.h

voroshil subversion at mplayerhq.hu
Sat Mar 17 12:51:17 CET 2007


Author: voroshil
Date: Sat Mar 17 12:51:17 2007
New Revision: 22685

Modified:
   trunk/DOCS/tech/slave.txt
   trunk/command.c
   trunk/input/input.c
   trunk/input/input.h
   trunk/stream/tv.c
   trunk/stream/tv.h

Log:
New slave command: tv_step_freq <offset in MHz>
Command sets the TV frequency relative to current value


Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	(original)
+++ trunk/DOCS/tech/slave.txt	Sat Mar 17 12:51:17 2007
@@ -330,6 +330,9 @@ tv_last_channel
 tv_set_freq <frequency in MHz>
     Set the TV tuner frequency.
 
+tv_step_freq <frequency offset in MHz>
+    Set the TV tuner frequency relative to current value.
+
 tv_set_norm <norm>
     Set the TV tuner norm (PAL, SECAM, NTSC, ...).
 

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	(original)
+++ trunk/command.c	Sat Mar 17 12:51:17 2007
@@ -1941,6 +1941,12 @@ int run_command(MPContext * mpctx, mp_cm
 			    cmd->args[0].v.f * 16.0);
 	    break;
 
+	case MP_CMD_TV_STEP_FREQ:
+	    if (mpctx->file_format == DEMUXER_TYPE_TV)
+		tv_step_freq((tvi_handle_t *) (mpctx->demuxer->priv),
+			    cmd->args[0].v.f * 16.0);
+	    break;
+
 	case MP_CMD_TV_SET_NORM:
 	    if (mpctx->file_format == DEMUXER_TYPE_TV)
 		tv_set_norm((tvi_handle_t *) (mpctx->demuxer->priv),

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Sat Mar 17 12:51:17 2007
@@ -112,6 +112,7 @@ static mp_cmd_t mp_cmds[] = {
   { MP_CMD_TV_SET_CHANNEL, "tv_set_channel", 1, { { MP_CMD_ARG_STRING, {0}}, {-1,{0}}  }},
   { MP_CMD_TV_LAST_CHANNEL, "tv_last_channel", 0, { {-1,{0}} } },
   { MP_CMD_TV_SET_FREQ, "tv_set_freq", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
+  { MP_CMD_TV_STEP_FREQ, "tv_step_freq", 1, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
   { MP_CMD_TV_SET_NORM, "tv_set_norm", 1, { {MP_CMD_ARG_STRING,{0}}, {-1,{0}} } },
   { MP_CMD_TV_SET_BRIGHTNESS, "tv_set_brightness", 1,  { { MP_CMD_ARG_INT ,{0}}, { MP_CMD_ARG_INT,{1} }, {-1,{0}} }},
   { MP_CMD_TV_SET_CONTRAST, "tv_set_contrast", 1,  { { MP_CMD_ARG_INT ,{0}}, { MP_CMD_ARG_INT,{1} }, {-1,{0}} }},

Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h	(original)
+++ trunk/input/input.h	Sat Mar 17 12:51:17 2007
@@ -92,6 +92,7 @@
 #define MP_CMD_SET_MOUSE_POS 90
 #define MP_CMD_STEP_PROPERTY 91
 #define MP_CMD_RADIO_STEP_FREQ 92
+#define MP_CMD_TV_STEP_FREQ 93
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001

Modified: trunk/stream/tv.c
==============================================================================
--- trunk/stream/tv.c	(original)
+++ trunk/stream/tv.c	Sat Mar 17 12:51:17 2007
@@ -781,6 +781,21 @@ int tv_set_freq(tvi_handle_t *tvh, unsig
     return(1);
 }
 
+/*****************************************************************
+ * \brief tune current frequency by step_interval value
+ * \parameter step_interval increment value in 1/16 MHz
+ * \note frequency is rounded to 1/16 MHz value
+ * \return 1
+ *
+ */
+int tv_step_freq(tvi_handle_t* tvh, float step_interval){
+    unsigned long frequency;
+
+    tv_get_freq(tvh,&frequency);
+    frequency+=step_interval;
+    return tv_set_freq(tvh,frequency);
+}
+
 int tv_step_channel_real(tvi_handle_t *tvh, int direction)
 {
     struct CHANLIST cl;

Modified: trunk/stream/tv.h
==============================================================================
--- trunk/stream/tv.h	(original)
+++ trunk/stream/tv.h	Sat Mar 17 12:51:17 2007
@@ -184,6 +184,7 @@ int tv_step_chanlist(tvi_handle_t *tvh);
 
 int tv_set_freq(tvi_handle_t *tvh, unsigned long freq);
 int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq);
+int tv_step_freq(tvi_handle_t *tvh, float step_interval);
 
 int tv_set_norm(tvi_handle_t *tvh, char* norm);
 



More information about the MPlayer-cvslog mailing list