diff --git a/mythtv/libs/libmythservicecontracts/services/frontendServices.h b/mythtv/libs/libmythservicecontracts/services/frontendServices.h
index a0844b8817a..1f148e7e245 100644
a
|
b
|
class SERVICE_PUBLIC FrontendServices : public Service |
13 | 13 | Q_CLASSINFO( "SendNotification_Method", "POST" ) |
14 | 14 | Q_CLASSINFO( "SendAction_Method", "POST" ) |
15 | 15 | Q_CLASSINFO( "PlayRecording_Method", "POST" ) |
| 16 | Q_CLASSINFO( "PlayLiveTV_Method", "POST" ) |
16 | 17 | Q_CLASSINFO( "PlayVideo_Method", "POST" ) |
17 | 18 | Q_CLASSINFO( "SendKey_Method", "POST" ) |
18 | 19 | |
… |
… |
class SERVICE_PUBLIC FrontendServices : public Service |
47 | 48 | uint Width, uint Height) = 0; |
48 | 49 | virtual bool PlayRecording(int RecordedId, int ChanId, |
49 | 50 | const QDateTime &StartTime) = 0; |
| 51 | virtual bool PlayLiveTV(int ChanId) = 0; |
50 | 52 | virtual bool PlayVideo(const QString &Id, |
51 | 53 | bool UseBookmark) = 0; |
52 | 54 | virtual QStringList GetContextList(void) = 0; |
diff --git a/mythtv/programs/mythfrontend/services/frontend.cpp b/mythtv/programs/mythfrontend/services/frontend.cpp
index 7903ded1e6c..eb02c64d5c2 100644
a
|
b
|
bool Frontend::PlayRecording(int RecordedId, int ChanId, |
189 | 189 | return false; |
190 | 190 | } |
191 | 191 | |
| 192 | bool Frontend::PlayLiveTV(int ChanId) |
| 193 | { |
| 194 | if (ChanId <= 0) |
| 195 | { |
| 196 | LOG(VB_GENERAL, LOG_ERR, LOC + |
| 197 | QString("PlayLiveTV: Channel ID is invalid.")); |
| 198 | return false; |
| 199 | } |
| 200 | |
| 201 | // channel tuning is only available from state playback i.e. Live TV |
| 202 | if (GetMythUI()->GetCurrentLocation().toLower() != "playback") |
| 203 | { |
| 204 | GetMythMainWindow()->JumpTo(jumpMap["Live TV"]); |
| 205 | |
| 206 | QTime timer; |
| 207 | timer.start(); |
| 208 | while ((timer.elapsed() < FE_LONG_TO) && |
| 209 | (GetMythUI()->GetCurrentLocation().toLower() != "playback")) |
| 210 | std::this_thread::sleep_for(std::chrono::milliseconds(10)); |
| 211 | } |
| 212 | |
| 213 | if (GetMythUI()->GetCurrentLocation().toLower() == "playback") |
| 214 | { |
| 215 | LOG(VB_GENERAL, LOG_INFO, LOC + |
| 216 | QString("PlayLiveTV, ChanID: %1") |
| 217 | .arg(ChanId)); |
| 218 | |
| 219 | QString message = QString("NETWORK_CONTROL PLAY CHANID %1") |
| 220 | .arg(ChanId); |
| 221 | |
| 222 | MythEvent me(message); |
| 223 | gCoreContext->dispatch(me); |
| 224 | return true; |
| 225 | } |
| 226 | |
| 227 | return false; |
| 228 | } |
| 229 | |
192 | 230 | bool Frontend::PlayVideo(const QString &Id, bool UseBookmark) |
193 | 231 | { |
194 | 232 | if (TV::IsTVRunning()) |
diff --git a/mythtv/programs/mythfrontend/services/frontend.h b/mythtv/programs/mythfrontend/services/frontend.h
index ffefe7baecc..309972fe77a 100644
a
|
b
|
class Frontend : public FrontendServices |
36 | 36 | uint Width, uint Height) override; // FrontendServices |
37 | 37 | bool PlayRecording(int RecordedId, int ChanId, |
38 | 38 | const QDateTime &StartTime) override; // FrontendServices |
| 39 | bool PlayLiveTV(int ChanId) override; // FrontendServices |
39 | 40 | bool PlayVideo(const QString &Id, bool UseBookmark) override; // FrontendServices |
40 | 41 | QStringList GetContextList(void) override; // FrontendServices |
41 | 42 | DTC::FrontendActionList* GetActionList(const QString &Context) override; // FrontendServices |