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

Diff of /infoscreen/mainview.cpp

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

revision 512 by torben, Tue Dec 15 13:53:02 2009 UTC revision 527 by torben, Tue Jan 5 20:14:22 2010 UTC
# Line 6  Line 6 
6    
7  #include <QTimer>  #include <QTimer>
8    
 #include <VideoPlayer> //Phonon  
 #include <MediaSource> //Phonon  
   
9  #include "MyWebView.h"  #include "MyWebView.h"
10    #include "clientsiderender.h"
11    #include "pictureview.h"
12    #include "videoview.h"
13    
14  MainView::MainView(QWidget* parent)  MainView::MainView(QWidget* parent)
15   : QWidget(parent)   : QWidget(parent)
16  {  {
17            this->resize(400,400);
18          this->setWindowState( Qt::WindowFullScreen );          this->setWindowState( Qt::WindowFullScreen );
19    
20          qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );          qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
21    
22                    render = new ClientSideRender(this);
23          //Phonon::VideoPlayer* video;          render->setVisible( false );
         //video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);  
         //video->load( Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi") );  
         //layout->addWidget(video,1);  
         //video->play();  
24    
25          web = new MyWebView(this);          web = new MyWebView(this);
26            web->setVisible( false);
27    
28            picture = new PictureView(this);
29            picture->setVisible( true );
30    
31            video = new VideoView(this);
32            video->setVisible(false);
33    
34          QVBoxLayout* layout = new QVBoxLayout();          QVBoxLayout* layout = new QVBoxLayout();
35          layout->addWidget(web,1);          layout->addWidget(web,1);
36                    layout->addWidget(render,1);
37            layout->addWidget(picture,1);
38            layout->addWidget(video,1);
39          layout->addStretch();          layout->addStretch();
40          layout->setContentsMargins(0,0,0,0);          layout->setContentsMargins(0,0,0,0);
41          setLayout(layout);          setLayout(layout);
42    
43          QTimer* timer = new QTimer(this);          QTimer* timer = new QTimer(this);
44          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
45          timer->start(1000);          timer->start(1000);
46            
47                    web->start();
         web->start();  
48  }  }
49    
50    
51  void MainView::onTimer()  void MainView::onTimer()
52  {  {
53        static int count = 0;
54      screenManager.timerTick();      screenManager.timerTick();
55    
56        //if (count == 0)
57        //    video->loadUrl("");
58    
59    
60        if ( (count%10) == 0) {
61    
62            int t = count / 10;
63    
64            if ( (t%2) == 0) {
65                picture->loadFromUrl("http://87.104.25.138/infoscreens/data/images/image1.jpg");
66            } else {
67                picture->loadFromUrl("http://87.104.25.138/infoscreens/data/images/image2.jpg");
68            }
69        }
70        count++;
71  }  }

Legend:
Removed from v.512  
changed lines
  Added in v.527

  ViewVC Help
Powered by ViewVC 1.1.20