[mythtv] tv_grab_uk graphical setup (patch)
    Mr. Adam ALLEN 
    mythtv-dev@snowman.net
       
    Mon Jan  6 00:33:43 EST 2003
    
    
  
--=-tDNL8pzcvtGSIcnTr9Mi
Content-Type: multipart/mixed; boundary="=-KzC7Xq1X6oS8JuYVMH+9"
--=-KzC7Xq1X6oS8JuYVMH+9
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
On Sun, 2003-01-05 at 23:18, Matthew Burnham wrote:
> (I finally figured my lack-of-video problem - esd had grabbed /dev/dsp
> without me noticing, grrrrr)
>=20
> Anyway, I've had a play and added graphical support for Adam Allen's new
> tv_grab_uk. Available regions are currently hard coded, though I think
> some sort of --list-regions option should be added to tv_grab_uk.
Attached patch against the modified tv_grab_uk, this provides a
--list-regions.
Been trying to decide about hardcoding the regions, you're right it
certainly shouldn't be hard-coded into the GUI! However, I'm not sure
that TV regions is the sort of data which is likely to change (or at
least not without a fair bit of notice). I'm undecided on if it's worth
spending time fetching the channels from Ananova (I guess I'm trying to
scrimp and save every last bit of bandwidth for Ananova).
Since --list-regions could be used by normal xmltv users at the
command-line, I think it's probably better not to write the list as
Anglia:Anglia, etc, but simply each region on a new-line:
Anglia
--=20
Regards,
Adam Allen.
adam@dynamicinteraction.co.uk
pgp http://search.keyserver.net:11371/pks/lookup?op=3Dvindex&search=3Dadam%=
40dynamicinteraction.co.uk
--=-KzC7Xq1X6oS8JuYVMH+9
Content-Disposition: attachment; filename=patch2
Content-Type: text/plain; name=patch2; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: quoted-printable
--- tv_grab_uk	2003-01-06 00:04:24.000000000 +0000
+++ tv_grab_uk2	2003-01-06 00:04:53.000000000 +0000
@@ -49,6 +49,8 @@
 B<--quiet> suppress the progress messages normally written to standard
 error.
=20
+B<--list-regions> lists the valid regions for the postalcode option below.
+
 B<--postalcode> postalcode is required when using list-channels to=20
 select the correct local region. The region should be one of
 Anglia, Border, Border North, .... Yorkshire
@@ -192,6 +194,7 @@
 	 	$opt_provider,
 	  $opt_list_channels,
 		$opt_auto_chan_numbers,
+		$opt_list_regions,
    );
 $opt_days   =3D 7; # default
 $opt_quiet  =3D 0; # default
@@ -201,6 +204,7 @@
 $opt_auto_chan_numbers=3D0; # default auto channel numbers
 $opt_list_channels=3D0; # default list channels option
 $opt_list_providers=3D0; # default list providersr options#
+$opt_list_regions=3D0;   # default list-regions option
=20
 GetOptions('days=3Di'        =3D> \$opt_days,
 	   'help'          =3D> \$opt_help,
@@ -210,6 +214,7 @@
 	   'share=3Ds'       =3D> \$opt_share, # also undocumented
      'offset=3Di'      =3D> \$opt_offset,
 	   'quiet'         =3D> \$opt_quiet,
+		 '--list-regions' =3D> \$opt_list_regions, #
 		 '--list-providers' =3D> \$opt_list_providers,	# for --list-providers an=
d --list-channels
 		 '--retry-limit' =3D> \$opt_retry_limit,=20
 		 '--retry-delay' =3D> \$opt_retry_delay,
@@ -270,6 +275,35 @@
     }
 }
=20
+if ($opt_list_regions =3D=3D 1){
+	# To keep the regions from been hardcoded into applications=20
+	# this routine simply provides a comma seperated list of regions
+	# - it's probably the right thing to do to fetch this list from
+	#   ananova- but that's connecting to Ananova for a list which
+	#   will probably never change.
+
+print <<rEND
+Anglia
+Border
+Border North
+Central
+East Midlands
+Grampian
+Granada
+HTV Wales
+HTV West
+London
+Meridian
+Scottish
+South East
+Tyne Tees
+Ulster
+Westcountry
+Yorkshire
+rEND
+;exit(0);
+}
+
=20
 if ($opt_auto_chan_numbers =3D=3D 1){
 	open(getProvider,"$CONFIG_FILE");
--=-KzC7Xq1X6oS8JuYVMH+9--
--=-tDNL8pzcvtGSIcnTr9Mi
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+GM7mAPXfGBB3hLYRAokcAJ9BVf64iQ3luP2d5JmNq9ALCgZHwACglch8
nzXFC7bpyDAoN0+lHjJe/8E=
=y8Tl
-----END PGP SIGNATURE-----
--=-tDNL8pzcvtGSIcnTr9Mi--
    
    
More information about the mythtv-dev
mailing list