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);
197 for (
int i = 0; i < actions.size() && !handled; i++)
199 const QString&
action = actions[i];
225 else if (
action ==
"MENU")
245 auto *menuPopup =
new MythDialogBox(
"Menu", popupStack,
"mainmenu");
247 if (menuPopup->Create())
250 menuPopup->SetReturnEvent(
this,
"mainmenu");
252 menuPopup->AddButtonV(tr(
"Change View"), QVariant::fromValue(QString(
"VIEW")));
253 menuPopup->AddButtonV(tr(
"Change Camera 1"), QVariant::fromValue(QString(
"CAMERA1")));
256 menuPopup->AddButtonV(tr(
"Change Camera 2"), QVariant::fromValue(QString(
"CAMERA2")));
260 menuPopup->AddButtonV(tr(
"Change Camera 3"), QVariant::fromValue(QString(
"CAMERA3")));
261 menuPopup->AddButtonV(tr(
"Change Camera 4"), QVariant::fromValue(QString(
"CAMERA4")));
266 menuPopup->AddButtonV(tr(
"Change Camera 5"), QVariant::fromValue(QString(
"CAMERA5")));
267 menuPopup->AddButtonV(tr(
"Change Camera 6"), QVariant::fromValue(QString(
"CAMERA6")));
272 menuPopup->AddButtonV(tr(
"Change Camera 7"), QVariant::fromValue(QString(
"CAMERA7")));
273 menuPopup->AddButtonV(tr(
"Change Camera 8"), QVariant::fromValue(QString(
"CAMERA8")));
284 if ((dce ==
nullptr) || (dce->GetResult() < 0))
287 QString resultid = dce->
GetId();
288 QString data = dce->GetData().toString();
290 if (resultid ==
"mainmenu")
294 else if (data.startsWith(
"CAMERA"))
296 data = data.remove(
"CAMERA");
297 int monitor = data.toInt();
320 int oldMonID =
m_players->at(playerNo - 1)->getMonitor()->id;
327 if (oldMonID == omon->
id)
343 m_players->at(playerNo - 1)->setMonitor(mon);
344 m_players->at(playerNo - 1)->updateCamera();
351 static std::array<uint8_t,MAX_IMAGE_SIZE> s_buffer {};
358 if (!monList.contains(
p->getMonitor()->id))
359 monList.append(
p->getMonitor()->id);
362 for (
int x = 0; x < monList.count(); x++)
367 if (frameSize > 0 && !status.startsWith(
"ERROR"))
372 if (
p->getMonitor()->id == monList[x])
374 if (
p->getMonitor()->status != status)
376 p->getMonitor()->status = status;
379 p->updateFrame(s_buffer.data());
415 else if (layout == 2)
417 else if (layout == 3)
419 else if (layout == 4)
421 else if (layout == 5)
434 if (x <= monList.size())
436 const QString& s = monList.at(x - 1);
437 int monID = s.toInt();
452 p->setMonitor(monitor);
453 p->setWidgets(frameImage, statusText, cameraText);
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
void SaveSetting(const QString &key, int newValue)
QString GetSetting(const QString &key, const QString &defaultval="")
int GetNumSetting(const QString &key, int defaultval=0)
Basic menu dialog, message and a list of options.
void Assign(const QImage &img)
int DecrRef(void) override
Decrements reference count and deletes on 0.
static void DisableScreensaver()
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
MythPainter * GetPainter()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
static void RestoreScreensaver()
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Image widget, displays a single image or multiple images in sequence.
void SetImage(MythImage *img)
Should not be used unless absolutely necessary since it bypasses the image caching and threaded loade...
All purpose text widget, displays a text string.
void SetFontState(const QString &state)
virtual void SetText(const QString &text)
The base class on which all widgets and screens are based.
void customEvent(QEvent *event) override
virtual void SetVisible(bool visible)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
MythUIImage * m_frameImage
MythUIText * m_statusText
void updateFrame(const uchar *buffer)
void setWidgets(MythUIImage *image, MythUIText *status, MythUIText *camera)
MythUIText * m_cameraText
void setMonitor(const Monitor *mon)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
int getMonitorCount(void)
Monitor * getMonitorByID(int monID)
Monitor * getMonitorAt(int pos)
static ZMClient * get(void)
void setIsMiniPlayerEnabled(bool enabled)
int getLiveFrame(int monitorID, QString &status, FrameData &buffer)
MythUIType * GetMythUIType(const QString &name, bool optional=false)
bool initMonitorLayout(int layout)
ZMLivePlayer(MythScreenStack *parent, bool isMiniPlayer=false)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool Create(void) override
std::vector< Player * > * m_players
void setMonitorLayout(int layout, bool restore=false)
void changePlayerMonitor(int playerNo)
void customEvent(QEvent *event) override
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
static constexpr std::chrono::milliseconds FRAME_UPDATE_TIME