Advertisement
Guest User

Untitled

a guest
May 24th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <Wt/WApplication>
  2. #include <Wt/WEnvironment>
  3.  
  4. #include <Wt/WMediaPlayer>
  5. #include <Wt/WJavaScript>
  6.  
  7. using namespace Wt;
  8.  
  9. class RadioApplication : public WApplication
  10. {
  11. public:
  12. RadioApplication(const WEnvironment& env);
  13. private:
  14. WMediaPlayer *player;
  15.  
  16. JSlot* catchUpdated;
  17. };
  18.  
  19. RadioApplication::RadioApplication(const WEnvironment& env)
  20. : WApplication(env)
  21. {
  22. setTitle("AnekiChan Radio");
  23.  
  24. player = new WMediaPlayer(WMediaPlayer::Audio,root());
  25. player->addSource(WMediaPlayer::OGA, "http://anekichan.org:9999/radio.ogg");
  26. player->play();
  27.  
  28. catchUpdated = new JSlot("function() { }",root());
  29.  
  30. player->timeUpdated().connect(*catchUpdated);
  31. }
  32.  
  33. WApplication *createApplication(const WEnvironment& env)
  34. {
  35. return new RadioApplication(env);
  36. }
  37.  
  38. int main(int argc, char **argv)
  39. {
  40. return WRun(argc, argv, &createApplication);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement