Go to the documentation of this file.
35 m_frameTimer(new QTimer(this)),
36 m_isMiniPlayer(isMiniPlayer)
54 LOG(VB_GENERAL, LOG_ERR, QString(
"Cannot load screen '%1'").arg(winName));
80 if (!optional && !
type)
98 for (
int x = 1; x < 3; x++)
106 for (
int x = 1; x < 5; x++)
114 for (
int x = 1; x < 7; x++)
122 for (
int x = 1; x < 9; x++)
130 catch (
const QString &name)
132 LOG(VB_GENERAL, LOG_ERR,
133 QString(
"Theme is missing a critical theme element ('%1')")
146 LOG(VB_GENERAL, LOG_ERR,
"Cannot find any monitors. Bailing out!");
148 tr(
"You don't have any monitors defined!"));
172 s += QString(
"%1").arg(
p->getMonitor()->id);
195 for (
int i = 0; i < actions.size() && !handled; i++)
197 QString
action = actions[i];
221 else if (
action ==
"MENU")
239 auto *menuPopup =
new MythDialogBox(
"Menu", popupStack,
"mainmenu");
241 if (menuPopup->Create())
244 menuPopup->SetReturnEvent(
this,
"mainmenu");
246 menuPopup->AddButtonV(tr(
"Change View"), QVariant::fromValue(QString(
"VIEW")));
247 menuPopup->AddButtonV(tr(
"Change Camera 1"), QVariant::fromValue(QString(
"CAMERA1")));
250 menuPopup->AddButtonV(tr(
"Change Camera 2"), QVariant::fromValue(QString(
"CAMERA2")));
254 menuPopup->AddButtonV(tr(
"Change Camera 3"), QVariant::fromValue(QString(
"CAMERA3")));
255 menuPopup->AddButtonV(tr(
"Change Camera 4"), QVariant::fromValue(QString(
"CAMERA4")));
260 menuPopup->AddButtonV(tr(
"Change Camera 5"), QVariant::fromValue(QString(
"CAMERA5")));
261 menuPopup->AddButtonV(tr(
"Change Camera 6"), QVariant::fromValue(QString(
"CAMERA6")));
266 menuPopup->AddButtonV(tr(
"Change Camera 7"), QVariant::fromValue(QString(
"CAMERA7")));
267 menuPopup->AddButtonV(tr(
"Change Camera 8"), QVariant::fromValue(QString(
"CAMERA8")));
278 if ((dce ==
nullptr) || (dce->GetResult() < 0))
281 QString resultid = dce->
GetId();
282 QString data = dce->GetData().toString();
284 if (resultid ==
"mainmenu")
288 else if (data.startsWith(
"CAMERA"))
290 data = data.remove(
"CAMERA");
291 int monitor = data.toInt();
314 int oldMonID =
m_players->at(playerNo - 1)->getMonitor()->id;
321 if (oldMonID == omon->
id)
337 m_players->at(playerNo - 1)->setMonitor(mon);
338 m_players->at(playerNo - 1)->updateCamera();
345 static std::array<uint8_t,MAX_IMAGE_SIZE> s_buffer {};
352 if (!monList.contains(
p->getMonitor()->id))
353 monList.append(
p->getMonitor()->id);
356 for (
int x = 0; x < monList.count(); x++)
361 if (frameSize > 0 && !status.startsWith(
"ERROR"))
366 if (
p->getMonitor()->id == monList[x])
368 if (
p->getMonitor()->status != status)
370 p->getMonitor()->status = status;
373 p->updateFrame(s_buffer.data());
409 else if (layout == 2)
411 else if (layout == 3)
413 else if (layout == 4)
415 else if (layout == 5)
428 if (x <= monList.size())
430 const QString& s = monList.at(x - 1);
431 int monID = s.toInt();
446 p->setMonitor(monitor);
447 p->setWidgets(frameImage, statusText, cameraText);
void SetFontState(const QString &state)
bool Create(void) override
Image widget, displays a single image or multiple images in sequence.
MythUIImage * m_frameImage
int getMonitorCount(void)
void setMonitorLayout(int layout, bool restore=false)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
static void RestoreScreensaver()
void customEvent(QEvent *event) override
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
Monitor * getMonitorByID(int monID)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythPainter * GetPainter()
MythUIType * GetFocusWidget(void) const
void changePlayerMonitor(int playerNo)
static void DisableScreensaver()
MythUIText * m_statusText
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Basic menu dialog, message and a list of options.
ZMLivePlayer(MythScreenStack *parent, bool isMiniPlayer=false)
bool initMonitorLayout(int layout)
int DecrRef(void) override
Decrements reference count and deletes on 0.
MythUIText * m_cameraText
static ZMClient * get(void)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
int GetNumSetting(const QString &key, int defaultval=0)
The base class on which all widgets and screens are based.
void updateFrame(const uchar *buffer)
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void setWidgets(MythUIImage *image, MythUIText *status, MythUIText *camera)
void setMonitor(const Monitor *mon)
static constexpr std::chrono::milliseconds FRAME_UPDATE_TIME
std::vector< Player * > * m_players
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
void setIsMiniPlayerEnabled(bool enabled)
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
MythMainWindow * GetMythMainWindow(void)
void SetImage(MythImage *img)
Should not be used unless absolutely necessary since it bypasses the image caching and threaded loade...
MythScreenStack * GetStack(const QString &Stackname)
void customEvent(QEvent *event) override
int getLiveFrame(int monitorID, QString &status, FrameData &buffer)
void SaveSetting(const QString &key, int newValue)
void Assign(const QImage &img)
Monitor * getMonitorAt(int pos)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
QString GetSetting(const QString &key, const QString &defaultval="")
MythUIType * GetMythUIType(const QString &name, bool optional=false)