[patch] patch policy question (was: Re: [mythtv] Not displaying channum when option chosen)

Andrew M. Bishop amb at gedanken.demon.co.uk
Tue Feb 3 15:43:08 EST 2004


Isaac Richards <ijr at po.cwru.edu> writes:

> On Monday 02 February 2004 05:42 am, J. Donavan Stanley wrote:
> > Andrew M. Bishop wrote:
> > >I have been through version 0.14 of mythtv and removed most of the
> > >remaining instances where the channel number is displayed even though
> > >the user has selected the option not to display it.  The patches are
> > >below.
> > >
> > >The only other place that I can see that channum is used instead of
> > >chanid is in live TV where it is displayed in the OSD and used as the
> > >input and a few settings like the one that specifies the first channel
> > >that the program guide displays.
> >
> > You'll probably want to send these as a patch file instead of sticking
> > them inline in an email.
> 
> It also helps to put [patch] or something similar in the subject, so I can
> easily find all patches when I'm going through the list applying things.

>From the two replies above, I am not sure if I need to re-send my
patches or not (since Isaac has obviously seen the message anyway).

I can see why it would be good practice to put [patch] in the subject
to catch Isaac's attention (although all replies and discussion about
the patch would also have the same subject).

I am not sure that I know why attachments are better than inlining the
patch though.  Unless someone somewhere is mangling the e-mail it
should be perfectly readable and I am not the only person sending them
this way.  It has always worked for me before, Isaac has had no
problem receiving them, so why I want to attach them?


Here are all of the patches that I sent at the weekend as attachments:

in the e-mail - Re: Over/Underscan rounding error

-------------- next part --------------
--- /home/amb/mythtv/v0.14/mythtv/libs/libmythtv/videooutbase.orig.cpp	2004-01-28 20:23:17.000000000 +0000
+++ /home/amb/mythtv/v0.14/mythtv/libs/libmythtv/videooutbase.cpp	2004-02-01 09:36:00.000000000 +0000
@@ -273,9 +273,9 @@
 
     if (img_vscanf > 0) 
     {
-        // Veritcal overscan. Move the Y start point in original image.
-        imgy = (int)ceil(XJ_height * img_vscanf);
-        imgh = (int)ceil(XJ_height * (1 - 2 * img_vscanf));
+        // Vertical overscan. Move the Y start point in original image.
+        imgy = (int)floor(0.5 + XJ_height * img_vscanf);
+        imgh = (int)floor(0.5 + XJ_height * (1 - 2 * img_vscanf));
 
         // If there is an offset, apply it now that we have a room.
         // To move the image down, move the start point up.
@@ -299,8 +299,8 @@
     if (img_hscanf > 0) 
     {
         // Horizontal overscan. Move the X start point in original image.
-        imgx = (int)ceil(XJ_width * img_hscanf);
-        imgw = (int)ceil(XJ_width * (1 - 2 * img_hscanf));
+        imgx = (int)floor(0.5 + XJ_width * img_hscanf);
+        imgw = (int)floor(0.5 + XJ_width * (1 - 2 * img_hscanf));
         if (xoff > 0) 
         {
             if (xoff > imgx) 
@@ -318,11 +318,11 @@
     float vscanf, hscanf;
     if (img_vscanf < 0) 
     {
-        // Veritcal underscan. Move the starting Y point in the display window.
+        // Vertical underscan. Move the starting Y point in the display window.
         // Use the abolute value of scan factor.
         vscanf = fabs(img_vscanf);
-        dispyoff = (int)ceil(disph * vscanf);
-        disphoff = (int)ceil(disph * (1 - 2 * vscanf));
+        dispyoff = (int)floor(0.5 + disph * vscanf);
+        disphoff = (int)floor(0.5 + disph * (1 - 2 * vscanf));
         // Now offset the image within the extra blank space created by
         // underscanning.
         // To move the image down, increase the Y offset inside the display
@@ -345,8 +345,8 @@
     if (img_hscanf < 0) 
     {
         hscanf = fabs(img_hscanf);
-        dispxoff = (int)ceil(dispw * hscanf);
-        dispwoff = (int)ceil(dispw * (1 - 2 * hscanf));
+        dispxoff = (int)floor(0.5 + dispw * hscanf);
+        dispwoff = (int)floor(0.5 + dispw * (1 - 2 * hscanf));
         if (xoff > 0) 
         {
             if (xoff > dispxoff) 
@@ -426,6 +426,14 @@
     //printf("After: %dx%d%+d%+d\n", dispwoff, disphoff, dispxoff, 
     //dispyoff);
 
+    VERBOSE(VB_PLAYBACK,
+            QString("Image size. dispxoff %1, dispxoff: %2, dispwoff: %3, disphoff: %4")
+            .arg(dispxoff).arg(dispyoff).arg(dispwoff).arg(disphoff));
+
+    VERBOSE(VB_PLAYBACK,
+            QString("Image size. imgx %1, imgy: %2, imgw: %3, imgh: %4")
+           .arg(imgx).arg(imgy).arg(imgw).arg(imgh));
+
     DrawUnusedRects();
 }
 
-------------- next part --------------

in the e-mail - Not displaying channum when option chosen

-------------- next part --------------
--- /home/amb/mythtv/v0.14/mythtv/libs/libmythtv/progfind.orig.cpp	2004-01-29 03:27:07.000000000 +0000
+++ /home/amb/mythtv/v0.14/mythtv/libs/libmythtv/progfind.cpp	2004-02-01 09:28:33.000000000 +0000
@@ -332,7 +332,8 @@
         QString channame = "";
         QString recording = "";
 
-        channum = showData[curShow].channelNum;
+        if(!gContext->GetNumSetting("DisplayChanNum"))
+            channum = showData[curShow].channelNum;
         channame = showData[curShow].channelCallsign;
         title = progData[curProgram];
         timedate = showData[curShow].startDisplay + " - " +
-------------- next part --------------
--- /home/amb/mythtv/v0.14/mythtv/libs/libmythtv/proglist.orig.cpp	2004-01-30 18:03:54.000000000 +0000
+++ /home/amb/mythtv/v0.14/mythtv/libs/libmythtv/proglist.cpp	2004-02-01 10:06:03.000000000 +0000
@@ -569,6 +569,7 @@
             gContext->GetSetting("ChannelOrdering", "channum + 0");
         QString querystr = "SELECT channel.chanid, channel.channum, "
             "channel.callsign FROM channel ORDER BY " + channelOrdering + ";";
+        int displaychannum = gContext->GetNumSetting("DisplayChanNum");
         QSqlQuery query;
         query.exec(querystr);
         if (query.isActive() && query.numRowsAffected())
@@ -578,7 +579,9 @@
                 QString chanid = query.value(0).toString();
                 QString chantext;
                 QString channum = query.value(1).toString();
-                if (channum != QString::null && channum != "")
+                if(displaychannum)
+                    chantext="";
+                else if (channum != QString::null && channum != "")
                     chantext = channum;
                 else
                     chantext = "???";
@@ -817,6 +820,7 @@
             ltype->SetUpArrow(skip > 0);
             ltype->SetDownArrow(skip + listsize < itemCount);
 
+            int displaychannum = gContext->GetNumSetting("DisplayChanNum");
             int i;
             for (i = 0; i < listsize; i++)
             {
@@ -826,7 +830,10 @@
                 ProgramInfo *pi = itemList.at(i+skip);
 
                 ltype->SetItemText(i, 1, pi->startts.toString(timeFormat));
-                ltype->SetItemText(i, 2, pi->chanstr + " " + pi->chansign);
+                if(displaychannum)
+                    ltype->SetItemText(i, 2, pi->chansign);
+                else
+                    ltype->SetItemText(i, 2, pi->chanstr + " " + pi->chansign);
 
                 if (pi->subtitle == "")
                     tmptitle = pi->title;
-------------- next part --------------
--- /home/amb/mythtv/v0.14/mythtv/programs/mythfrontend/channelrecpriority.orig.cpp	2004-01-28 22:34:59.000000000 +0000
+++ /home/amb/mythtv/v0.14/mythtv/programs/mythfrontend/channelrecpriority.cpp	2004-02-01 11:29:29.000000000 +0000
@@ -431,7 +431,7 @@
         }
     }
     else if (!result.isActive())
-        MythContext::DBError("Get channel recording prioritiess query", query);
+        MythContext::DBError("Get channel recording priorities query", query);
 }
 
 typedef struct RecPriorityInfo 
@@ -555,6 +555,8 @@
             ltype->ResetList();
             ltype->SetActive(true);
 
+            int displaychannum = gContext->GetNumSetting("DisplayChanNum");
+
             QMap<QString, ChannelInfo>::Iterator it;
             for (it = channelData.begin(); it != channelData.end(); ++it)
             {
@@ -572,8 +574,11 @@
                             curitem = new ChannelInfo(*chanInfo);
                             ltype->SetItemCurrent(cnt);
                         }
-                        
-                        ltype->SetItemText(cnt, 1, chanInfo->chanstr);
+
+                        if(displaychannum)
+                            ltype->SetItemText(cnt, 1, "");
+                        else
+                            ltype->SetItemText(cnt, 1, chanInfo->chanstr);
                         ltype->SetItemText(cnt, 2, chanInfo->callsign);
                         if (chanInfo->recpriority.toInt() > 0)
                             ltype->SetItemText(cnt, 3, "+");
-------------- next part --------------

-- 
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop                             amb at gedanken.demon.co.uk
                                      http://www.gedanken.demon.co.uk/


More information about the mythtv-dev mailing list