/[projects]/infoscreen/mainview.cpp
ViewVC logotype

Diff of /infoscreen/mainview.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 511 by torben, Mon Dec 14 13:38:55 2009 UTC revision 515 by torben, Tue Dec 15 20:36:26 2009 UTC
# Line 1  Line 1 
1  #include "MainView.h"  #include "MainView.h"
2    #include <QApplication>
3  #include <QPushButton>  #include <QPushButton>
4    #include <QLabel>
5  #include <QVBoxLayout>  #include <QVBoxLayout>
6    
7  #include <QTimer>  #include <QTimer>
8    
9  #include <VideoPlayer> //Phonon  //#include <VideoPlayer> //Phonon
10  #include <MediaObject> //Phonon  //#include <MediaSource> //Phonon
11  #include <MediaSource> //Phonon  
12    #include "MyWebView.h"
13    #include "clientsiderender.h"
14    
 #include <iostream>  
 using namespace std;  
15    
 Phonon::VideoPlayer* video = 0;  
16  MainView::MainView(QWidget* parent)  MainView::MainView(QWidget* parent)
17   : QWidget(parent)   : QWidget(parent)
18  {  {
19          this->resize(400,400);          this->setWindowState( Qt::WindowFullScreen );
20          //this->setWindowState( Qt::WindowFullScreen );  //      qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
   
   
 /*      red = new QWidget(this);  
         red->setStyleSheet("QWidget { background-color: red; }");  
21    
         green = new QWidget(this);  
         green->setStyleSheet("QWidget { background-color: green; }");  
         green->setVisible(false);  
   
         current = red;*/  
           
         video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);  
         Phonon::MediaSource* source = new Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi");  
           
         video->load( *source );  
22                    
23            //Phonon::VideoPlayer* video;
24            //video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);
25            //video->load( Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi") );
26            //layout->addWidget(video,1);
27            //video->play();
28    
29            render = new ClientSideRender(this);
30            web = new MyWebView(this);
31            web->setVisible( false );
32    
33          QVBoxLayout* layout = new QVBoxLayout();          QVBoxLayout* layout = new QVBoxLayout();
34          //layout->addWidget(red,1 );          layout->addWidget(web,1);
35          //layout->addWidget(green,1);          layout->addWidget(render,1);
         layout->addWidget(video,1);  
36          layout->addStretch();          layout->addStretch();
37          layout->setContentsMargins(0,0,0,0);          layout->setContentsMargins(0,0,0,0);
38          setLayout(layout);          setLayout(layout);
   
           
   
39    
40          QTimer* timer = new QTimer(this);          QTimer* timer = new QTimer(this);
41          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
42          timer->start(1000);          timer->start(1000);
43            
44            
45            web->start();
46  }  }
47    
48    
49  void MainView::onTimer()  void MainView::onTimer()
50  {  {
51          cout << "timer" << endl;      screenManager.timerTick();
         if (!video->isPlaying() ) {  
                 video->play();  
                 cout << "starting" << endl;  
         }  
                   
         /*  
         if( current == red) {  
                 red->setVisible(false);  
                 green->setVisible(true);  
                 current = green;  
         } else {  
                 red->setVisible(true);  
                 green->setVisible(false);  
                 current = red;  
         }*/  
52  }  }

Legend:
Removed from v.511  
changed lines
  Added in v.515

  ViewVC Help
Powered by ViewVC 1.1.20