/[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 516 by torben, Tue Dec 15 21:06:14 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->resize(400,400);
20          //this->setWindowState( Qt::WindowFullScreen );          this->setWindowState( Qt::WindowFullScreen );
   
   
 /*      red = new QWidget(this);  
         red->setStyleSheet("QWidget { background-color: red; }");  
21    
22          green = new QWidget(this);  //      qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
         green->setStyleSheet("QWidget { background-color: green; }");  
         green->setVisible(false);  
23    
         current = red;*/  
24                    
25          video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);          //Phonon::VideoPlayer* video;
26          Phonon::MediaSource* source = new Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi");          //video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);
27                    //video->load( Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi") );
28          video->load( *source );          //layout->addWidget(video,1);
29                    //video->play();
30    
31            render = new ClientSideRender(this);
32            web = new MyWebView(this);
33            web->setVisible( false );
34    
35          QVBoxLayout* layout = new QVBoxLayout();          QVBoxLayout* layout = new QVBoxLayout();
36          //layout->addWidget(red,1 );          layout->addWidget(web,1);
37          //layout->addWidget(green,1);          layout->addWidget(render,1);
         layout->addWidget(video,1);  
38          layout->addStretch();          layout->addStretch();
39          layout->setContentsMargins(0,0,0,0);          layout->setContentsMargins(0,0,0,0);
40          setLayout(layout);          setLayout(layout);
   
           
   
41    
42          QTimer* timer = new QTimer(this);          QTimer* timer = new QTimer(this);
43          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
44          timer->start(1000);          timer->start(1000);
45            
46            
47          // web->start();
48  }  }
49    
50    
51  void MainView::onTimer()  void MainView::onTimer()
52  {  {
53          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;  
         }*/  
54  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.20