Ticket #1521: scan_menu_patch.txt

File scan_menu_patch.txt, 3.6 KB (added by anonymous, 19 years ago)
Line 
1Index: libs/libmythtv/NuppelVideoPlayer.h
2===================================================================
3--- libs/libmythtv/NuppelVideoPlayer.h  (revision 9372)
4+++ libs/libmythtv/NuppelVideoPlayer.h  (working copy)
5@@ -145,9 +145,10 @@
6     void SetForcedAspectRatio(int mpeg2_aspect_value, int letterbox_permission);
7 
8     void NextScanType(void)
9-        { SetScanType((FrameScanType)(((int)m_scan + 1) & 0x3)); }
10+        { SetScanType((FrameScanType)(((int)GetScanType() + 1) & 0x3)); }
11     void SetScanType(FrameScanType);
12-    FrameScanType GetScanType(void) const { return m_scan; }
13+    FrameScanType GetCurrentScanType(void) const { return m_scan; }
14+    FrameScanType GetScanType(void) const { return m_scan_locked ? m_scan : kScan_Detect; }
15 
16     void SetOSDFontName(const QString osdfonts[22], const QString &prefix);
17     void SetOSDThemeName(const QString themename);
18Index: libs/libmythtv/tv_play.cpp
19===================================================================
20--- libs/libmythtv/tv_play.cpp  (revision 9372)
21+++ libs/libmythtv/tv_play.cpp  (working copy)
22@@ -1825,6 +1825,16 @@
23     return false;
24 }
25 
26+static inline QString toQString(FrameScanType scan) {
27+    switch (scan) {
28+    case kScan_Detect:       return QObject::tr("Detect");
29+    case kScan_Interlaced:   return QObject::tr("Interlaced (Normal)");
30+    case kScan_Intr2ndField: return QObject::tr("Interlaced (Reversed)");
31+    case kScan_Progressive:  return QObject::tr("Progressive");
32+    default:                 return QObject::tr("Unknown");
33+    }
34+}
35+
36 void TV::ProcessKeypress(QKeyEvent *e)
37 {
38 #if DEBUG_ACTIONS
39@@ -2246,9 +2256,11 @@
40                 DoTogglePictureAttribute();
41             }
42         }
43-        else if (action == "NEXTSCAN")
44+        else if (action == "NEXTSCAN") {
45             activenvp->NextScanType();
46-        else if (action == "ARBSEEK")
47+            if (GetOSD())
48+                GetOSD()->SetSettingsText(toQString(activenvp->GetScanType()), 3);
49+        } else if (action == "ARBSEEK")
50         {
51             if (asInputMode)
52             {
53@@ -3197,6 +3209,14 @@
54         mesg += " %1X";
55         mesg = mesg.arg(normal_speed);
56     }
57+    FrameScanType scan_type = activenvp->GetCurrentScanType();
58+    switch (scan_type) {
59+    case kScan_Progressive:
60+        mesg += " (Progressive)"; break;
61+    case kScan_Interlaced:
62+    case kScan_Intr2ndField:
63+        mesg += " (Interlaced)"; break;
64+    }
65     return mesg;
66 }
67 
68@@ -6053,7 +6073,7 @@
69                                  "STRETCHGROUP");
70 
71     // add scan mode override settings to menu
72-    int scan_type = kScan_Ignore;
73+    FrameScanType scan_type = kScan_Ignore;
74     if (activenvp)
75         scan_type = activenvp->GetScanType();
76 
77@@ -6061,16 +6081,16 @@
78         treeMenu, tr("Video Scan"), "SCANMODE");
79     subitem = new OSDGenericTree(
80         item, tr("Detect"), "SELECTSCAN_3",
81-        (scan_type == 3) ? 1 : 0, NULL, "SCANGROUP");
82+        (scan_type == kScan_Detect) ? 1 : 0, NULL, "SCANGROUP");
83     subitem = new OSDGenericTree(
84         item, tr("Progressive"), "SELECTSCAN_0",
85-        (scan_type == 0) ? 1 : 0, NULL, "SCANGROUP");
86+        (scan_type == kScan_Progressive) ? 1 : 0, NULL, "SCANGROUP");
87     subitem = new OSDGenericTree(
88         item, tr("Interlaced (Normal)"), "SELECTSCAN_1",
89-        (scan_type == 1) ? 1 : 0, NULL, "SCANGROUP");
90+        (scan_type == kScan_Interlaced) ? 1 : 0, NULL, "SCANGROUP");
91     subitem = new OSDGenericTree(
92         item, tr("Interlaced (Reversed)"), "SELECTSCAN_2",
93-        (scan_type == 2) ? 1 : 0, NULL, "SCANGROUP");
94+        (scan_type == kScan_Intr2ndField) ? 1 : 0, NULL, "SCANGROUP");
95     
96     // add sleep items to menu
97