Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Mar 1997 08:26:00 -0500
From:      Michael Petry <petry@netwolf.NetMasters.com>
To:        multimedia@freebsd.org
Subject:   fxtv changes for audio and tuning
Message-ID:  <199703191326.IAA00402@netwolf.NetMasters.com>

next in thread | raw e-mail | index | archive | help

Attached is a diff to fxtv-0.0.2 that provides selection of tuner/ext1 as the
video source.  It also proviced channel selection (up/down) from a hardcoded 
array of channels. (Yep, it's a hack, but I got tired of the blue screen)
X resource management me heartburn.  What would be cool is if somebody could 
whip up a widget that displayes the current channel on the menu bar (or even 
better on top of the screen)

(There's also a bug fix to tvscreen.c at the end for a compare vs. assignment 
error)

In tvmenu.c that is an array that should be update to reflect your of-air 
channels

> static int channels[] =
> { 2, 4, 5, 7, 9, 11, 13, 20, 22, 26, 32, 45, 50, 54, 56};


diff -r fxtv-0.0.2/tvcapture.c fxtv-0.0.2.mine/tvcapture.c
190a191,225
> void TVCAPTURESetExt1( int ext1 )
> {
>   TV_CAPTURE   *c = &G_glob.capture;
> 
>   c->changed.input_dev = True;
>   c->input_dev     = METEOR_INPUT_DEV0;
> }
> 
> void TVCAPTURESetTuner( int tuner )
> {
>   TV_CAPTURE   *c = &G_glob.capture;
> 
>   c->changed.input_dev = True;
>   c->input_dev     = METEOR_INPUT_DEV1;
> }
> 
> void TVCAPTURESetChannel(int channel )
> {
>   int	       arg;
>   TV_CAPTURE   *c = &G_glob.capture;
> 
>   arg = channel;
> 
>   DBPRINTF(("changing channel to %d\n", arg));
>   if ( ioctl( c->fd, TVTUNER_SETCHNL, &arg ) < 0 ) {
>     fprintf( stderr, "ioctl(TVTUNER_SETCHNL, %d) failed: %s\n", 
> 	     arg, strerror(errno) );
>     return;
>   }
> 
>   c->changed.channel = True;
>   c->channel = channel;
> }
> 
> 
194c229
<     c->changed.brightness = 1;
---
>     c->changed.brightness = True;
201c236
<     c->changed.contrast = 1;
---
>     c->changed.contrast = True;
474a510,522
>     /*  Channel  */
> 
>     if ( c->changed.channel ) {
>         arg = c->channel;
> 
>         if ( ioctl( c->fd, TVTUNER_SETCHNL, &arg ) < 0 ) {
>             fprintf( stderr, "ioctl(TVTUNER_SETCHNL, %d) failed: %s\n", 
>                      arg, strerror(errno) );
>             return;
>         }
>         c->changed.channel = 0;
>     }
> 
477a526
> 
diff -r fxtv-0.0.2/tvcapture.h fxtv-0.0.2.mine/tvcapture.h
36a37
> #include <machine/ioctl_bt848.h>
56a58
>     INT32             channel;
75a78
>         unsigned      channel     :1;
Only in fxtv-0.0.2: tvcapture.o
diff -r fxtv-0.0.2/tvmenu.c fxtv-0.0.2.mine/tvmenu.c
95c95,96
< static XT_CB QuitCB, FreezeCB, MuteCB, ZoomCB;
---
> static XT_CB QuitCB, FreezeCB, MuteCB, TunerCB, Ext1CB, ZoomCB;
> static XT_CB UpCB, DownCB;
125,126c126,127
<     { TVMI( INPUT,INPUT_TUNER        ), "tunerCmd"      , WC_mcmd , NULL   },
<     { TVMI( INPUT,INPUT_EXT1         ), "ext1Cmd"       , WC_mcmd , NULL   },
---
>     { TVMI( INPUT,INPUT_TUNER        ), "tunerCmd"      , WC_mcmd , TunerCB},
>     { TVMI( INPUT,INPUT_EXT1         ), "ext1Cmd"       , WC_mcmd , Ext1CB },
142,143c143,144
<     { TV_TOOLITEM_CHANUP    , "channelUpCmd" , WC_cmd   , NULL     },
<     { TV_TOOLITEM_CHANDOWN  , "channelDnCmd" , WC_cmd   , NULL     },
---
>     { TV_TOOLITEM_CHANUP    , "channelUpCmd" , WC_cmd   , UpCB     },
>     { TV_TOOLITEM_CHANDOWN  , "channelDnCmd" , WC_cmd   , DownCB   },
160a162,210
> }
> 
> static void Ext1CB( Widget w, XtPointer cl, XtPointer cb )
> {
>     Boolean      ext1_on;
>     
>     XtVaGetValues( w, XtNstate, &ext1_on,
>                       NULL );
>     DBPRINTF(( "Ext1 = %s\n", ext1_on ? "yes" : "no" ));
> 
>     TVCAPTURESetExt1( 1 );
> }
> 
> static void TunerCB( Widget w, XtPointer cl, XtPointer cb )
> {
>     Boolean      tuner_on;
>     
>     XtVaGetValues( w, XtNstate, &tuner_on,
>                       NULL );
>     DBPRINTF(( "Tuner = %s\n", tuner_on ? "yes" : "no" ));
> 
>     TVCAPTURESetTuner( 1 );
> }
> 
> static int channel_index = 0;
> static int channels[] =
> { 2, 4, 5, 7, 9, 11, 13, 20, 22, 26, 32, 45, 50, 54, 56};
> 
> static void UpCB( Widget w, XtPointer cl, XtPointer cb )
> {
> 
>   channel_index++;
>   if (channel_index >= (sizeof(channels)/sizeof(int)))
>       channel_index = 0;
> 
>   DBPRINTF(("channel = %d\n", channels[channel_index]));
> 
>   TVCAPTURESetChannel( channels[channel_index] );
> }
> 
> static void DownCB( Widget w, XtPointer cl, XtPointer cb )
> {
>   channel_index--;
>   if (channel_index < 0)
>       channel_index = (sizeof(channels)/sizeof(int)) - 1;
> 
>   DBPRINTF(("channel = %d\n", channels[channel_index]));
> 
>   TVCAPTURESetChannel( channels[channel_index] );
Only in fxtv-0.0.2: tvmenu.o
diff -r fxtv-0.0.2/tvscreen.c fxtv-0.0.2.mine/tvscreen.c
1464c1464
<             bpp == 24;
---
>             bpp = 24;
1466c1466
<             bpp == 15;
---
>             bpp = 15;






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703191326.IAA00402>