00001 // Qt 00002 #include <QTimer> 00003 00004 // MythTV 00005 #include "mythmainwindow.h" 00006 #include "mythlogging.h" 00007 #include "mythuiprogressbar.h" 00008 00009 #include "tv_play_win.h" 00010 00011 00012 TvPlayWindow::TvPlayWindow(MythScreenStack *parent, const char *name) 00013 : MythScreenType(parent, name), m_progressBar(NULL), m_progress(0) 00014 { 00015 SetCanTakeFocus(true); 00016 } 00017 00018 TvPlayWindow::~TvPlayWindow() 00019 { 00020 } 00021 00022 bool TvPlayWindow::Create() 00023 { 00024 bool foundtheme = false; 00025 00026 // Load the theme for this screen 00027 foundtheme = CopyWindowFromBase("videowindow", this); 00028 00029 if (!foundtheme) 00030 { 00031 LOG(VB_GENERAL, LOG_ERR, 00032 "Cannot load screen videowindow from base.xml"); 00033 return false; 00034 } 00035 00036 m_progressBar = dynamic_cast<MythUIProgressBar*>(GetChild("progress")); 00037 if (m_progressBar) 00038 { 00039 m_progressBar->SetVisible(false); 00040 m_progressBar->SetStart(0); 00041 m_progressBar->SetTotal(100); 00042 m_progressBar->SetUsed(m_progress); 00043 } 00044 00045 return true; 00046 } 00047 00048 void TvPlayWindow::UpdateProgress(void) 00049 { 00050 if (!m_progressBar) 00051 return; 00052 m_progress++; 00053 if (m_progress > 100) 00054 m_progress = 0; 00055 m_progressBar->SetUsed(m_progress); 00056 m_progressBar->SetVisible(true); 00057 } 00058 00065 void TvPlayWindow::gestureEvent(MythUIType *uitype, MythGestureEvent *event) 00066 { 00067 if (event->gesture() == MythGestureEvent::Click) 00068 { 00069 00070 } 00071 }
1.6.3