Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6321 in orxonox.OLD for branches/avi_play/src


Ignore:
Timestamp:
Dec 27, 2005, 5:05:17 PM (19 years ago)
Author:
stefalie
Message:

branches/avi_play: controls should know work for the movie_player

Location:
branches/avi_play/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/avi_play/src/lib/graphics/importer/movie_player.cc

    r6320 r6321  
    8282void MoviePlayer::start(unsigned int start_frame)
    8383{
    84   if(status == STOP)
    85     //that'd probably do its job if getFrame worked
    86     texture = media_container->getFrame(3);
     84  if(start_frame < 2)
     85    texture = media_container->getFrame(2);
     86  else
     87    texture = media_container->getFrame(start_frame);
    8788  status = PLAY;
    8889}
     
    9091void MoviePlayer::resume()
    9192{
    92   if(status != STOP)
    93     status = PLAY;
     93  if(status == STOP)
     94    texture = media_container->getFrame(2);
     95  status = PLAY;
    9496}
    9597
    9698void MoviePlayer::pause()
    9799{
    98   status = PAUSE;
     100  if(status != STOP)
     101    status = PAUSE;
    99102}
    100103
     
    102105{
    103106  status = STOP;
     107  texture = NULL;
    104108}
    105109
     
    107111{
    108112  if(status == PLAY)
     113  {
    109114    texture = media_container->getNextFrame();
     115    if(texture == NULL)
     116      status = STOP;
     117  }
    110118}
    111119
  • branches/avi_play/src/subprojects/importer/movie_player_test.cc

    r6318 r6321  
    3838      {
    3939        case SDLK_1:
     40          movie_player->start(0);
     41          PRINTF(0)("Start\n");
     42          break;
     43        case SDLK_2:
    4044          movie_player->resume();
    4145          PRINTF(0)("Play-/Resuming\n");
    4246          break;
    43         case SDLK_2:
     47        case SDLK_3:
    4448          movie_player->pause();
    4549          PRINTF(0)("Pause\n");
    4650          break;
    47         case SDLK_3:
     51        case SDLK_4:
    4852          movie_player->stop();
    4953          PRINTF(0)("Stopped\n");
     
    5660{
    5761  movie_player->tick(dt);
     62
     63  PRINTF(1)("Status %i\n", movie_player->getStatus());
    5864}
    5965
Note: See TracChangeset for help on using the changeset viewer.