36 m_frameTimer(new QTimer(this)),
37 m_isMiniPlayer(isMiniPlayer)
55 LOG(VB_GENERAL, LOG_ERR, QString(
"Cannot load screen '%1'").arg(winName));
81 if (!optional && !
type)
99 for (
int x = 1; x < 3; x++)
107 for (
int x = 1; x < 5; x++)
115 for (
int x = 1; x < 7; x++)
123 for (
int x = 1; x < 9; x++)
131 catch (
const QString &name)
133 LOG(VB_GENERAL, LOG_ERR,
134 QString(
"Theme is missing a critical theme element ('%1')")
147 LOG(VB_GENERAL, LOG_ERR,
"Cannot find any monitors. Bailing out!");
149 tr(
"You don't have any monitors defined!"));
173 s += QString(
"%1").arg(
p->getMonitor()->id);
198 for (
int i = 0; i < actions.size() && !handled; i++)
200 const QString&
action = actions[i];
226 else if (
action ==
"MENU")
246 auto *menuPopup =
new MythDialogBox(
"Menu", popupStack,
"mainmenu");
248 if (menuPopup->Create())
251 menuPopup->SetReturnEvent(
this,
"mainmenu");
253 menuPopup->AddButtonV(tr(
"Change View"), QVariant::fromValue(QString(
"VIEW")));
254 menuPopup->AddButtonV(tr(
"Change Camera 1"), QVariant::fromValue(QString(
"CAMERA1")));
257 menuPopup->AddButtonV(tr(
"Change Camera 2"), QVariant::fromValue(QString(
"CAMERA2")));
261 menuPopup->AddButtonV(tr(
"Change Camera 3"), QVariant::fromValue(QString(
"CAMERA3")));
262 menuPopup->AddButtonV(tr(
"Change Camera 4"), QVariant::fromValue(QString(
"CAMERA4")));
267 menuPopup->AddButtonV(tr(
"Change Camera 5"), QVariant::fromValue(QString(
"CAMERA5")));
268 menuPopup->AddButtonV(tr(
"Change Camera 6"), QVariant::fromValue(QString(
"CAMERA6")));
273 menuPopup->AddButtonV(tr(
"Change Camera 7"), QVariant::fromValue(QString(
"CAMERA7")));
274 menuPopup->AddButtonV(tr(
"Change Camera 8"), QVariant::fromValue(QString(
"CAMERA8")));
285 if ((dce ==
nullptr) || (dce->GetResult() < 0))
288 QString resultid = dce->
GetId();
289 QString data = dce->GetData().toString();
291 if (resultid ==
"mainmenu")
295 else if (data.startsWith(
"CAMERA"))
297 data = data.remove(
"CAMERA");
298 int monitor = data.toInt();
321 int oldMonID =
m_players->at(playerNo - 1)->getMonitor()->id;
328 if (oldMonID == omon->
id)
344 m_players->at(playerNo - 1)->setMonitor(mon);
345 m_players->at(playerNo - 1)->updateCamera();
352 static std::array<uint8_t,MAX_IMAGE_SIZE> s_buffer {};
359 if (!monList.contains(
p->getMonitor()->id))
360 monList.append(
p->getMonitor()->id);
363 for (
int x = 0; x < monList.count(); x++)
368 if (frameSize > 0 && !status.startsWith(
"ERROR"))
373 if (
p->getMonitor()->id == monList[x])
375 if (
p->getMonitor()->status != status)
377 p->getMonitor()->status = status;
380 p->updateFrame(s_buffer.data());
416 else if (layout == 2)
418 else if (layout == 3)
420 else if (layout == 4)
422 else if (layout == 5)
435 if (x <= monList.size())
437 const QString& s = monList.at(x - 1);
438 int monID = s.toInt();
453 p->setMonitor(monitor);
454 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