From 52ee5f857d07494db27ab5bb77b0c08f4a90f03d Mon Sep 17 00:00:00 2001
From: Bob Igo <bob@stormlogic.com>
Date: Thu, 19 Feb 2009 16:18:44 -0500
Subject: Further Tweaker refinement based on tester feedback.

---
 abs/core-testing/tweaker/PKGBUILD           |   2 +-
 abs/core-testing/tweaker/bin/twk_cpu.pl     |   2 +-
 abs/core-testing/tweaker/bin/twk_general.pl | 121 ++++++++++++++++++++++++----
 3 files changed, 108 insertions(+), 17 deletions(-)

diff --git a/abs/core-testing/tweaker/PKGBUILD b/abs/core-testing/tweaker/PKGBUILD
index 468dd40..e77d9a6 100644
--- a/abs/core-testing/tweaker/PKGBUILD
+++ b/abs/core-testing/tweaker/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=tweaker
 pkgver=1
-pkgrel=17
+pkgrel=18
 pkgdesc=""
 arch=('i686' 'x86_64')
 
diff --git a/abs/core-testing/tweaker/bin/twk_cpu.pl b/abs/core-testing/tweaker/bin/twk_cpu.pl
index fabef10..fb256cb 100755
--- a/abs/core-testing/tweaker/bin/twk_cpu.pl
+++ b/abs/core-testing/tweaker/bin/twk_cpu.pl
@@ -94,7 +94,7 @@ sub implement_option {
 	    case "high" {
 		change_or_make_setting('AutoCommflagWhileRecording', '1') || exit -1;
 		# ??? Interacts with screen aspect ratio
-		change_or_make_setting('Theme', 'blootube-wide') || exit -1; # High eye candy, potentially low performance
+		change_or_make_setting('Theme', 'LinHES') || exit -1; # High eye candy, potentially low performance
 		#change_or_make_entry("displayprofiles", [["pref_decoder", "ffmpeg"]], [["profilegroupid", "1"], ["profileid", "1"]]) || exit -1; # Most CPU usage, best quality
 		#change_or_make_setting('PreferredMPEG2Decoder', 'ffmpeg') || exit -1; # Most CPU usage, best quality
 		change_or_make_setting('DefaultVideoPlaybackProfile', 'CPU++') || exit -1; # best playback defaults for powerful hardware
diff --git a/abs/core-testing/tweaker/bin/twk_general.pl b/abs/core-testing/tweaker/bin/twk_general.pl
index c72e093..d62536f 100755
--- a/abs/core-testing/tweaker/bin/twk_general.pl
+++ b/abs/core-testing/tweaker/bin/twk_general.pl
@@ -32,9 +32,6 @@ sub implement_option {
 	my @commands = (
 	    # keymap tweaks
 	    "twk_keymap.sh"
-	    #
-	    # These may or may not be necessary after GF21
-	    #
 	    );
 	
 	foreach my $command (@commands) {
@@ -118,22 +115,56 @@ sub implement_option {
 		     join("','",($players[3][0], $players[3][3], $players[3][0], "action/puzzle", "2006", "Frozen Bubble Team", "/usr/games", $players[3][4]))."');");
 
 	    #
-	    # default playgroup with time-related settings
+	    # smart music playlists
 	    #
-	    change_or_make_entry("playgroup", [["skipahead", 10], ["skipback", 5], ["timestretch", 100], ["jump", 1]], [["name", "Default"]]);
+	    # categoryid, name
+	    change_or_make_entry("music_smartplaylist_categories", [["name", "Decades"]], [["categoryid", 1]]);
+	    change_or_make_entry("music_smartplaylist_categories", [["name", "Favorite Tracks"]], [["categoryid", 2]]);
+	    change_or_make_entry("music_smartplaylist_categories", [["name", "New Tracks"]], [["categoryid", 3]]);
+
+	    foreach my $decade (60, 70, 80, 90, 100) {
+		my $id = ($decade / 10) - 5;
+		my $query = "INSERT INTO music_smartplaylist_items (smartplaylistid, field, operator, value1, value2) VALUES ($id, 'Year', 'is between'," . ($decade+1900) . "," . ($decade+1909) . ");";
+		do_query($query);
+		$query = "INSERT INTO music_smartplaylists (name, categoryid, matchtype, orderby, limitto) VALUES ('". ($decade+1900) . "\\'s', 1, 'All', 'Artist (A)', 0);";
+		do_query($query);
+	    }
+
+	    my @other_lists = (
+		[
+		 ( 'Rating', 'is greater than', '7', 'Favorite Tracks', 2, 'Artist (A), Album (A)', 0 ),
+		 ( 'Play Count', 'is greater than', '0', '100 Most Played Tracks', 2, 'Play Count (D)', 100 ),
+		 ( 'Play Count', 'is equal to', '0', 'Never Played Tracks', 3, 'Artist (A), Album (A)', 0 )
+		]);
+
+	    my $id=6;
+	    foreach my $other_list (@other_lists) {
+		change_or_make_entry("music_smartplaylist_items", [["field", @$other_list[0]], ["operator", @$other_list[1]], ["value1", @$other_list[2]]], [["smartplaylistid", $id]]);
+		change_or_make_entry("music_smartplaylists", [["name", @$other_list[3]], ["categoryid", @$other_list[4]], ["matchtype", "All"], ["orderby", @$other_list[5]], ["limitto", @$other_list[6]]], [["smartplaylistid", $id]]);
+		$id++;
+	    }
 
 	    #
-	    # useful recording profiles and transcoding options
+	    # default playgroup with time-related settings
 	    #
-	    change_or_make_entry("profilegroups", [["name", "MPEG-2 Encoders (PVR-x50, PVR-500)"], ["cardtype", "MPEG"], ["is_default", 1]], [["id", 2]]); # rename the default entry for improved usability
+	    change_or_make_entry("playgroup", [["skipahead", 10], ["skipback", 5], ["timestretch", 100], ["jump", 1]], [["name", "Default"]]);
 
 	    #
-	    # Websites for mythbrowser
+	    # useful recording profiles and transcoding options
 	    #
-	    change_or_make_entry("websites", [["grp", "LinHeS"], ["dsc", ""], ["updated", ""]], [["url", "http://knoppmyth.net"]]);
-	    change_or_make_entry("websites", [["grp", "LinHeS"], ["dsc", ""], ["updated", ""]], [["url", "http://knoppmythwiki.org"]]);
-
-	    
+	    change_or_make_entry("profilegroups", [["name", "Software Encoders (v4l based)"], ["cardtype", "V4L"], ["is_default", 1]], [["id", 1]]);
+	    change_or_make_entry("profilegroups", [["name", "MPEG-2 Encoders (PVR-x50, PVR-500)"], ["cardtype", "MPEG"], ["is_default", 1]], [["id", 2]]);
+	    change_or_make_entry("profilegroups", [["name", "Hardware MJPEG Encoders (Matrox G200-TV, Miro DC10, etc)"], ["cardtype", "MJPEG"], ["is_default", 1]], [["id", 3]]);
+	    change_or_make_entry("profilegroups", [["name", "Hardware HDTV"], ["cardtype", "HDTV"], ["is_default", 1]], [["id", 4]]);
+	    change_or_make_entry("profilegroups", [["name", "Hardware DVB Encoders"], ["cardtype", "DVB"], ["is_default", 1]], [["id", 5]]);
+	    change_or_make_entry("profilegroups", [["name", "Transcoders"], ["cardtype", "TRANSCODE"], ["is_default", 1]], [["id", 6]]);
+	    change_or_make_entry("profilegroups", [["name", "FireWire Input"], ["cardtype", "FIREWIRE"], ["is_default", 1]], [["id", 7]]);
+	    change_or_make_entry("profilegroups", [["name", "USB Mpeg-4 Encoder (Plextor ConvertX, etc)"], ["cardtype", "GO7007"], ["is_default", 1]], [["id", 8]]);
+	    change_or_make_entry("profilegroups", [["name", "DBOX2 Input"], ["cardtype", "DBOX2"], ["is_default", 1]], [["id", 9]]);
+	    change_or_make_entry("profilegroups", [["name", "Freebox Input"], ["cardtype", "Freebox"], ["is_default", 1]], [["id", 10]]);
+	    change_or_make_entry("profilegroups", [["name", "HDHomeRun Recorders"], ["cardtype", "HDHOMERUN"], ["is_default", 1]], [["id", 11]]);
+	    change_or_make_entry("profilegroups", [["name", "CRC IP Recorders"], ["cardtype", "CRC_IP"], ["is_default", 1]], [["id", 12]]);
+    
 	    do_query("INSERT INTO codecparams (profile, name, value) VALUES (21, 'transcodelossless', 0)");
 	    do_query("INSERT INTO codecparams (profile, name, value) VALUES (21, 'transcoderesize', 0)");
 	    do_query("INSERT INTO codecparams (profile, name, value) VALUES (21, 'mpeg4bitrate', 2200)");
@@ -221,6 +252,58 @@ sub implement_option {
 	    do_query("INSERT INTO codecparams (profile, name, value) VALUES (29, 'mp3quality', 7)");
 	    do_query("INSERT INTO codecparams (profile, name, value) VALUES (29, 'volume', 100)");
 
+
+	    # I don't know why we have so many of these.  Only profilegroup 6 seems to matter.
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 1]], [["id", 1]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 1]], [["id", 2]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 1]], [["id", 3]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 1]], [["id", 4]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 2]], [["id", 5]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 2]], [["id", 6]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 2]], [["id", 7]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 2]], [["id", 8]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 3]], [["id", 9]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 3]], [["id", 10]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 3]], [["id", 11]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 3]], [["id", 12]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 4]], [["id", 13]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 4]], [["id", 14]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 4]], [["id", 15]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 4]], [["id", 16]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 5]], [["id", 17]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 5]], [["id", 18]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 5]], [["id", 19]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 5]], [["id", 20]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'RTjpeg/MPEG4'], ["profilegroup", 6], ["videocodec", "MPEG-4"], ["audiocodec", "Uncompressed"]], [["id", 21]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'MPEG2'], ["profilegroup", 6], ["videocodec", "MPEG-4"], ["audiocodec", "Uncompressed"]], [["id", 22]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 8]], [["id", 23]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 8]], [["id", 24]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 8]], [["id", 25]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 8]], [["id", 26]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 6]], [["id", 27]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Medium Quality'], ["profilegroup", 6], ["videocodec", "MPEG-4"], ["audiocodec", "Uncompressed"]], [["id", 28]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 6], ["videocodec", "MPEG-4"], ["audiocodec", "MP3"]], [["id", 29]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 10]], [["id", 30]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 10]], [["id", 31]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 10]], [["id", 32]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 10]], [["id", 33]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 11]], [["id", 34]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 11]], [["id", 35]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 11]], [["id", 36]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 11]], [["id", 37]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 12]], [["id", 38]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 12]], [["id", 39]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 12]], [["id", 40]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 12]], [["id", 41]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 7]], [["id", 42]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 7]], [["id", 43]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 7]], [["id", 44]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 7]], [["id", 45]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Default'], ["profilegroup", 9]], [["id", 46]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Live TV'], ["profilegroup", 9]], [["id", 47]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'High Quality'], ["profilegroup", 9]], [["id", 48]]);
+	    change_or_make_entry("recordingprofiles", [["name", 'Low Quality'], ["profilegroup", 9]], [["id", 49]]);
+
 	    #
 	    # settings
 	    #
@@ -252,7 +335,6 @@ sub implement_option {
 	    change_or_make_setting('HaltCommand', 'sudo /sbin/halt');
 	    change_or_make_setting('HostAudiotype','ALSA');
 	    change_or_make_setting('HostMiro','1');
-	    change_or_make_setting('HostMyhostname','type_hostname_here');
 	    change_or_make_setting('HostXine','1');
 	    change_or_make_setting('Hostpluginmythappletrailers','1');
 	    change_or_make_setting('Hostpluginmytharchive','1');
@@ -337,7 +419,7 @@ sub implement_option {
 	    change_or_make_setting('VideoGalleryNoDB', '1');
 	    change_or_make_setting('VideoStartupDir', $SQL_DirVideo);
 	    change_or_make_setting('VideoTreeNoDB', '1');
-	    change_or_make_setting('VisualMode','BumpScope;Gears;Goom;MonoScope;Squares;StereoScope;Synaesthesia;LibVisual-bumpscope;LibVisual-corona;LibVisual-infinite;LibVisual-jakdaw;LibVisual-jess;AlbumArt');
+	    change_or_make_setting('VisualMode','BumpScope;Gears;Goom;MonoScope;Squares;StereoScope;Synaesthesia;LibVisual-bumpscope;LibVisual-corona;LibVisual-infinite;AlbumArt');
 	    change_or_make_setting('weatherbackgroundfetch', '1');
 	    change_or_make_setting('WebBrowserCommand','/usr/bin/mythbrowser');
 	    change_or_make_setting('WebBrowserHideScrollbars','0');
@@ -365,6 +447,10 @@ sub implement_option {
 	    change_or_make_setting('mythfilldatabaseLastRunEnd','');
 	    change_or_make_setting('mythfilldatabaseLastRunStatus','');
 
+	    #
+	    # customexample table
+	    #
+	    change_or_make_entry("customexample", [["fromclause", ""], ["whereclause", "program.category_type = \'movie\' AND program.airdate >= YEAR(DATE_SUB(NOW(), INTERVAL 1 YEAR)) AND program.stars > 0.5 "], ["search", "1"]], [["rulename", "New Flix"]]);
 
 #	    # As much of MythWeather as we can automate for now
 	    my $units = 0;
@@ -439,6 +525,12 @@ sub implement_option {
 	    
 	    # storagegroup
 	    change_or_make_entry("storagegroup", [["groupname", "Default"], ["hostname", $hostname], ["dirname", $SQL_DirTV]], [["id", 1]]);
+
+	    #
+	    # Websites for mythbrowser
+	    #
+	    change_or_make_entry("websites", [["grp", "LinHeS"], ["dsc", ""], ["updated", ""]], [["url", "http://knoppmyth.net"]]);
+	    change_or_make_entry("websites", [["grp", "LinHeS"], ["dsc", ""], ["updated", ""]], [["url", "http://knoppmythwiki.org"]]);
 	    
 	    disconnect_from_db();
 
@@ -455,7 +547,6 @@ sub implement_option {
 	    #$command = "sed -i \"/<type>STREAM<\\/type>\$/{N; N; N; N; s/text>.*<\\/text/text>Online Streams<\\/text/; s/action>.*<\\/action/action>MENU is.xml<\\/action/; s/<depends.*depends>//; }\" /usr/share/mythtv/library.xml";
 	    $command = "/bin/cp /usr/share/mythtv/library.xml.km /usr/share/mythtv/library.xml";
 	    execute_shell_command($command);
-	    
 	} else {
 	    my $logger = get_logger('tweaker.script');
 	    $logger->error("Unable to connect to mythconverg database");
-- 
cgit v0.12


From 4adf0153cbc675daea90ccc0f7f1935eb6b2aa23 Mon Sep 17 00:00:00 2001
From: Bob Igo <bob@stormlogic.com>
Date: Thu, 19 Feb 2009 16:31:04 -0500
Subject: Merged some twk_tuners.pl fixes from local KnoppMyth patches repo.

---
 abs/core-testing/tweaker/bin/twk_tuners.pl | 91 ++++++++++++++++--------------
 1 file changed, 48 insertions(+), 43 deletions(-)

diff --git a/abs/core-testing/tweaker/bin/twk_tuners.pl b/abs/core-testing/tweaker/bin/twk_tuners.pl
index 0b2b88c..f928ea7 100755
--- a/abs/core-testing/tweaker/bin/twk_tuners.pl
+++ b/abs/core-testing/tweaker/bin/twk_tuners.pl
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright 2008-2009 Robert ("Bob") Igo of StormLogic, LLC and mythic.tv.
+# Copyright 2008 Robert ("Bob") Igo of StormLogic, LLC and mythic.tv.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -31,8 +31,8 @@ my @capture_card_patterns = (
     # ATSC-only devices
     [ "pcHDTV hd-2000", [".*0400.*109e.*036e.*r11.*7063.*2000.*"],
       ["DVB", ["ATSC"]]],
-    [ "BBTI Air2PC v2", [".*0280.*13d0.*2103.*r02.*13d0.*2103.*"], # ??? dupe 1; mihanson
-      ["DVB", ["ATSC"]]],
+#    [ "BBTI Air2PC v2", [".*0280.*13d0.*2103.*r02.*13d0.*2103.*"], # ??? dupe 1; mihanson
+#      ["DVB", ["ATSC"]]],
     
     # DVB-T devices
     [ "DViCO FusionHDTV DVB-T Lite", [".*0400.*109e.*036e.*r11.*18ac.*db10.*"],
@@ -60,8 +60,8 @@ my @capture_card_patterns = (
     # DVB-S devices
     [ "VisionPlus 1020A", [".*0480.*109e.*0878.*1822.*0001.*"],
       ["DVB", ["DVB-S"]]],
-    [ "Technisat Skystar2", [".*0280.*13d0.*2103.*r01.*13d0.*2103.*"], # ??? dupe 1; nbdwt73, neutron68
-      ["DVB", ["DVB-S"]]],
+#    [ "Technisat Skystar2", [".*0280.*13d0.*2103.*r01.*13d0.*2103.*"], # ??? dupe 1; nbdwt73, neutron68
+#      ["DVB", ["DVB-S"]]],
     [ "Twinhan 102g", [".*0400.*109e.*036e.*r11.*1822.*0001.*"], # ??? dupe 2; neutron68
       # secondary device "0480" "109e" "0878" -r11 "1822" "0001"
       ["DVB", ["DVB-S"]]],
@@ -342,53 +342,58 @@ sub implement_option {
 	$logger->debug("Processing local devices...");
 	for my $pci_device (@lspci) {
 	    $logger->debug("DEVICE: $pci_device");
+	    my $match=0;
 
 	    for my $pci_device_data (@capture_card_patterns) {
 		$logger->debug("\tIs there a @$pci_device_data[0] at this location?");
+
 		for my $patterns (@$pci_device_data[1]) {
 		    for my $pattern (@$patterns) {
-			my $match=0;
-			$logger->debug("\t\tPATTERN: $pattern");
-			$match += ($pci_device =~ m/$pattern/i);
 			if ($match) {
-			    $global_device_count++; # 1-indexed
-						    
-			    $logger->debug("\t\tfound one!");
-			    # Each device has a device type (e.g. MPEG, DVB, V4L) that it supports, and a
-			    # list of sub_types (e.g. PAL, NTSC, DVB-S, DVB-T, DVB-C, ATSC, QAM).
-			    # The device type is used to configure the capturecard table and the cardinput table.
-			    # The sub_types are used to populate the videosource table.
-			    # The device type and "best" sub_type are used to set the 'sourceid' field of the cardinput table.
-
-			    for my $typeblock (@$pci_device_data[2]) {
-				my $pci_device_type = @$typeblock[0];
-				$logger->debug("\t\tDEVICE TYPE: $pci_device_type"); # e.g. "DVB", "MPEG", etc.
-				$cardtypes{$pci_device_type}++;
-				my $sourceid = -1;
-				for my $sub_types (@$typeblock[1]) {
-				    for my $sub_type (@$sub_types) {
-					$logger->debug("\t\tSUB-TYPE: $sub_type\n"); # e.g. "DVB-S", "QAM", etc.
-					# ensure that the videosource table has an entry for each sub_type
-					# that this device supports; use the "best" one for the device by
-					# default
-
-					#
-					# POPULATE videosource table
-					#
-					$sourceid = max(verify_or_make_videosource_SQL($sub_type), $sourceid);
+			    next;
+			} else {
+			    $logger->debug("\t\tPATTERN: $pattern");
+			    $match += ($pci_device =~ m/$pattern/i);
+			    if ($match) {
+				$global_device_count++; # 1-indexed
+				
+				$logger->debug("\t\tfound one!");
+				# Each device has a device type (e.g. MPEG, DVB, V4L) that it supports, and a
+				# list of sub_types (e.g. PAL, NTSC, DVB-S, DVB-T, DVB-C, ATSC, QAM).
+				# The device type is used to configure the capturecard table and the cardinput table.
+				# The sub_types are used to populate the videosource table.
+				# The device type and "best" sub_type are used to set the 'sourceid' field of the cardinput table.
+
+				for my $typeblock (@$pci_device_data[2]) {
+				    my $pci_device_type = @$typeblock[0];
+				    $logger->debug("\t\tDEVICE TYPE: $pci_device_type"); # e.g. "DVB", "MPEG", etc.
+				    $cardtypes{$pci_device_type}++;
+				    my $sourceid = -1;
+				    for my $sub_types (@$typeblock[1]) {
+					for my $sub_type (@$sub_types) {
+					    $logger->debug("\t\tSUB-TYPE: $sub_type\n"); # e.g. "DVB-S", "QAM", etc.
+					    # ensure that the videosource table has an entry for each sub_type
+					    # that this device supports; use the "best" one for the device by
+					    # default
+
+					    #
+					    # POPULATE videosource table
+					    #
+					    $sourceid = max(verify_or_make_videosource_SQL($sub_type), $sourceid);
+					}
 				    }
-				}
-				$logger->debug("\t\t\"BEST\" SOURCE ID: $sourceid\n");
+				    $logger->debug("\t\t\"BEST\" SOURCE ID: $sourceid\n");
 
-				#
-				# POPULATE capturecard table
-				#
-				my $defaultinput = make_capturecard_SQL($global_device_count, $cardtypes{$pci_device_type}-1, $pci_device_type, -1);
+				    #
+				    # POPULATE capturecard table
+				    #
+				    my $defaultinput = make_capturecard_SQL($global_device_count, $cardtypes{$pci_device_type}-1, $pci_device_type, -1);
 
-				#
-				# POPULATE cardinput table
-				#
-				make_cardinput_SQL($global_device_count, $sourceid, $defaultinput, 0);
+				    #
+				    # POPULATE cardinput table
+				    #
+				    make_cardinput_SQL($global_device_count, $sourceid, $defaultinput, 0);
+				}
 			    }
 			}
 		    }
-- 
cgit v0.12


From 2a4fa579c512741d1699ba305caa84f5495ed6c3 Mon Sep 17 00:00:00 2001
From: Nathan Harris <nharris@eoimaging.com>
Date: Thu, 19 Feb 2009 16:45:41 -0500
Subject: builds fine, but not tested

---
 abs/core-testing/mythtv/trunk/mythgame/PKGBUILD    | 63 +++++++++++++---------
 abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD  | 47 ++++++++++++++++
 .../mythtv/trunk/mythmovietime/PKGBUILD            | 36 -------------
 abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD   |  4 +-
 abs/core-testing/mythtv/trunk/mythnews/PKGBUILD    | 63 +++++++++++++---------
 abs/core-testing/mythtv/trunk/mythphone/PKGBUILD   | 42 ---------------
 abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD   | 61 ++++++++++++---------
 7 files changed, 160 insertions(+), 156 deletions(-)
 create mode 100644 abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD
 delete mode 100644 abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD
 delete mode 100644 abs/core-testing/mythtv/trunk/mythphone/PKGBUILD

diff --git a/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD b/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD
index 8c4257f..bc18ba4 100644
--- a/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD
@@ -1,36 +1,47 @@
 pkgname=mythgame-svn
-pkgver=16153
-pkgrel=4
+pkgver=20019
+pkgrel=1
 pkgdesc="Emulation plugin for MythTV"
 url="http://www.mythtv.org"
-arch=('i686')
-depends=('mythtv-svn' 'zlib')
-conflicts=('mythtv-plugins-svn')
-groups=('mythtv-all-plugins-svn')
 license="GPL"
-source=()
+arch=('i686' 'x86_64')
+
+depends=('mythtv-svn' 'zlib')
+conflicts=('mythgame')
+groups=('mythtv-extras-svn')
+
+patches=()
+source=(`echo ${patches[@]:0}`)
 _svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins
 _svnmod=mythplugins
 
 
 build() {
-	cd $startdir/src/
-	echo svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
- 	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
-	cd $startdir/src/mythplugins
-PLUGIN=mythgame
-grep -q  programs-libs.pro  $PLUGIN/$PLUGIN/$PLUGIN.pro
-if [ $? != 0 ]
-then
-		echo "include ( ../../programs-libs.pro )" >> $PLUGIN/$PLUGIN/$PLUGIN.pro
-		msg	 "appending program lib"
-		fi
-	export QMAKESPEC='linux-g++'
-	make distclean
-   ./configure  --disable-all --enable-opengl --enable-mythgame 
-
-   make -j 2 || return 1
-
-   make INSTALL_ROOT=$startdir/pkg install
-}
 
+	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
+#	svn co $_svntrunk --config-dir ./ $_svnmod
+
+	cd $startdir/src/$_svnmod
+
+	echo "--------------------------applying patches----------------------------------------------------"
+	for i in `echo ${patches[@]:0} `
+	do
+		echo applying $i
+		echo "-----------------------------"
+		patch -Np0  -i ${startdir}/src/$i  || return 1
+	done
+	echo "--------------------------done applying patches-----------------------------------------------"
+	
+	[ "$CARCH" = "i686"   ] && ARCH="i686"
+	[ "$CARCH" = "x86_64" ] && ARCH="x86-64"
+
+	# configure
+	./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \
+	--enable-mythgame || return 1
+
+	# build and install
+	. /etc/profile
+	make || return 1
+	make INSTALL_ROOT=$startdir/pkg install || return 1
+
+}
diff --git a/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD
new file mode 100644
index 0000000..341cf55
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD
@@ -0,0 +1,47 @@
+pkgname=mythmovies-svn
+pkgver=20019
+pkgrel=1
+pkgdesc="Displays information about movies playing in the area."
+url="http://www.mythtv.org"
+license="GPL"
+arch=('i686' 'x86_64')
+
+depends=('mythtv-svn')
+conflicts=('mythmovies')
+groups=('mythtv-extras-svn')
+
+patches=()
+source=(`echo ${patches[@]:0}`)
+_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins
+_svnmod=mythplugins
+
+
+build() {
+
+	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
+#	svn co $_svntrunk --config-dir ./ $_svnmod
+
+	cd $startdir/src/$_svnmod
+
+	echo "--------------------------applying patches----------------------------------------------------"
+	for i in `echo ${patches[@]:0} `
+	do
+		echo applying $i
+		echo "-----------------------------"
+		patch -Np0  -i ${startdir}/src/$i  || return 1
+	done
+	echo "--------------------------done applying patches-----------------------------------------------"
+	
+	[ "$CARCH" = "i686"   ] && ARCH="i686"
+	[ "$CARCH" = "x86_64" ] && ARCH="x86-64"
+
+	# configure
+	./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \
+	--enable-mythmovies || return 1
+
+	# build and install
+	. /etc/profile
+	make || return 1
+	make INSTALL_ROOT=$startdir/pkg install || return 1
+
+}
diff --git a/abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD
deleted file mode 100644
index f83cdbf..0000000
--- a/abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD
+++ /dev/null
@@ -1,36 +0,0 @@
-pkgname=mythmovietime-svn
-pkgver=16153
-pkgrel=6
-pkgdesc="Emulation plugin for MythTV"
-url="http://www.mythtv.org"
-arch=('i686')
-depends=('mythtv-svn' 'zlib')
-conflicts=('mythtv-plugins-svn')
-groups=('mythtv-all-plugins-svn')
-license="GPL"
-source=()
-_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins
-_svnmod=mythplugins
-
-
-build() {
-	cd $startdir/src/
-	echo svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
- 	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
-	cd $startdir/src/mythplugins
-PLUGIN=mythmovietime
-grep -q  programs-libs.pro  $PLUGIN/$PLUGIN/$PLUGIN.pro
-if [ $? != 0 ]
-then
-		echo "include ( ../../programs-libs.pro )" >> $PLUGIN/$PLUGIN/$PLUGIN.pro
-			msg "appending program lib"
-		fi
-	export QMAKESPEC='linux-g++'
-	make distclean
-   ./configure  --disable-all --enable-mythmovies 
-
-   make -j 2 || return 1
-
-   make INSTALL_ROOT=$startdir/pkg install
-}
-
diff --git a/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD
index 73fb925..d6d0634 100644
--- a/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD
@@ -1,12 +1,12 @@
 pkgname=mythmusic-svn
-pkgver=20018
+pkgver=20019
 pkgrel=1
 pkgdesc="Music playing plugin for MythTV"
 url="http://www.mythtv.org"
 license="GPL"
 arch=('i686' 'x86_64')
 
-depends=("mythtv-svn" 'libid3tag' 'libmad' 'libvorbis' 'flac>=1.1.4' 'libcdaudio' \
+depends=('mythtv-svn' 'libid3tag' 'libmad' 'libvorbis' 'flac>=1.1.4' 'libcdaudio' \
          'cdparanoia' 'fftw2' 'sdl' 'faad2>=2.6.1' 'lame' 'taglib' \
          'libvisual-plugins' 'libvisual-projectm')
 conflicts=('mythmusic')
diff --git a/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD b/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD
index 4dafc20..24ee880 100644
--- a/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD
@@ -1,34 +1,47 @@
 pkgname=mythnews-svn
-pkgver=16153
-pkgrel=4
+pkgver=20019
+pkgrel=1
 pkgdesc="News checking plugin for MythTV"
 url="http://www.mythtv.org"
-arch=('i686')
-depends=('mythtv-svn')
-conflicts=('mythtv-plugins-svn')
-groups=('mythtv-all-plugins-svn')
 license="GPL"
-source=()
+arch=('i686' 'x86_64')
+
+depends=('mythtv-svn')
+conflicts=('mythnews')
+groups=('mythtv-extras-svn')
+
+patches=()
+source=(`echo ${patches[@]:0}`)
 _svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins
 _svnmod=mythplugins
 
+
 build() {
-	cd $startdir/src/
-	echo svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
- 	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
-	cd $startdir/src/mythplugins
-	PLUGIN=mythnews
-	grep -q  programs-libs.pro  $PLUGIN/$PLUGIN/$PLUGIN.pro
-	if [ $? != 0 ]
-	then
-			echo "include ( ../../programs-libs.pro )" >> $PLUGIN/$PLUGIN/$PLUGIN.pro
-				msg "appending program lib"
-			fi
-	make distclean
-   ./configure --disable-all --enable-mythnews
-
-   make -j 2 || return 1
-
-   make INSTALL_ROOT=$startdir/pkg install
+
+	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
+#	svn co $_svntrunk --config-dir ./ $_svnmod
+
+	cd $startdir/src/$_svnmod
+
+	echo "--------------------------applying patches----------------------------------------------------"
+	for i in `echo ${patches[@]:0} `
+	do
+		echo applying $i
+		echo "-----------------------------"
+		patch -Np0  -i ${startdir}/src/$i  || return 1
+	done
+	echo "--------------------------done applying patches-----------------------------------------------"
+	
+	[ "$CARCH" = "i686"   ] && ARCH="i686"
+	[ "$CARCH" = "x86_64" ] && ARCH="x86-64"
+
+	# configure
+	./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \
+	--enable-mythnews || return 1
+
+	# build and install
+	. /etc/profile
+	make || return 1
+	make INSTALL_ROOT=$startdir/pkg install || return 1
+
 }
-md5sums=('2a9fbf45ae58a3a35857ce8d7c4d12db')
diff --git a/abs/core-testing/mythtv/trunk/mythphone/PKGBUILD b/abs/core-testing/mythtv/trunk/mythphone/PKGBUILD
deleted file mode 100644
index f6bf3ec..0000000
--- a/abs/core-testing/mythtv/trunk/mythphone/PKGBUILD
+++ /dev/null
@@ -1,42 +0,0 @@
-pkgname=mythphone-svn
-pkgver=16153
-pkgrel=3
-pkgdesc="Plugin that allows phone calls to be made to MythTv"
-url="http://www.mythtv.org"
-arch=('i686')
-depends=('mythtv-svn')
-conflicts=('mythtv-plugins-svn')
-groups=('mythtv-all-plugins-svn')
-license="GPL"
-source=()
-_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins
-_svnmod=mythplugins
-
-
-build() {
-	cd $startdir/src/
-	echo svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
- 	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
-	cd $startdir/src/mythplugins
-	make distclean
-	PLUGIN=mythphone
-	grep -q  programs-libs.pro  $PLUGIN/$PLUGIN/$PLUGIN.pro
-	if [ $? != 0 ]
-	then
-		echo "include ( ../../programs-libs.pro )" >> $PLUGIN/$PLUGIN/$PLUGIN.pro
-		msg  "appending program lib"
-	fi
-	
-	msg "Correcting configure    kde3 to kde"
-   	sed -i 's#kde3#kde#' configure || return 1
-   	./configure  --enable-opengl --disable-all --enable-mythphone || return 1
-	qmake mythplugins.pro || return 1
-	make qmake || return 1
-	
-	msg "Correcting Makefile    kde3 to kde"
- 	sed -i 's#kde3#kde#' ./mythphone/mythphone/Makefile || return 1
-   	
-	make -j 2 || return 1
-	make INSTALL_ROOT=$startdir/pkg install
-}
-
diff --git a/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD b/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD
index 4087034..2bddf9e 100644
--- a/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD
@@ -1,36 +1,47 @@
 pkgname=mythvideo-svn
-pkgver=16153
-pkgrel=2
+pkgver=20019
+pkgrel=1
 pkgdesc="Video playback and browsing plugin for MythTV"
 url="http://www.mythtv.org"
-arch=('i686')
-depends=('mythtv-svn'  'perlxml' 'perl-libwww' 'perl-uri' 'perl-xml-simple' 'ffmpeg')
 license="GPL"
-conflicts=('mythtv-plugins-svn')
-groups=('mythtv-all-plugins-svn')
+arch=('i686' 'x86_64')
 
-source=()
+depends=('mythtv-svn' 'mplayer' 'perlxml' 'perl-libwww' 'perl-uri' 'perl-xml-simple' 'ffmpeg')
+conflicts=('mythvideo')
+groups=('mythtv-extras-svn')
+
+patches=()
+source=(`echo ${patches[@]:0}`)
 _svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins
 _svnmod=mythplugins
 
 
 build() {
-	cd $startdir/src/
-	echo svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
- 	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
-	cd $startdir/src/mythplugins
-  	make distclean 
-	PLUGIN=mythvideo
-	grep -q  programs-libs.pro  $PLUGIN/$PLUGIN/$PLUGIN.pro
-	if [ $? != 0 ]
-	then
-			echo "include ( ../../programs-libs.pro )" >> $PLUGIN/$PLUGIN/$PLUGIN.pro
-				msg "appending program lib"
-			fi
-   ./configure  --disable-all --enable-mythvideo  --enable-transcode  
-
-   make -j 2 || return 1
-
-   make INSTALL_ROOT=$startdir/pkg install
+
+	svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
+#	svn co $_svntrunk --config-dir ./ $_svnmod
+
+	cd $startdir/src/$_svnmod
+
+	echo "--------------------------applying patches----------------------------------------------------"
+	for i in `echo ${patches[@]:0} `
+	do
+		echo applying $i
+		echo "-----------------------------"
+		patch -Np0  -i ${startdir}/src/$i  || return 1
+	done
+	echo "--------------------------done applying patches-----------------------------------------------"
+	
+	[ "$CARCH" = "i686"   ] && ARCH="i686"
+	[ "$CARCH" = "x86_64" ] && ARCH="x86-64"
+
+	# configure
+	./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \
+	--enable-mythvideo || return 1
+
+	# build and install
+	. /etc/profile
+	make || return 1
+	make INSTALL_ROOT=$startdir/pkg install || return 1
+
 }
-md5sums=('2a9fbf45ae58a3a35857ce8d7c4d12db')
-- 
cgit v0.12