/[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 527 by torben, Tue Jan 5 20:14:22 2010 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 "MyWebView.h"
10  #include <MediaObject> //Phonon  #include "clientsiderender.h"
11  #include <MediaSource> //Phonon  #include "pictureview.h"
12    #include "videoview.h"
13    
 #include <iostream>  
 using namespace std;  
   
 Phonon::VideoPlayer* video = 0;  
14  MainView::MainView(QWidget* parent)  MainView::MainView(QWidget* parent)
15   : QWidget(parent)   : QWidget(parent)
16  {  {
17          this->resize(400,400);          this->resize(400,400);
18          //this->setWindowState( Qt::WindowFullScreen );          this->setWindowState( Qt::WindowFullScreen );
19    
20            qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
21    
22            render = new ClientSideRender(this);
23            render->setVisible( false );
24    
25  /*      red = new QWidget(this);          web = new MyWebView(this);
26          red->setStyleSheet("QWidget { background-color: red; }");          web->setVisible( false);
27    
28          green = new QWidget(this);          picture = new PictureView(this);
29          green->setStyleSheet("QWidget { background-color: green; }");          picture->setVisible( true );
         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 );  
           
30    
31            video = new VideoView(this);
32            video->setVisible(false);
33    
34          QVBoxLayout* layout = new QVBoxLayout();          QVBoxLayout* layout = new QVBoxLayout();
35          //layout->addWidget(red,1 );          layout->addWidget(web,1);
36          //layout->addWidget(green,1);          layout->addWidget(render,1);
37          layout->addWidget(video,1);          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();
48  }  }
49    
50    
51  void MainView::onTimer()  void MainView::onTimer()
52  {  {
53          cout << "timer" << endl;      static int count = 0;
54          if (!video->isPlaying() ) {      screenManager.timerTick();
55                  video->play();  
56                  cout << "starting" << endl;      //if (count == 0)
57          }      //    video->loadUrl("");
58                    
59          /*  
60          if( current == red) {      if ( (count%10) == 0) {
61                  red->setVisible(false);  
62                  green->setVisible(true);          int t = count / 10;
63                  current = green;  
64          } else {          if ( (t%2) == 0) {
65                  red->setVisible(true);              picture->loadFromUrl("http://87.104.25.138/infoscreens/data/images/image1.jpg");
66                  green->setVisible(false);          } else {
67                  current = red;              picture->loadFromUrl("http://87.104.25.138/infoscreens/data/images/image2.jpg");
68          }*/          }
69        }
70        count++;
71  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.20