コード例 #1
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::Seek(int position)
{
  int was_playing = 0;

  /* Cannot seek past end of file */
  if((Uint32)position > system->TotalSize()) return;
  
	/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */
  /* get info whrether we need to restart playing at the end */
  if( GetStatus() == MPEG_PLAYING )
    was_playing = 1;

  if(!seekIntoStream(position)) return;

  /* If we were playing and not rewind then play again */
  if (was_playing)
    Play();

  if (VideoEnabled() && !was_playing) 
    videoaction->RenderFrame(0);

  if ( pause && VideoEnabled() ) {
    videoaction->Pause();
  }
  if ( pause && AudioEnabled() ) {
    audioaction->Pause();
  }
}
コード例 #2
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */
MPEGstatus MPEG::GetStatus(void) {
  MPEGstatus status;

  status = MPEG_STOPPED;
  if ( VideoEnabled() ) {
		/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */
    switch (videoaction->GetStatus()) {
      case MPEG_PLAYING:
        status = MPEG_PLAYING;
      break;
      default:
      break;
    }
  }
  if ( AudioEnabled() ) {
		/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */
    switch (audioaction->GetStatus()) {
      case MPEG_PLAYING:
        status = MPEG_PLAYING;
      break;
      default:
      break;
    }
  }

  if(status == MPEG_STOPPED && loop && !pause)
  {
    /* Here we go again */
    Rewind();
    Play();

    if ( VideoEnabled() ) {
		/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */
      switch (videoaction->GetStatus()) {
      case MPEG_PLAYING:
        status = MPEG_PLAYING;
	break;
        default:
        break;
      }
    }
    if ( AudioEnabled() ) {
		/* Michel Darricau from eProcess <*****@*****.**> conflict name with popcorn */
      switch (audioaction->GetStatus()) {
      case MPEG_PLAYING:
        status = MPEG_PLAYING;
	break;
        default:
        break;
      }
    }
  }

  return(status);
}
コード例 #3
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
SMPEG_Filter * MPEG::Filter(SMPEG_Filter * filter)
{
  if ( VideoEnabled() ) {
    return(videoaction->Filter(filter));
  }
  return 0;
}
コード例 #4
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
bool MPEG::SetDisplay(SDL_Surface *dst, SDL_mutex *lock,
		MPEG_DisplayCallback callback) {
  if ( VideoEnabled() ) {
    return(videoaction->SetDisplay(dst, lock, callback));
  }
  return(false);
}
コード例 #5
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::RenderFinal(SDL_Surface *dst, int x, int y)
{
    Stop();
    if ( VideoEnabled() ) {
        videoaction->RenderFinal(dst, x, y);
    }
    Rewind();
}
コード例 #6
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::Stop(void) {
  if ( VideoEnabled() ) {
    videoaction->Stop();
  }
  if ( AudioEnabled() ) {
    audioaction->Stop();
  }
}
コード例 #7
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::Play(void) {
  if ( AudioEnabled() ) {
    audioaction->Play();
  }
  if ( VideoEnabled() ) {
    videoaction->Play();
  }
}
コード例 #8
0
void MPEG::RenderFinal()
{
    Stop();
    if ( VideoEnabled() ) {
        videoaction->RenderFinal();
    }
    Rewind();
}
コード例 #9
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::Pause(void) {
  pause = !pause;

  if ( VideoEnabled() ) {
    videoaction->Pause();
  }
  if ( AudioEnabled() ) {
    audioaction->Pause();
  }
}
コード例 #10
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::Skip(float seconds)
{
  if(system->get_stream(SYSTEM_STREAMID))
  {
    system->Skip(seconds);
  }
  else
  {
    /* No system information in MPEG */
    if( VideoEnabled() ) videoaction->Skip(seconds);
    if( AudioEnabled() ) audioaction->Skip(seconds);
  }
}
コード例 #11
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::RenderFrame(int frame)
{
    if ( VideoEnabled() ) {
        videoaction->RenderFrame(frame);
    }
}
コード例 #12
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::SetDisplayRegion(int x, int y, int w, int h) {
  if ( VideoEnabled() ) {
    videoaction->SetDisplayRegion(x, y, w, h);
  }
}
コード例 #13
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::ScaleDisplayXY(int w, int h) {
  if ( VideoEnabled() ) {
    videoaction->ScaleDisplayXY(w, h);
  }
}
コード例 #14
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
void MPEG::MoveDisplay(int x, int y) {
  if ( VideoEnabled() ) {
    videoaction->MoveDisplay(x, y);
  }
}
コード例 #15
0
ファイル: MPEG.cpp プロジェクト: Jay-Jay-OPL/ps2sdk-ports
/* MPEG video actions */
bool MPEG::GetVideoInfo(MPEG_VideoInfo *info) {
  if ( VideoEnabled() ) {
    return(videoaction->GetVideoInfo(info));
  }
  return(false);
}
コード例 #16
0
bool MPEG::SetDisplay(MPEG_DisplayCallback callback, void *data, SDL_mutex *lock) {
  if ( VideoEnabled() ) {
    return(videoaction->SetDisplay(callback, data, lock));
  }
  return(false);
}