diff --git a/mythtv/libs/libmythdb/lcddevice.cpp b/mythtv/libs/libmythdb/lcddevice.cpp
index 9fbe7d2..ad7d705 100644
|
a
|
b
|
void LCD::setTunerLEDs(enum LCDTunerSet tuner, bool on)
|
| 498 | 498 | sendToServer(QString("UPDATE_LEDS %1").arg(lcd_ledmask)); |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | | void LCD::setChannelProgress(float value) |
| | 501 | void LCD::setChannelProgress(QString time, float value) |
| 502 | 502 | { |
| 503 | 503 | if (!lcd_ready || !lcd_showchannel) |
| 504 | 504 | return; |
| 505 | 505 | |
| 506 | 506 | value = std::min(std::max(0.0f, value), 1.0f); |
| 507 | | sendToServer(QString("SET_CHANNEL_PROGRESS %1").arg(value)); |
| | 507 | sendToServer(QString("SET_CHANNEL_PROGRESS %1 %2").arg(quotedString(time)).arg(value)); |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | void LCD::setGenericProgress(float value) |
diff --git a/mythtv/libs/libmythdb/lcddevice.h b/mythtv/libs/libmythdb/lcddevice.h
index c5e4002..e576817 100644
|
a
|
b
|
class MPUBLIC LCD : public QObject, public MythSocketCBs
|
| 236 | 236 | // While watching Live/Recording/Pause Buffer, occasionaly describe how |
| 237 | 237 | // much of the program has been seen (between 0.0 and 1.0) |
| 238 | 238 | // (e.g. [current time - start time] / [end time - start time] ) |
| 239 | | void setChannelProgress(float percentViewed); |
| | 239 | void setChannelProgress(QString time, float percentViewed); |
| 240 | 240 | |
| 241 | 241 | // Show the Menu |
| 242 | 242 | // QPtrList is a pointer to a bunch of menu items |
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index 5f57074..6e8d3fd 100644
|
a
|
b
|
bool TV::HandleLCDTimerEvent(void)
|
| 3000 | 3000 | if (lcd) |
| 3001 | 3001 | { |
| 3002 | 3002 | float progress = 0.0f; |
| | 3003 | QString lcd_time_string; |
| 3003 | 3004 | bool showProgress = true; |
| 3004 | 3005 | |
| 3005 | 3006 | if (StateIsLiveTV(GetState(actx))) |
| … |
… |
bool TV::HandleLCDTimerEvent(void)
|
| 3014 | 3015 | if (showProgress) |
| 3015 | 3016 | { |
| 3016 | 3017 | osdInfo info; |
| 3017 | | if (actx->CalcPlayerSliderPosition(info)) |
| | 3018 | if (actx->CalcPlayerSliderPosition(info)) { |
| 3018 | 3019 | progress = info.values["position"] * 0.001f; |
| | 3020 | |
| | 3021 | lcd_time_string = info.text["playedtime"] + " / " + info.text["totaltime"]; |
| | 3022 | // if the string is longer than the LCD width, remove all spaces |
| | 3023 | if (lcd_time_string.length() > (int)lcd->getLCDWidth()) |
| | 3024 | lcd_time_string.remove(' '); |
| | 3025 | } |
| 3019 | 3026 | } |
| 3020 | | lcd->setChannelProgress(progress); |
| | 3027 | lcd->setChannelProgress(lcd_time_string, progress); |
| 3021 | 3028 | } |
| 3022 | 3029 | ReturnPlayerLock(actx); |
| 3023 | 3030 | |
diff --git a/mythtv/programs/mythlcdserver/lcdprocclient.cpp b/mythtv/programs/mythlcdserver/lcdprocclient.cpp
index 301a269..7df20f4 100644
|
a
|
b
|
void LCDProcClient::init()
|
| 473 | 473 | setPriority("Channel", LOW); |
| 474 | 474 | sendToServer("widget_add Channel topWidget string"); |
| 475 | 475 | sendToServer("widget_add Channel botWidget string"); |
| | 476 | sendToServer("widget_add Channel timeWidget string"); |
| 476 | 477 | sendToServer("widget_add Channel progressBar hbar"); |
| 477 | 478 | |
| 478 | 479 | // The Generic Screen |
| … |
… |
void LCDProcClient::startChannel(QString channum, QString title, QString subtitl
|
| 1124 | 1125 | formatScrollingWidgets(); |
| 1125 | 1126 | } |
| 1126 | 1127 | |
| | 1128 | channel_time = ""; |
| 1127 | 1129 | progress = 0.0; |
| 1128 | 1130 | outputChannel(); |
| 1129 | 1131 | } |
| … |
… |
void LCDProcClient::setLevels(int numbLevels, float *values)
|
| 1679 | 1681 | } |
| 1680 | 1682 | } |
| 1681 | 1683 | |
| 1682 | | void LCDProcClient::setChannelProgress(float value) |
| | 1684 | void LCDProcClient::setChannelProgress(const QString &time, float value) |
| 1683 | 1685 | { |
| 1684 | 1686 | if (!lcd_ready) |
| 1685 | 1687 | return; |
| 1686 | 1688 | |
| 1687 | 1689 | progress = value; |
| | 1690 | channel_time = time; |
| 1688 | 1691 | |
| 1689 | 1692 | if (progress < 0.0) |
| 1690 | 1693 | progress = 0.0; |
| … |
… |
void LCDProcClient::outputChannel()
|
| 2160 | 2163 | aString += " "; |
| 2161 | 2164 | aString += QString::number((int)rint(progress * lcdWidth * cellWidth)); |
| 2162 | 2165 | sendToServer(aString); |
| | 2166 | |
| | 2167 | if (lcdHeight >= 4) |
| | 2168 | outputCenteredText("Channel", channel_time, "timeWidget", 3); |
| 2163 | 2169 | } |
| 2164 | 2170 | else |
| 2165 | 2171 | sendToServer("widget_set Channel progressBar 1 1 0"); |
| … |
… |
void LCDProcClient::removeWidgets()
|
| 2313 | 2319 | { |
| 2314 | 2320 | sendToServer("widget_del Channel progressBar"); |
| 2315 | 2321 | sendToServer("widget_del Channel topWidget"); |
| | 2322 | sendToServer("widget_del Channel timeWidget"); |
| 2316 | 2323 | sendToServer("screen_del Channel"); |
| 2317 | 2324 | |
| 2318 | 2325 | sendToServer("widget_del Generic progressBar"); |
diff --git a/mythtv/programs/mythlcdserver/lcdprocclient.h b/mythtv/programs/mythlcdserver/lcdprocclient.h
index 5a31200..a87339d 100644
|
a
|
b
|
class LCDProcClient : public QObject
|
| 43 | 43 | void setLevels(int numbLevels, float *values); |
| 44 | 44 | void switchToChannel(QString channum = "", QString title = "", |
| 45 | 45 | QString subtitle = ""); |
| 46 | | void setChannelProgress(float percentViewed); |
| | 46 | void setChannelProgress(const QString &time, float percentViewed); |
| 47 | 47 | void switchToMenu(QList<LCDMenuItem> *menuItems, QString app_name = "", |
| 48 | 48 | bool popMenu = true); |
| 49 | 49 | void switchToGeneric(QList<LCDTextItem> *textItems); |
| … |
… |
class LCDProcClient : public QObject
|
| 169 | 169 | |
| 170 | 170 | float EQlevels[10]; |
| 171 | 171 | float progress; |
| | 172 | QString channel_time; |
| 172 | 173 | /** true if the generic progress indicator is a busy |
| 173 | 174 | (ie. doesn't have a known total steps */ |
| 174 | 175 | bool busy_progress; |
diff --git a/mythtv/programs/mythlcdserver/lcdserver.cpp b/mythtv/programs/mythlcdserver/lcdserver.cpp
index fce6036..7ffb2b0 100644
|
a
|
b
|
void LCDServer::setChannelProgress(const QStringList &tokens, QTcpSocket *socket
|
| 579 | 579 | |
| 580 | 580 | QString flat = tokens.join(" "); |
| 581 | 581 | |
| 582 | | if (tokens.count() != 2) |
| | 582 | if (tokens.count() != 3) |
| 583 | 583 | { |
| 584 | 584 | VERBOSE(VB_IMPORTANT, "LCDServer: bad SET_CHANNEL_PROGRESS command: " |
| 585 | 585 | << flat); |
| … |
… |
void LCDServer::setChannelProgress(const QStringList &tokens, QTcpSocket *socket
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | bool bOK; |
| 591 | | float progress = tokens[1].toFloat(&bOK); |
| | 591 | float progress = tokens[2].toFloat(&bOK); |
| 592 | 592 | if (!bOK) |
| 593 | 593 | { |
| 594 | 594 | VERBOSE(VB_IMPORTANT, "LCDServer: bad float value in " |
| … |
… |
void LCDServer::setChannelProgress(const QStringList &tokens, QTcpSocket *socket
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | if (m_lcd) |
| 601 | | m_lcd->setChannelProgress(progress); |
| | 601 | m_lcd->setChannelProgress(tokens[1], progress); |
| 602 | 602 | |
| 603 | 603 | sendMessage(socket, "OK"); |
| 604 | 604 | } |