Skip to content

Commit 11f5e1c

Browse files
J-e-f-f-ABeirdo
authored andcommitted
Rework LCD screens on 20x4 screens
1) Bigclock now has a Record indicator on the left side. If recording "R" "E" "C" "#" is shown in the left-most column, with # being the number of concurrent recordings. 2) The 'Recording" detail screens will be show successively instead of alternating between the clock between each. Example: Before: Clock - Rec 1 - Clock - Rec 2 - Clock <etc> After: Clock - Rec 1 - Rec 2 - Rec 3 - Clock This has not been tested with other size screens, so it could well 'break' the display formatting for them. Signed-off-by: Gavin Hurlbut <ghurlbut@mythtv.org>
1 parent 153e5b6 commit 11f5e1c

File tree

1 file changed

+63
-27
lines changed

1 file changed

+63
-27
lines changed

mythtv/programs/mythlcdserver/lcdprocclient.cpp

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define LCD_VERSION_5 2
3535

3636
#define LCD_RECSTATUS_TIME 10000
37-
#define LCD_TIME_TIME 5000
37+
#define LCD_TIME_TIME 3000
3838
#define LCD_SCROLLLIST_TIME 2000
3939

4040
int lcdStartCol = LCD_START_COL;
@@ -431,6 +431,10 @@ void LCDProcClient::init()
431431
if (gCoreContext->GetSetting("LCDBigClock", "1") == "1")
432432
{
433433
// Big Clock - spans multiple lines
434+
sendToServer("widget_add Time rec1 string");
435+
sendToServer("widget_add Time rec2 string");
436+
sendToServer("widget_add Time rec3 string");
437+
sendToServer("widget_add Time recCnt string");
434438
sendToServer("widget_add Time d0 num");
435439
sendToServer("widget_add Time d1 num");
436440
sendToServer("widget_add Time sep num");
@@ -498,6 +502,7 @@ void LCDProcClient::init()
498502
sendToServer("widget_add RecStatus textWidget1 string");
499503
sendToServer("widget_add RecStatus textWidget2 string");
500504
sendToServer("widget_add RecStatus textWidget3 string");
505+
sendToServer("widget_add RecStatus textWidget4 string");
501506
sendToServer("widget_add RecStatus progressBar hbar");
502507

503508
lcd_ready = true;
@@ -1828,9 +1833,26 @@ void LCDProcClient::dobigclock (bool init)
18281833
}
18291834
outputRightText("Time", aString, "ampm", lcdHeight - 1);
18301835

1836+
if (isRecording)
1837+
{
1838+
outputLeftText("Time","R","rec1",1);
1839+
outputLeftText("Time","E","rec2",2);
1840+
outputLeftText("Time","C","rec3",3);
1841+
aString = QString::number((int) tunerList.size());
1842+
outputLeftText("Time",aString,"recCnt",4);
1843+
1844+
}
1845+
else
1846+
{
1847+
outputLeftText("Time"," ","rec1",1);
1848+
outputLeftText("Time"," ","rec2",2);
1849+
outputLeftText("Time"," ","rec3",3);
1850+
outputLeftText("Time"," ","recCnt",4);
1851+
}
1852+
18311853
// Add Hour 10's Digit
18321854
aString = "widget_set Time d0 ";
1833-
aString += QString::number(lcdWidth/2 - 6 - xoffset) + " ";
1855+
aString += QString::number(lcdWidth/2 - 5 - xoffset) + " ";
18341856
if (toffset == 0)
18351857
aString += "11";
18361858
else
@@ -1839,25 +1861,25 @@ void LCDProcClient::dobigclock (bool init)
18391861

18401862
// Add Hour 1's Digit
18411863
aString = "widget_set Time d1 ";
1842-
aString += QString::number(lcdWidth/2 - 3 - xoffset) + " ";
1864+
aString += QString::number(lcdWidth/2 - 2 - xoffset) + " ";
18431865
aString += time.at(0 + toffset);
18441866
sendToServer(aString);
18451867

18461868
// Add the Colon
18471869
aString = "widget_set Time sep ";
1848-
aString += QString::number(lcdWidth/2 - xoffset);
1870+
aString += QString::number(lcdWidth/2 + 1 - xoffset);
18491871
aString += " 10"; // 10 means: colon
18501872
sendToServer(aString);
18511873

18521874
// Add Minute 10's Digit
18531875
aString = "widget_set Time d2 ";
1854-
aString += QString::number(lcdWidth/2 + 1 - xoffset) + " ";
1876+
aString += QString::number(lcdWidth/2 + 2 - xoffset) + " ";
18551877
aString += time.at(2 + toffset);
18561878
sendToServer(aString);
18571879

18581880
// Add Minute 1's Digit
18591881
aString = "widget_set Time d3 ";
1860-
aString += QString::number(lcdWidth/2 + 4 - xoffset) + " ";
1882+
aString += QString::number(lcdWidth/2 + 5 - xoffset) + " ";
18611883
aString += time.at(3 + toffset);
18621884
sendToServer(aString);
18631885

@@ -1944,8 +1966,10 @@ void LCDProcClient::outputRecStatus(void)
19441966
isTimeVisible = false;
19451967
activeScreen = "RecStatus";
19461968
}
1947-
else
1969+
else if (lcdTunerNo > (int) tunerList.size() - 1)
19481970
{
1971+
lcdTunerNo = 0;
1972+
19491973
// switch to the time screen
19501974
setPriority("Time", MEDIUM);
19511975
setPriority("RecStatus", LOW);
@@ -1960,7 +1984,7 @@ void LCDProcClient::outputRecStatus(void)
19601984
isTimeVisible = true;
19611985

19621986
return;
1963-
}
1987+
}
19641988

19651989
QString aString, status;
19661990
QStringList list;
@@ -1970,27 +1994,38 @@ void LCDProcClient::outputRecStatus(void)
19701994
scrollListItems.clear();
19711995
if (lcdHeight >= 4)
19721996
{
1973-
outputCenteredText("RecStatus", tr("RECORDING"), "textWidget1", 1);
1974-
1975-
status = tuner.title;
1976-
if (!tuner.subtitle.isEmpty())
1977-
status += " (" + tuner.subtitle + ")";
1978-
1979-
list = formatScrollerText(status);
1980-
assignScrollingList(list, "RecStatus", "textWidget2", 2);
1997+
// LINE 1 - "R" + Channel
1998+
status = tr("R ");
1999+
status += tuner.channame;
2000+
outputLeftText("RecStatus", status, "textWidget1", 1);
19812001

1982-
status = tuner.startTime.toString("hh:mm") + " to " +
1983-
tuner.endTime.toString("hh:mm");
1984-
outputCenteredText("RecStatus", status, "textWidget3", 3);
2002+
// LINE 2 - "E" + Program Title
2003+
status = tr("E ");
2004+
status += tuner.title;
2005+
outputLeftText("RecStatus", status, "textWidget2", 2);
2006+
//list = formatScrollerText(status);
2007+
//assignScrollingList(list, "RecStatus", "textWidget2", 2);
2008+
2009+
// LINE 3 - "C" + Program Subtitle
2010+
status = tr("C ");
2011+
status += tuner.subtitle;
2012+
outputLeftText("RecStatus", status, "textWidget3", 3);
2013+
//list = formatScrollerText(status);
2014+
//assignScrollingList(list, "RecStatus", "textWidget3", 3);
2015+
2016+
// LINE 4 - hh:mm-hh:mm + Progress Bar
2017+
status = tuner.startTime.toString("hh:mm") + "-" +
2018+
tuner.endTime.toString("hh:mm");
2019+
outputLeftText("RecStatus", status, "textWidget4", 4);
19852020

19862021
int length = tuner.startTime.secsTo(tuner.endTime);
19872022
int delta = tuner.startTime.secsTo(QDateTime::currentDateTime());
19882023
double rec_progress = (double) delta / length;
19892024

1990-
aString = "widget_set RecStatus progressBar 1 ";
2025+
aString = "widget_set RecStatus progressBar 13 ";
19912026
aString += QString::number(lcdHeight);
19922027
aString += " ";
1993-
aString += QString::number((int)rint(rec_progress * lcdWidth *
2028+
aString += QString::number((int)rint(rec_progress * (lcdWidth - 13) *
19942029
cellWidth));
19952030
sendToServer(aString);
19962031

@@ -2004,7 +2039,7 @@ void LCDProcClient::outputRecStatus(void)
20042039
status += "|(" + tuner.subtitle + ")";
20052040

20062041
status += "|" + tuner.startTime.toString("hh:mm") + " to " +
2007-
tuner.endTime.toString("hh:mm");
2042+
tuner.endTime.toString("hh:mm");
20082043

20092044
list = formatScrollerText(status);
20102045
assignScrollingList(list, "RecStatus", "textWidget1", 1);
@@ -2032,11 +2067,7 @@ void LCDProcClient::outputRecStatus(void)
20322067
listTime = LCD_TIME_TIME;
20332068

20342069
recStatusTimer->start(listTime);
2035-
2036-
if (lcdTunerNo < (int) tunerList.size() - 1)
2037-
lcdTunerNo++;
2038-
else
2039-
lcdTunerNo = 0;
2070+
lcdTunerNo++;
20402071
}
20412072

20422073
void LCDProcClient::outputScrollerText(QString theScreen, QString theText,
@@ -2348,6 +2379,10 @@ void LCDProcClient::removeWidgets()
23482379

23492380
if (lcd_bigclock)
23502381
{
2382+
sendToServer("widget_del Time rec1");
2383+
sendToServer("widget_del Time rec2");
2384+
sendToServer("widget_del Time rec3");
2385+
sendToServer("widget_del Time recCnt");
23512386
sendToServer("widget_del Time d0");
23522387
sendToServer("widget_del Time d1");
23532388
sendToServer("widget_del Time sep");
@@ -2367,6 +2402,7 @@ void LCDProcClient::removeWidgets()
23672402
sendToServer("widget_del RecStatus textWidget1");
23682403
sendToServer("widget_del RecStatus textWidget2");
23692404
sendToServer("widget_del RecStatus textWidget3");
2405+
sendToServer("widget_del RecStatus textWidget4");
23702406
sendToServer("widget_del RecStatus progressBar");
23712407
}
23722408

0 commit comments

Comments
 (0)