Opened 8 years ago

Closed 7 years ago

#9578 closed Patch - Feature (fixed)

Increase arbitrary MAX_DISPLAY_CHANS in guidegrid.h

Reported by: Andrew Leech <andrew@…> Owned by:
Priority: minor Milestone: 0.25
Component: MythTV - General Version: 0.24-fixes
Severity: low Keywords:
Cc: Ticket locked: no

Description

The maximum number of channels visible on screen in guidegrid is locked to 12 by a define in guidegrid.h

On larger TV's at higher resolutions, more channels than this are certainly easily readable. Also, the number of channels is set in the theme separately.

The MAX_DISPLAY_CHANS is used to create an array so it's easier to keep it there rather than trying to dynamically create the array at runtime based on theme settings, but it would be good to set it significantly higher and allow the theme to set a useful size for use.

--- a/mythtv/programs/mythfrontend/guidegrid.h
+++ b/mythtv/programs/mythfrontend/guidegrid.h
@@ -28,7 +28,7 @@ class QTimer;
 class MythUIButtonList;
 class MythUIGuideGrid;

-#define MAX_DISPLAY_CHANS 12
+#define MAX_DISPLAY_CHANS 99
 #define MAX_DISPLAY_TIMES 36

 typedef vector<PixmapChannel>   pix_chan_list_t;

Change History (2)

comment:1 Changed 8 years ago by Andrew Leech <andrew@…>

Ok that was very daft on my part, the above patch isn't enough. The original figure of 12 is also hard coded in mythuiguidegrid.h
They should really be both referencing a single common define.

diff --git a/mythtv/libs/libmythui/mythuiguidegrid.cpp b/mythtv/libs/libmythui/mythuiguidegrid.cpp
index 5a85361..2eb57e7 100644
--- a/mythtv/libs/libmythui/mythuiguidegrid.cpp
+++ b/mythtv/libs/libmythui/mythuiguidegrid.cpp
@@ -109,7 +109,7 @@ bool MythUIGuideGrid::ParseElement(
     {
         m_channelCount = getFirstText(element).toInt();
         m_channelCount = max(m_channelCount, 1);
-        m_channelCount = min(m_channelCount, 12);
+        m_channelCount = min(m_channelCount, MAX_DISPLAY_CHANS);
     }
     else if (element.tagName() == "timeslots")
     {
diff --git a/mythtv/libs/libmythui/mythuiguidegrid.h b/mythtv/libs/libmythui/mythuiguidegrid.h
index 1302a9f..fa868d2 100644
--- a/mythtv/libs/libmythui/mythuiguidegrid.h
+++ b/mythtv/libs/libmythui/mythuiguidegrid.h
@@ -12,6 +12,7 @@

 #define ARROWIMAGESIZE 4
 #define RECSTATUSSIZE  8
+#define MAX_DISPLAY_CHANS 99

 class MythFontProperties;

diff --git a/mythtv/programs/mythfrontend/guidegrid.h b/mythtv/programs/mythfrontend/guidegrid.h
index 92d71f2..16d836d 100644
--- a/mythtv/programs/mythfrontend/guidegrid.h
+++ b/mythtv/programs/mythfrontend/guidegrid.h
@@ -16,6 +16,7 @@ using namespace std;
 #include "programinfo.h"
 #include "channelgroup.h"
 #include "channelutil.h"
+#include "mythuiguidegrid.h"

 // mythfrontend
 #include "schedulecommon.h"
@@ -28,7 +29,7 @@ class QTimer;
 class MythUIButtonList;
 class MythUIGuideGrid;

-#define MAX_DISPLAY_CHANS 12
+//#define MAX_DISPLAY_CHANS 99
 #define MAX_DISPLAY_TIMES 36

 typedef vector<PixmapChannel>   pix_chan_list_t;

comment:2 Changed 7 years ago by Github

Milestone: unknown0.25
Resolution: fixed
Status: newclosed

Bump the maximum number of channels in GuideGrid?.

Based on a patch from Andrew Leech, though I reduced the new masx to 40

  • which seems a little more practical.

Fixes #9578

Branch: master Changeset: 6cf957e6f5de237320f1c8f40c3bf8fc244fb42c

Note: See TracTickets for help on using tickets.