Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/subprojects/importer/movie_player_test.cc @ 6532

Last change on this file since 6532 was 6532, checked in by bensch, 18 years ago

orxonox/trunk: merged branches/movie_play to the trunk. no conflicts, but a minor virtual function BUG

File size: 1.8 KB
RevLine 
[6286]1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: David Hasenfratz
13   co-programmer: ...
14
15   this file extends the framework file, so it renders what i want.
16*/
17
18#include <stdlib.h>
19
[6290]20#include "framework.h"
21#include "movie_player.h"
[6286]22
[6353]23MoviePlayer* movie_player;
[6286]24
25void Framework::moduleInit(int argc, char** argv)
26{
[6382]27  if( argc <= 1)
28  {
29    printf("Wrong arguments try following notations:\n");
30    printf("./movie_player_test [media_file]\n");
31    exit(0);
32  }
33
[6353]34  movie_player = new MoviePlayer(argv[1]);
[6401]35
36 
[6353]37  movie_player->printInformation();
[6286]38}
39
40void Framework::moduleEventHandler(SDL_Event* event)
41{
[6353]42  switch (event->type)
[6318]43  {
44    case SDL_KEYDOWN:
45      switch (event->key.keysym.sym)
46      {
47        case SDLK_1:
[6401]48          movie_player->start(0);
[6321]49          break;
50        case SDLK_2:
[6318]51          movie_player->resume();
52          break;
[6321]53        case SDLK_3:
[6318]54          movie_player->pause();
55          break;
[6321]56        case SDLK_4:
[6318]57          movie_player->stop();
58          break;
[6325]59        case SDLK_9:
[6401]60          movie_player->setFPS(movie_player->getFPS() - 1);
61          PRINTF(0)("fps: %0.2f\n", movie_player->getFPS());
[6325]62          break;
63        case SDLK_0:
[6401]64          movie_player->setFPS(movie_player->getFPS() + 1);
65          PRINTF(0)("fps: %0.2f\n", movie_player->getFPS());
[6325]66          break;
[6318]67      }
[6353]68  }
[6286]69}
70
71void Framework::moduleTick(float dt)
[6318]72{
[6353]73  movie_player->tick(dt);
[6286]74}
75
76void Framework::moduleDraw(void) const
77{
[6353]78  movie_player->draw();
[6286]79}
80
81
82void Framework::moduleHelp(void) const
83{
84
85}
Note: See TracBrowser for help on using the repository browser.