本文整理汇总了C++中MythScreenType类的典型用法代码示例。如果您正苦于以下问题:C++ MythScreenType类的具体用法?C++ MythScreenType怎么用?C++ MythScreenType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MythScreenType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddScreen
void MythScreenStack::AddScreen(MythScreenType *screen, bool allowFade)
{
if (!screen)
return;
m_DoInit = false;
MythScreenType *old = m_topScreen;
if (old)
old->aboutToHide();
m_Children.push_back(screen);
if (allowFade && m_DoTransitions)
{
m_newTop = screen;
DoNewFadeTransition();
}
else
{
if (parent())
reinterpret_cast<MythMainWindow *>(parent())->update();
RecalculateDrawOrder();
if (!screen->IsInitialized())
m_DoInit = true;
}
screen->aboutToShow();
m_topScreen = screen;
emit topScreenChanged(m_topScreen);
}
示例2: GetTopScreen
void MythScreenStack::RecalculateDrawOrder(void)
{
m_DrawOrder.clear();
if (m_Children.isEmpty())
return;
QVector<MythScreenType *>::Iterator it;
for (it = m_Children.begin(); it != m_Children.end(); ++it)
{
MythScreenType *screen = (*it);
if (screen->IsFullscreen())
m_DrawOrder.clear();
m_DrawOrder.push_back(screen);
}
if (m_DrawOrder.isEmpty())
{
MythScreenType *screen = GetTopScreen();
if (screen)
m_DrawOrder.push_back(screen);
}
}
示例3: GetMythMainWindow
void EditStreamMetadata::searchClicked(void )
{
MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
MythScreenType *screen = new SearchStream(mainStack, this);
if (screen->Create())
mainStack->AddScreen(screen);
else
delete screen;
}
示例4: GetMythMainWindow
void BookmarkManager::slotBookmarkClicked(MythUIButtonListItem *item)
{
if (!item)
return;
Bookmark *site = qVariantValue<Bookmark*>(item->GetData());
if (!site)
return;
m_savedBookmark = *site;
QString cmd = gCoreContext->GetSetting("WebBrowserCommand", "Internal");
QString zoom = gCoreContext->GetSetting("WebBrowserZoomLevel", "1.0");
QStringList urls;
urls.append(site->url);
if (cmd.toLower() == "internal")
{
MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
MythScreenType *mythbrowser;
if (urls[0].startsWith("mythflash://"))
mythbrowser = new MythFlashPlayer(mainStack, urls);
else
mythbrowser = new MythBrowser(mainStack, urls);
if (mythbrowser->Create())
{
connect(mythbrowser, SIGNAL(Exiting()), SLOT(slotBrowserClosed()));
mainStack->AddScreen(mythbrowser);
}
else
delete mythbrowser;
}
else
{
cmd.replace("%ZOOM%", zoom);
cmd.replace("%URL%", urls.join(" "));
cmd.replace("&","\\&");
cmd.replace(";","\\;");
GetMythMainWindow()->AllowInput(false);
myth_system(cmd, kMSDontDisableDrawing);
GetMythMainWindow()->AllowInput(true);
// we need to reload the bookmarks incase the user added/deleted
// any while in MythBrowser
ReloadBookmarks();
}
}
示例5: GetWindow
void OSD::SetGraph(const QString &window, const QString &graph, int64_t timecode)
{
MythScreenType *win = GetWindow(window);
if (!win)
return;
MythUIImage *image = dynamic_cast<MythUIImage* >(win->GetChild(graph));
if (!image)
return;
MythImage* mi = m_parent->GetAudioGraph().GetImage(timecode);
if (mi)
image->SetImage(mi);
}
示例6: updateTrackInfo
//.........这里部分代码省略.........
else if (tokens[1] == "FINISHED")
{
QString url = args[0];
int fileSize = args[2].toInt();
int errorCode = args[4].toInt();
QString filename = args[1];
if ((errorCode != 0) || (fileSize == 0))
LOG(VB_GENERAL, LOG_ERR, QString("StreamView: failed to download radio icon from '%1'").arg(url));
else
{
for (int x = 0; x < m_streamList->GetCount(); x++)
{
MythUIButtonListItem *item = m_streamList->GetItemAt(x);
Metadata *mdata = qVariantValue<Metadata*> (item->GetData());
if (mdata && mdata->LogoUrl() == url)
item->SetImage(filename);
}
}
}
}
}
else if (event->type() == DecoderHandlerEvent::OperationStart)
{
DecoderHandlerEvent *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
if (!dhe)
return;
if (dhe->getMessage() && m_bufferStatus)
{
m_bufferStatus->SetText(*dhe->getMessage());
}
}
else if (event->type() == DecoderHandlerEvent::BufferStatus)
{
DecoderHandlerEvent *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
if (!dhe)
return;
int available, maxSize;
dhe->getBufferStatus(&available, &maxSize);
if (m_bufferStatus)
{
QString status = QString("%1%").arg((int)(100.0 / ((double)maxSize / (double)available)));
m_bufferStatus->SetText(status);
}
if (m_bufferProgress)
{
m_bufferProgress->SetTotal(maxSize);
m_bufferProgress->SetUsed(available);
}
}
else if (event->type() == DecoderHandlerEvent::OperationStop)
{
if (m_bufferStatus)
m_bufferStatus->SetText("");
}
else if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = static_cast<DialogCompletionEvent*>(event);
// make sure the user didn't ESCAPE out of the menu
if (dce->GetResult() < 0)
return;
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
if (resultid == "streammenu")
{
if (resulttext == tr("Add Stream"))
{
MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
MythScreenType *screen = new EditStreamMetadata(mainStack, this, NULL);
if (screen->Create())
mainStack->AddScreen(screen);
else
delete screen;
}
else if (resulttext == tr("Remove Stream"))
{
removeStream();
}
else if (resulttext == tr("Edit Stream"))
{
editStream();
}
}
else
handled = false;
}
else
handled = false;
if (!handled)
MusicCommon::customEvent(event);
}
示例7: GetMythMainWindow
void MythScreenStack::PopScreen(MythScreenType *screen, bool allowFade,
bool deleteScreen)
{
if (!screen || screen->IsDeleting())
return;
screen->aboutToHide();
if (m_Children.isEmpty())
return;
MythMainWindow *mainwindow = GetMythMainWindow();
screen->setParent(0);
if ((screen == m_topScreen) && allowFade && m_DoTransitions
&& !mainwindow->IsExitingToMain())
{
screen->SetFullscreen(false);
if (deleteScreen)
{
screen->SetDeleting(true);
m_ToDelete.push_back(screen);
}
screen->AdjustAlpha(1, -kFadeVal);
}
else
{
for (int i = 0; i < m_Children.size(); ++i)
{
if (m_Children.at(i) == screen)
m_Children.remove(i);
}
if (deleteScreen)
delete screen;
screen = NULL;
mainwindow->update();
if (mainwindow->IsExitingToMain())
{
QCoreApplication::postEvent(
mainwindow, new QEvent(MythEvent::kExitToMainMenuEventType));
}
}
m_topScreen = NULL;
RecalculateDrawOrder();
// If we're fading it, we still want to draw it.
if (screen)
m_DrawOrder.push_back(screen);
if (!m_Children.isEmpty())
{
QVector<MythScreenType *>::Iterator it;
for (it = m_DrawOrder.begin(); it != m_DrawOrder.end(); ++it)
{
if (*it != screen && !(*it)->IsDeleting())
{
m_topScreen = (*it);
(*it)->SetAlpha(255);
(*it)->aboutToShow();
}
}
}
if (m_topScreen)
{
m_topScreen->SetRedraw();
if (!allowFade || !m_DoTransitions)
emit topScreenChanged(m_topScreen);
}
else
{
// Screen still needs to be redrawn if we have popped the last screen
// off the popup stack, or similar
MythScreenType *mainscreen = mainwindow->GetMainStack()->GetTopScreen();
if (mainscreen)
mainscreen->SetRedraw();
if (!allowFade || !m_DoTransitions)
emit topScreenChanged(NULL);
}
}
示例8: GetMythMainWindow
void MythNotificationScreenStack::PopScreen(MythScreenType *screen, bool allowFade,
bool deleteScreen)
{
if (!screen || screen->IsDeleting())
return;
bool poppedFullscreen = screen->IsFullscreen();
screen->aboutToHide();
if (m_Children.isEmpty())
return;
MythMainWindow *mainwindow = GetMythMainWindow();
screen->setParent(0);
if (allowFade && m_DoTransitions && !mainwindow->IsExitingToMain())
{
screen->SetFullscreen(false);
if (deleteScreen)
{
screen->SetDeleting(true);
m_ToDelete.push_back(screen);
}
screen->AdjustAlpha(1, -kFadeVal);
}
else
{
for (int i = 0; i < m_Children.size(); ++i)
{
if (m_Children.at(i) == screen)
{
m_Children.remove(i);
break;
}
}
if (deleteScreen)
screen->deleteLater();
screen = NULL;
}
m_topScreen = NULL;
RecalculateDrawOrder();
// If we're fading it, we still want to draw it.
if (screen && !m_DrawOrder.contains(screen))
m_DrawOrder.push_back(screen);
if (!m_Children.isEmpty())
{
QVector<MythScreenType *>::Iterator it;
for (it = m_DrawOrder.begin(); it != m_DrawOrder.end(); ++it)
{
if (*it != screen && !(*it)->IsDeleting())
{
m_topScreen = (*it);
(*it)->SetAlpha(255);
if (poppedFullscreen)
(*it)->aboutToShow();
}
}
}
if (m_topScreen)
{
m_topScreen->SetRedraw();
}
else
{
// Screen still needs to be redrawn if we have popped the last screen
// off the popup stack, or similar
if (mainwindow->GetMainStack())
{
MythScreenType *mainscreen = mainwindow->GetMainStack()->GetTopScreen();
if (mainscreen)
mainscreen->SetRedraw();
}
}
}
示例9: DialogQuit
void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
{
if (m_Dialog)
{
QString current = m_Dialog->objectName();
if (current != window)
{
DialogQuit();
}
else
{
MythDialogBox *dialog = dynamic_cast<MythDialogBox*>(m_Dialog);
if (dialog)
dialog->Reset();
DialogSetText(text);
}
}
if (!m_Dialog)
{
OverrideUIScale();
MythScreenType *dialog;
if (window == OSD_DLG_EDITOR)
dialog = new ChannelEditor(m_ParentObject, window.toLatin1());
else if (window == OSD_DLG_CONFIRM)
dialog = new MythConfirmationDialog(NULL, text, false);
else
dialog = new MythDialogBox(text, NULL, window.toLatin1(), false, true);
dialog->SetPainter(m_CurrentPainter);
if (dialog->Create())
{
PositionWindow(dialog);
m_Dialog = dialog;
MythDialogBox *dbox = dynamic_cast<MythDialogBox*>(m_Dialog);
if (dbox)
dbox->SetReturnEvent(m_ParentObject, window);
MythConfirmationDialog *cbox = dynamic_cast<MythConfirmationDialog*>(m_Dialog);
if (cbox)
{
cbox->SetReturnEvent(m_ParentObject, window);
cbox->SetData("DIALOG_CONFIRM_X_X");
}
m_Children.insert(window, m_Dialog);
}
else
{
RevertUIScale();
delete dialog;
return;
}
RevertUIScale();
}
if (updatefor)
{
m_NextPulseUpdate = MythDate::current();
m_PulsedDialogText = text;
SetExpiry(window, kOSDTimeout_None, updatefor);
}
DialogBack();
HideAll(true, m_Dialog);
m_Dialog->SetVisible(true);
}
示例10: GetMythMainWindow
void ProgLister::ShowChooseViewMenu(void)
{
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythScreenType *screen = NULL;
bool connect_string = true;
switch (m_type)
{
case plChannel:
case plCategory:
case plMovies:
case plNewListings:
case plStoredSearch:
{
if (m_viewList.empty())
return;
QString msg;
switch (m_type)
{
case plMovies: msg = tr("Select Rating"); break;
case plChannel: msg = tr("Select Channel"); break;
case plCategory: msg = tr("Select Category"); break;
case plNewListings: msg = tr("Select List"); break;
case plStoredSearch: msg = QString("%1\n%2")
.arg(tr("Select a search stored from"))
.arg(tr("Custom Record")); break;
}
screen = new MythUISearchDialog(
popupStack, msg, m_viewTextList, true, "");
break;
}
case plTitleSearch:
case plKeywordSearch:
case plPeopleSearch:
screen = new PhrasePopup(
popupStack, this, m_searchType, m_viewTextList,
(m_curView >= 0) ? m_viewList[m_curView] : QString());
break;
case plPowerSearch:
screen = new PowerSearchPopup(
popupStack, this, m_searchType, m_viewTextList,
(m_curView >= 0) ? m_viewList[m_curView] : QString());
break;
case plTime:
screen = new TimePopup(popupStack, this);
connect_string = false;
break;
}
if (!screen)
return;
if (!screen->Create())
{
delete screen;
return;
}
if (connect_string)
{
connect(screen, SIGNAL(haveResult( QString)),
this, SLOT( SetViewFromList(QString)));
}
else
{
connect(screen, SIGNAL(haveResult( QDateTime)),
this, SLOT( SetViewFromTime(QDateTime)));
}
popupStack->AddScreen(screen);
}